Machine Vision

cancel
Showing results for
Did you mean:

Solved!
Go to solution

Re: Detect dark 'needle' on light background (360°)

I have acces to the computer with LabVIEW and the pictures next monday, so I can upload some pictures then. It is the entire bar that rotates, I thought maybe it is possible to measure the position halfway the bar where he is straight, so the results will be almost the same at the different points.

Message 11 of 27
(4,334 Views)

Re: Detect dark 'needle' on light background (360°)

(halfway the thick part (thats the important part)) You can't see it on this photo, but the end of the bar deviate if he rotates.

Message 12 of 27
(4,334 Views)

Re: Detect dark 'needle' on light background (360°)

So it is more like the needle on a dial?  That is much simpler than what you described before.

Bruce

Bruce Ammons
Ammons Engineering
Message 13 of 27
(4,332 Views)

Re: Detect dark 'needle' on light background (360°)

It isn't really an needle, but it looks like it, also, you have to add different 'needles' to measure, so the one time he's something crooked and maybe longer than other time. Per set pictures he is about the same. Its hard to explain, especially because i don't speak that good english:)(you probably noticed) I thought maybe I can make many rectangles in a circle, and if the red part is above one of the rectangles ,he detects it so you have an number, because I define every rectangle as a number. The main problem is that i only know a few basics of labview.
Message 14 of 27
(4,330 Views)

Re: Detect dark 'needle' on light background (360°)

This are the pictures of one set, before the treshold.

Message 15 of 27
(4,317 Views)

Some more..

Message 16 of 27
(4,317 Views)

Re: Detect dark 'needle' on light background (360°)

I would recommend using the threshold the way you are now.  Use IMAQ Particle to find the center of the red object.  Subtract the center of rotation (select using mouse) to get the relative position of the center of the object.  Use atan2 to get the angle of the needle.

This isn't going to be exact, but it should work pretty well.

Bruce

Bruce Ammons
Ammons Engineering
Message 17 of 27
(4,251 Views)

Re: Detect dark 'needle' on light background (360°)

Thanks, i will give it a try next wednesday!
Message 18 of 27
(4,239 Views)
Solution
Accepted by topic author henk_kempen

Re: Detect dark 'needle' on light background (360°)

It totally worked!!, many thanks, I did it with the combination edge detection and treshold, see the attached images.

Just one more question, is there an way to add a scale to the picture, so you can visually check the position of the 'needle'?

Message 19 of 27
(4,113 Views)

Anyone?

Message 20 of 27
(4,058 Views)