Reader small image

You're reading from  Qt 5 and OpenCV 4 Computer Vision Projects

Product typeBook
Published inJun 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789532586
Edition1st Edition
Languages
Right arrow
Author (1)
Zhuo Qingliang
Zhuo Qingliang
author image
Zhuo Qingliang

Zhuo Qingliang (a.k.a. KDr2 online) is presently working at Beijing Paoding Technology Co. LTD., a start-up Fintech company in China that is dedicated to improving the financial industry by using artificial intelligence technologies. He has over 10 years experience in Linux, C, C++, Python, Perl, and Java development. He is interested in programming, doing consulting work, participating in and contributing to the open source community (of course, includes the Julia community).
Read more about Zhuo Qingliang

Right arrow

About real time

When we handle videos, either video files or real-time video feeds from cameras, we know that the frame rate of the videos is about 24-30 FPS in general. That means we have 33-40 milliseconds to process each frame. If we take more time than that, we will lose some frames from a real-time video feed, or get a slower playing speed from a video file.

Now, let's add some code to our application to measure how much time we spend on each frame while detecting objects. First, in the Detective.pro project file, we add a new macro definition:

DEFINES += TIME_MEASURE=1

We will use this macro to switch the time-measuring code on or off. If you want to turn off the time measuring, just comment this line out, then rebuild the application by running the make clean && make command.

Then, in the CaptureThread::run method, in the capture_thread.cpp file, we add some...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Qt 5 and OpenCV 4 Computer Vision Projects
Published in: Jun 2019Publisher: PacktISBN-13: 9781789532586

Author (1)

author image
Zhuo Qingliang

Zhuo Qingliang (a.k.a. KDr2 online) is presently working at Beijing Paoding Technology Co. LTD., a start-up Fintech company in China that is dedicated to improving the financial industry by using artificial intelligence technologies. He has over 10 years experience in Linux, C, C++, Python, Perl, and Java development. He is interested in programming, doing consulting work, participating in and contributing to the open source community (of course, includes the Julia community).
Read more about Zhuo Qingliang