I’m trying to detect the gridlines in images like this:
I have 10,000 of these images, so I can’t tweak thresholding on each one.
These images are pictures of copepods photographed over a 1mm square grid; the ultimate goal is to be able to use these photographs to measure the copepods.
The problem currently at hand is how to reliably identify and measure the grid.
What I’ve tried so far
Working in scikit-image, I can perform edge-detection with canny, then find the lines using a hough transformation, with mixed results.
Next I identify the intersections between the lines, select an intersection at random, and attempt to measure the side length of the grid in pixels.
Because canny finds both edges of each gridline, hough often finds more than one line per gridline. Having extra lines leads to having multiple intersections in close proximity, making it more difficult to identify the grid size.
Is there a way to get edge detection and/or hough to give me only one line for each gridline?
Is there a good way to merge the lines that I get out of hough?
Is there some other way to solve this problem that I haven’t thought of?