01-08-2013 06:13 AM
Hi everybody,
I am using a cam to get the image of the star target.
My object is to get the center coordinates of the star target (see below)
As you can see the center of the star is not in the middle of the circle but shifted to a random direction.
I've tried almost everything so far, even tried to construct linear equiations along the "black and white" structure to get a point of intersection which would be the central point. But everything failed.
I don't see a good "working" solution to solve this problem.
I need help to solve this issue.
Thanks in advance!
01-08-2013 07:44 AM
Here's a crazy idea that might work:
I am assuming you can find the circle, but can't find the center of the star.
Use edge detection to find the edges. This should give you radial lines, all passing through the center.
Write a Hough transform routine and use the edge points (and perhaps their intensities) to find the lines. You should be able to manipulate the data to get the intersection of all the lines. There might be some kind of transform that would get the center point directly.
Bruce
01-09-2013 04:14 AM
Thank you for your reply!
Actually this was also my first idea.
But i can't manage to detect the edges with Vision, it simply doesn't work.
It could be due to my inexpirience with Vision though.
Are there any "tricks" how to handle this?
Greetings
01-09-2013 07:53 AM
Hi,
there are some interesting documents and examples for edge detection:
Examples:
Hope this helps you.
Best regards
Suse
01-09-2013 09:54 AM
I was thinking simple edge detection using a filter, such as IMAQ EdgeDetection with Sobel.
I'm not so sure about the second part, though. After a Hough transform, each line will be a point, but they will all be different points. I think the points would make a circle, but I am not sure. It might be difficult to get a single point with any accuracy after two transforms.
Do you have the option of using something else instead of the star? This is a difficult task that would be much easier with a different target.
Bruce
01-09-2013 10:06 AM
I just realized I was overthinking this problem.
Does the pattern remain exactly the same, just shifted or possibly rotated? If so, just use pattern matching. It will locate the pattern, then you just need to add the offset to the star center.
When you create the pattern, you may want to mask out the star center. That area will vary and might confuse the pattern matching algorithm. Instead, just let it concentrate on the outer stripes that are well defined.
I zoomed in on the image you attached and realized it is a binary image, for the most part. It isn't a picture of a real pattern. That could make a difference, so make sure you create your pattern the same way you will do your matching.
Bruce
01-09-2013 01:48 PM
In Vision Assistant I tried the following, maybe something to start with (or totally throw out the window):
1. Color plane extraction- Luminance
2. Edge Detection- Differential
3. Gray Morphology- Erode, 3x3 Kernel vertical crosshair style, 4 iterations
4. Find Centroid to yield the coordinates.
-AK2DM
01-10-2013 06:33 AM - edited 01-10-2013 06:37 AM
Thank you for your replies!!!
Unfortunately the pattern doesn't remain the same, it changes in size and location of the star center.
The attached picture was just an example and not the "real" target.
In reality it's a camara image formed through light. So there is no chance in changing the target.
@Suse
Thank you for the informative links!!!
@AK2DM
I will try this later! Did you already try this in LabvView and if yes does it work?
Best regards
01-10-2013 07:28 AM
If you could post one or two real images, that would be helpful. The Vision tools will produce very different results for the real image and the example you posted.
Bruce
01-10-2013 08:43 AM
I tried it in Vision Assistant, not LabVIEW.
On the 87x90 pixel image, the Centroid was reported at 32.55x35.58, which looks pretty darn close by eye.
-AK2DM