Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
I'm trying to use ImageMagick to find the location of a calibration target in an image. I've written enough code to output a b&w (i.e. bilevel, not grayscale) image, which looks like a small black square on a giant white background. I've used the following code to find the location of the all of the black pixels:
which gives me a text file with <1000 coordinates (the sqaure is about 30x30). However, I'd ideally like the x coordinates average and the y coordinates average to tell me "average location" of the square (i.e. its centre). Is there any way to get IM to output these two coordinates? Thanks!
For a square object, these should find the same coordinate. For some objects, such as a crescent moon, methods (1) and (2) will return a coord that is not inside the object, but method (3) works.