Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Center of a star target

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!

 

 

 

 

 

0 Kudos
Message 1 of 12
(4,313 Views)

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

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 12
(4,307 Views)

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

 

0 Kudos
Message 3 of 12
(4,295 Views)

Hi,

 

there are some interesting documents and examples for edge detection:

 

Using Edge Detection in Machine Vision Gauging Applications: http://www.ni.com/white-paper/4536/en

 

Examples:

 

Edge Detection: http://zone.ni.com/devzone/cda/epd/p/id/5552

Straight Edge Detection: http://zone.ni.com/devzone/cda/epd/p/id/5613

Continuous Edge Detection Using Morphological Filters: https://decibel.ni.com/content/docs/DOC-24921

Edge Detection Examples: http://zone.ni.com/devzone/cda/epd/p/id/2981

 

Hope this helps you.

 

Best regards

Suse

 

______________________________
Certified LabVIEW Developer (CLD)
Message 4 of 12
(4,291 Views)

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

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 12
(4,288 Views)

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

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 12
(4,286 Views)

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

 

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 12
(4,278 Views)

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

0 Kudos
Message 8 of 12
(4,267 Views)

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

Bruce Ammons
Ammons Engineering
0 Kudos
Message 9 of 12
(4,257 Views)

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

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 10 of 12
(4,251 Views)