Ask Your Question

How to limit the number of FPS from camera

asked 2012-07-23 09:45:26 -0600

irv4479 gravatar image

updated 2012-07-24 02:25:13 -0600

Kirill Kornyakov gravatar image

I´m doing an application that recognizes speed limit signs based on Face Detection Android sample. I´ve got application almost done, when I show to camera one photo with speed limit signal inside, app detects an identify signal, It takes less than 1 second. The problem starts when I started tests mounting device on a car dock because when I get moving detection step fails continually. I'm using native detection_based_tracker and seems that it get saturated so I want to pass less frames to it. Is there a way to fix native camera FPS? I would need only approximately 5-10 FPS.

Thanks in advance.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2017-09-22 08:59:38 -0600

Do This Thing:::

import cv2 import numpy as np

cap = cv2.VideoCapture(0) fps=0 #for decreasing fps

while True: ret, if fps>=10: cv2.imshow('frame drop',frame) fps=0 fps+=1 if(cv2.waitKey(1) & 0xFF==ord('q')): break

cap.release() cv2.destroyAllWindows()

This code will help you to drop frames

edit flag offensive delete link more

answered 2012-07-23 09:59:57 -0600

sammy gravatar image

Set your camera FPS to a lower value

VideoCapture cap(0);
cap.set(CV_CAP_PROP_FPS, 10);
edit flag offensive delete link more


Sorry Sammy, but it seems that solution that you propose doesn't works on android. Highgui.CV_CAP_ PROP_FPS doen't exists on android.

In sample there is VideoCapture mCamera.

When I Try mCamera.set there is no option to fix FPS.


irv4479 gravatar imageirv4479 ( 2012-07-25 08:11:31 -0600 )edit

Question Tools

1 follower


Asked: 2012-07-23 09:45:26 -0600

Seen: 22,717 times

Last updated: Jul 24 '12