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.
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.
01-27-2015 02:50 AM
Hello All
I want to design program that can counting moving object that inter ROI from one side and come out from the other side, I want to give each object ID number
I have design a program that compare between object distances from one frame to the next frame, but the program efficiency is very low
If any one can give me a sample code that I can use or modify it to suite my application
01-27-2015 04:00 AM
Hello,
if your setup permits it (i.e. static camera, indoor,...), you could use background subtraction. Simply take the frame without the objects and use it as a reference. Then subtract each subsequent frame from the reference one and threshold the data (you would probably need to use some morphological operations to "clean" the result).
More advanced method would be to use the adaptive background model. There are quite a few methods out there, but if you don't need to fully understand the process, you could just use the OpenCV GMM implementation (as a .dll in Labview).
Do the paths of the objects intersect? If they do, the objects ID would be more difficult to track.
You could also use optical flow to track the objects after you establish an initial location.
Always, it is good to provide some sample images to better present your problem.
Best regards,
K
01-27-2015 04:13 AM
Thank you for your replay
First I didn't have any problem for detect moving object, I have built more algorithm for detecting obgect including Background subtraction
Second obgect doesn't intersect, the problem that I face that counting program and connect each object through multible frame, and give the new object inter ROI new ID
Third for OpenCV, It is the first time to now that you can get library from Opencv In labview if you have much information please show it
Thanks
01-28-2015 03:14 AM - edited 01-28-2015 03:28 AM
Hello,
my mistake. Seems I misinterpreted your question.
Below is the example of object ID labeling, assuming that the object detection is already performed in the previous step. It will assign a new ID for each new object and keep the ID throughout the field of view of camera. The ID labeling is based on minimum Euclidean distance of object's centers between two successive frames.
The only problem is when the object goes out of field of view of the camera. The labeling is then incorrect (this can of course be modified).
Tell me if this helps and I can attach the example code.
P.S.: The process takes ~12 ms per frame on my computer (includes reading the 11 images (~500x200 resolution) shown in the animation).
Best regards,
K
01-28-2015 03:41 AM - edited 01-28-2015 03:43 AM
Very Good
This is what I need
If you have example cood please shear it
for the time talken to excute the code, it is very long for my application
can you tell me you computer specification
01-29-2015 01:08 AM - edited 01-29-2015 01:08 AM
Hello,
you will find the code in the attachment (saved for LV2013). There is a longer delay inside the loop, remove it for efficiency.
Roughly measuring the time to read an image, the processing takes ~8 ms on my computer (~500x200 image resolution). That is ~125 samples/images per second. Is this not fast enough for you? Considering better image resolution, the time is of course increased.
My specifications:
Core i7 3632QM
6 Gb RAM
Win 7 x64 (Labview x86 though).
Best regards,
K
01-31-2015 03:13 AM
Hello
Thank you for your example code, that exactly what I need
I had tried using your code for my application the program give a good result, but when object move out from the ROI the program give false result
Can you fix this problem? or tell me what should I do to modify your code to fix this problem?
If you will fix this problem I will accepte the next post for you as a solution, if not I will accept the last post for you as a solution
Thanks Klemen for your help