MATLAB: Get the coordinates of a pixel

coordinatesImage Processing Toolboxsquare area

Hi! I'm new in matlab.I try to identify a pixel at the intersection of the four black and white squares and get the coordinates of the pixel. How can i start first, what is the method? Thanks

Best Answer

I'd probably first crop the image to the known region where the pattern lives. Then I'd threshold the image to find the gray boxes. Then I'd call imerode a little bit to make sure the gray boxes are separated. Then I'd find the centroids with regionprops() and say the center is at the average of the centroids.
Another method might be to call an edge detection filter to get a cross, then split the cross into two sets of points by ignoring points near the center. Then call polyfit twice and see where the equations of the lines cross using simple algebra.