From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

object counting

I have to make a program that can count number of screws on the picture (Image-00.jpg). It can be up to 150 screws and could be different types. I found an example ("Match Multiple Geometric Patterns.vi") that looks like what I need, but I have to use different settings for different mix of screws and it counts wrong from time to time...

Also, it cannot separate 2 similar types (attached picture "1563977562357 (converted).jpg"). Have anybody such experience or ideas?

Download All
0 Kudos
Message 1 of 8
(2,036 Views)

@NPalesund wrote:

Also, it cannot separate 2 similar types (attached picture "1563977562357 (converted).jpg"). Have anybody such experience or ideas?


Well, I obviously can't help because when I look at this picture, I also can't separate two similar types -- I see 11 screws that all look the same (except, of course, for orientation).

 

LabVIEW's Vision routines are some of the most challenging and least documented parts of LabVIEW.  I hope you have several years of LabVIEW experience to tackle such problems.

 

Bob Schor

0 Kudos
Message 2 of 8
(1,992 Views)

It's different diameters - 2.4 and 2.7 mm

But on the Image-00.jpg all screws are the same and still I have the same problems to count

0 Kudos
Message 3 of 8
(1,987 Views)

OK, I need new glasses ...

 

BS

0 Kudos
Message 4 of 8
(1,978 Views)

We need a better description of the problem.

 

"It counts wrong from time to time".  How is is wrong?  Does it count too many, not enough, none?

When using the same picture, is it right sometimes and wrong other times?

 

Are these examples of problem pictures or examples of typical good pictures?

 

150 screws, what does that picture look like?

 

How can we debug a VI that you didn't attach?  (And a picture of code is not very debug-able either.)

 

0 Kudos
Message 5 of 8
(1,958 Views)

Ok, I'll prepare several pictures and VI example on the next week.

0 Kudos
Message 6 of 8
(1,927 Views)

Rule 1 in Vision is to ensuring a good image.

 

Right now, the lightning is 'not optimal'. Note that shadows overlap the objects, making the background as dark as values of the objects.

 

Try backlighting, or at least diffuse lightning. Your shadows are overlapping. That will confuse most algorithms.

 

You can consider a colored background, and a color camera. That would make it easier to separate the objects from the foreground.

 

Patter matching might not work very well with directional lightning, as the orientation of the object changes it's looks. A simple object labeling, and then an object analysis might work, but you'd have to do the classification yourself, based on the measurements.

0 Kudos
Message 7 of 8
(1,898 Views)

Also, as metal reflections are circularly polarized, a polaroid filter will remove the specular highlights. That will greatly enhance your contrast.

 

If a commercial circular filter is too expensive (the are), use 3D movie theater glasses. They are CW and CCW circular filters (don't use both Smiley Wink).

0 Kudos
Message 8 of 8
(1,894 Views)