Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
Go to solution

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. 

0 Kudos
Message 11 of 27
(3,513 Views)

(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.

0 Kudos
Message 12 of 27
(3,513 Views)

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

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 13 of 27
(3,511 Views)
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.
0 Kudos
Message 14 of 27
(3,509 Views)

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

0 Kudos
Message 15 of 27
(3,496 Views)

Some more..

0 Kudos
Message 16 of 27
(3,496 Views)

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
(3,430 Views)
Thanks, i will give it a try next wednesday!
Message 18 of 27
(3,418 Views)
Solution
Accepted by topic author henk_kempen

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
(3,292 Views)

Anyone?

0 Kudos
Message 20 of 27
(3,237 Views)