Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
If the circles are always the same size and shape, or a small set of sizes, then you might just edge detect and clean things up like fmw42 said, but then just cross-correlate with a known good sample(s) that were also edge-detected and cleaned up. You might also try it without edge detection if the images of the objects are usually similar.
could you please guide me to appropriate example for composition masking.
i am surely not an image processing expert, so need some input or example if possible.
But why do you need image composition for circle detection?
If you want to do things manually, you can measure the center of the circle and a point on the perimeter of the circle and just draw a red circle over your image. see -draw http://www.imagemagick.org/Usage/draw/#circles the circle can be transparent in the middle and just red or some color on its perimeter.
actual scenario is,
i have scanned image with a rectangle block (fix size) with bunch of holes (fix size, diameter).
what i am trying to do is, determine each hole distinctly
e.g. if i have 15 holes (5 in each row), i need some way to split them apart from original image and identify them uniquely ..like say
A > 0, 1, 2, 3, 4
B > 5, 6, 7, 8, 9
C > 10, 11, 12, 13, 14
so in about case i will have A0, A1, ....to C14
i am sure there is better way of doing it, but i am just not that savvy in this field.
i have upload image with 4 circles
so here i take top left corner as start and label it as A then that row contains two columns
and row under it i call it say B
A | 0, 1
B | 2, 3
so in that above image top row is A and bottom is B, first column start at index say 0 and it goes upto 3 to make total of 4 circles.
so i want to identify A0, A1, A2, A3 by splitting them from this original image such that, if i have A3 image with me i know where it belongs to in original image.
let me know if that makes sense.
thanks
You can try template matching. Get a subsection of your image or create a dark circle of the size you have in the image. Then use compare to compare the smaller template circle with the larger image. An example can be seen at viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076 That should produce a two-frame image of which the second is similar to what is shown, but in your case there should be 4 bright dots. The locations of those 4 dots, should be the corresponding location in the larger image where the upper left corner of the template best matches.
I tried several variations and the similarity image is not showing enough variation to pick out the best matches for your images. Sorry I tried negating the images and also making edge images and neither works well enough.