Ask Your Question
1

How to decrease the number of processed frames from a live video camera?

asked 2012-06-26 06:33:10 -0500

Rui Marques gravatar image

If you are processing frames from a camera that captures at 30FPS, what is the best way to decrease the amount of processed frames, assuming you won't be able to process them all in real time?

Answers adapted to the OpenCV4Android frame capture samples will be valued.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2012-06-27 10:35:39 -0500

Vincent Rabaud gravatar image

updated 2012-07-24 07:46:58 -0500

Kirill Kornyakov gravatar image

when you use the VideoCapture object, the set member function is what you need to check (with the property CV_CAP_PROP_FPS).

For Android devices, I know it's a pain because there are so many cameras and I doubt they all support that feature.

What I would recommend is to multi-thread your code: have one thread that keeps calling ::grab(), and your other slower thread that calls ::retrieve() on the latest grabbed frame and then processes an image as slowly as it wants.

edit flag offensive delete link more

Comments

I havethe same issue!! I want to know is grab() a native function? shall I need to make JNI calls? when I try to use the Videocapture class and instantiate an object inside onCameraStarted callback of opencv4android API to call grab () and retreive(), it is showing error!! Is it that It has to be in a c++ file and a JNI call need to be made??

sumitsh87 gravatar imagesumitsh87 ( 2013-03-04 03:42:23 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-06-26 06:33:10 -0500

Seen: 6,639 times

Last updated: Jul 24 '12