circle detection
circle detection
i am new to imagmagick and would like to know if there is any way to detect circle from following image.
i have posted this twice and somehow my account gets delete immediately!!
i have posted this twice and somehow my account gets delete immediately!!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: circle detection
This is not an easy problem. The best approach is a circle Hough transform. But IM has neither linear nor circular Hough transforms.
Best bet is to try working with edge detection and contrast and noise filtering. See -convolve or -morphology convolve at
http://www.imagemagick.org/Usage/convolve/
and
-edge at http://www.imagemagick.org/script/comma ... ek6l6#edge
Best bet is to try working with edge detection and contrast and noise filtering. See -convolve or -morphology convolve at
http://www.imagemagick.org/Usage/convolve/
and
-edge at http://www.imagemagick.org/script/comma ... ek6l6#edge
Re: circle detection
i tried using circle Hough transform using emgu, but just cant get the circle detected.
i might need to process the image a bit, but dont know what operation will make visible the circle.
http://www.emgu.com/wiki/index.php/Main_Page
i might need to process the image a bit, but dont know what operation will make visible the circle.
http://www.emgu.com/wiki/index.php/Main_Page
Re: circle detection
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.
Re: circle detection
thanks for the info.
I will try to get the edges with it and see how that goes.
also, once i have the circle edge detected, is there a way to split say an image with 2 such circles into two distinct images ?
thanks again
I will try to get the edges with it and see how that goes.
also, once i have the circle edge detected, is there a way to split say an image with 2 such circles into two distinct images ?
thanks again
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: circle detection
Once you have the circles, you can mask out those areas and extract them from the original (or cleaned) image.
That is purely composition masking.
That is purely composition masking.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: circle detection
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.
thanks
i am surely not an image processing expert, so need some input or example if possible.
thanks
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: circle detection
see http://www.imagemagick.org/Usage/layers/#convert and http://www.imagemagick.org/Usage/compose/#compose
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.
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.
Re: circle detection
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.
any help would be appreciated.
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.
any help would be appreciated.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: circle detection
can you post a link to your image? I am not sure what you mean by split them apart and identify them? Identify them in what way?
Re: circle detection
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: circle detection
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.
see
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/#compare
see
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/#compare
Re: circle detection
i have made this template and try to find circles from the image i get from compare command
but still circles are undetectable.
but still circles are undetectable.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: circle detection
try one dark centered circle for the template, similar in shading as in your image of multiple circles
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: circle detection
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.