LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing Time in OpenCV Face Detection.vi

Hi all,

 

I'm new to LabVIEW. I'm trying to use OpenCV with LabVIEW, so I studied the sample codes provided in LabView OpenCV Utility. I tried to modified the vi and the c++ codes a bit to help learn better. There is one thing I tried to add is to measure the process time per frame. To get the time in LabVIEW I added in a flat Sequence Structure and two Tick Clock. In C++ I use the StartStopTimer provided in OpenCV. It is interesting to find that the elapsed time in LabVIEW is always more than the measured time in C++, with a difference of about 20ms. I wonder why this is caused, hope not from my mistake in codes. 

 

Anyone can give any suggestions? Much appreciated. 

Download All
0 Kudos
Message 1 of 4
(2,247 Views)

Your Flat sequence is poorly specified. A frame will start when all data is available, and since your 1st frame has no data dependency it'll start directly, while the 2nd one will have to wait for the incoming data. Wire Error through the 1st frame and you'll measure better.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(2,212 Views)

Hi Yamaeda,

 

I believe your comments explained why the measured time for 1st frame is always much larger. Thanks. 

 

However, for 2nd onward frames, will this still be an issue? You can see the screen shot I put in the first post. The left side is the elapsed time I captured in C++, while right side is in LabVIEW. In both text files, I have taken down the frame number so that I make sure they tally with each other. 

 

Now if we see frame 86, on left side it takes about 75ms, but on right side it takes 97ms. It happened for all the frames. I wonder where is this difference come from. 

 

Rgs,

0 Kudos
Message 3 of 4
(2,197 Views)

I suspect the time measured vi call is in a loop? If so you'll need to rerun the test and check again since it'll affect all frames, not just the 1st. It's hard to gain much info from a picture, post the VI(s).

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 4
(2,182 Views)