01-07-2017 11:16 AM - edited 01-07-2017 11:18 AM
Hi I have problem with my LV program. My counter doesn't work. My program track a colour object and i try to count how many object appear on the image out in for example 60 sec. Counter count to 130 instead of 1 , 260 instead of 2 390 instead of 3. It is because vision assistant works on frames and make 130 matches instead of 1. (on my avi file of course) I dont know how to do properly counter , Can You help me?
01-11-2017 07:15 AM
Please include the missing template file
C:\Users\Wojtek\Desktop\LABVIEW INZYNIERKA\template 2.png
in your system.
01-11-2017 08:45 AM - edited 01-11-2017 08:50 AM
Ok I attached template. Please look at the blue wire when program is started and open probe watch window then. There is 1 or zero match . I would like to count when is 1 and increment .
01-11-2017 09:13 AM
ok your VI works as expected, it counts one object per frame but the problem is, I guess, that you are reading your AVI file as fast as possible. The AVI file is original acquired at a frame rate of 15 frames per second but your Read AVI and Process loop rate isn't timed and apparently in your case run as fast as 130 iterations (frames) per second.
If you add Wait Until Next ms Multiple primitive inside your loop and input 67 (ms), you'll slow down to something closer to real time and get approx 15 hits per second.
Hope this helps.
01-11-2017 09:27 AM
It's done . The problem is that my result for one cycle is 130 and i want 1 not a 130. Id like to take matches from blue wire and make counter sth like that : If number of matches is (like in blue wire(1 but no 0 )) procedeed and increment , for next full cycle the same. The shift register show from 1 to 130 and it not help me . I need data from blue wire ( 1 or 0) . The counter have to count how many object was on the image . (for 1 cycle 1 , for 2 cycles =2, for 3 cycles =3 when its only 1 object on image ). I need help
01-11-2017 09:52 AM
Ahh you need help ... okey
OK let's recap, here is what I see
1 - You have an AVI file that is supposed to run at 15 frames per second
2 - The AVI file consists of 130 frames (now I see where that value comes from)
3 - What you call a cycle is a repetition of your AVI file so 130 frames or 130 loop iterations in LabVIEW
4 - Each frame detects 1 object and increments your counter by 1
5 - The counter value therefore increases by 130 for every AVI file playback iteration
What is it you do not understand? Do you want to only increase your counter every time the AVI file is wrapping (re-starting)?
01-11-2017 10:11 AM
Let me try to do some more guessing on what you are trying to achieve.
If that's the case what you need to do is to track the object, so increment by 1 when the object appears the first time but stop incrementing if an object is detected in the following frame and the distance to the object in the previous frame is less than a pre-defined value.
That way you know that you are looking at the same object and therefore do not need to increment your counter.
This approach gets complicated if multiple objects can be present on the image at the same time.
1 - You'll have to compare the coordinates between them all to see if it's an object present in the previous frame
2 - It becomes much more complicated if the objects start crossing each others or even come close to each others. You'd then have to look at direction gradients, speed and other parameters to identify and separate the different objects.
01-11-2017 10:41 AM
Yes its complicated but i just divide result for 130 and i have 1 😄 Its simple and satisfy me 😄
You say something about speed of this object, I would like to measure that but i dont know how to do this . I have Coordinates from boundle box and real time . So maby there is opportunity to count a way of object from oordinates then divide / time and it will be velocity. Here is my present project.
01-11-2017 11:05 AM
Is this school homework or actual work?
Velocity can be calculated if you know the distance travelled in a specific amount of time and you have all you need in your example to do that. I'll let you figure out how to calculate that distance based on the positions data.
You timing control is still not correct, refer to my previous suggestions if you want a more accurate real time simulation.
01-11-2017 11:59 AM
Vi with ms multiple