From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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

The IMAQ Count Objects 2 VI.. Gives us the number of objects detected in a frame..
If my object count changes with each frame change. 
How can i sum up to find the total no. of objects encountered throughout the process.

 

(I tried to use shift register with a for loop. but couldn't solve it properly)

 

0 Kudos
Message 1 of 5
(3,033 Views)

Attach your VI.  We can look at it, and make suggestions.

 

If you are able (in a For Loop) to get an accurate count of each Frame, you can bring the wire holding the Count to the right edge of the For Loop where it will create an Indexing Tunnel.  If you wire to that Tunnel from outside the For Loop, you will see you have an Array, which will be all the individual Frame Counts.  There is a function on the Numeric Palette that contains a capital Greek Letter that you might find useful ...

 

Bob Schor

0 Kudos
Message 2 of 5
(2,992 Views)

Sir Bob,

My program VI uses an video as input. I am not sure weather it will work in your system properly. that's why  I am attaching an screen shot of my VI.

 

As you can see there is an Indicator which has all the object counts (at the right hand side.)

the values from the indicator changes with change in frames of the image. I want to sum up the counts of the object.

 

The for loop you suggested may work but I am unable to get a proper indexing vlaue (i.e N value) to initialise the for loop.

 

Thank You

 

 



0 Kudos
Message 3 of 5
(2,983 Views)

You are pretty new to the Forums, so may not have seen posts that say "Do Not Attach Pictures of Code -- Attach the Actual VIs!".  Pictures are largely useless -- you are basically asking us to "copy" your code, spending our time trying to re-create what you've done in order to tell you how to fix it.  Sorry, you aren't paying me enough for such an effort, particularly when you can simply attach your VI.

 

Furthermore, why don't you also attach a sample data file (a small one) so we can have a better idea of the true nature of your question/problem?

 

I'll hold further comments until I've had a change to examine your code and data.

 

Bob Schor

0 Kudos
Message 4 of 5
(2,963 Views)

I'll give some comment, while you work on Sir Bob's (you've been promoted!) request.

 

If you have a video of objects, it sounds like a terrible idea to add the objects per frame. It sounds like you want the maximum of all frames. Adding them will increased the number of objects over time, even if the number of objects stays the same.

Message 5 of 5
(2,947 Views)