I have a bunch of points with their coordinates. I'd like to analyze a binary image containing only black objects - these objects are approximately rectangles - and for each points from my set, assign the nearest object. All I know is for each point in my set there is exactly one object somewhere close to it, I just don't know where.
My idea is to find the objects on the image and then use one of the algorithms for closest pair of points problem. Or would it be better to start scanning the image somehow starting from a point in my set in search for that object? The goal is to find the location and size of these black objects as well. Have been searching for an algorithm obviously better than the one I've mentioned, but without much luck.