1

I am working on a project with OpenCV. It is running on a Raspberry Pi 3 B+. When i start the camera, and do some visual processing the framerate becomes really low and there is a lot of lag. My question is: Would lowering the camera resolution solve my problem(if yes how do I do it)?

asked Mar 29, 2020 at 23:01

1 Answer 1

2

If you are using the full resolution and a high frame rate, it is very likely that the processor and/or memory is getting exhausted (depending on what kind of processing you are doing). So, yes, lowering the camera resolution may solve the problem.
You do not say what programming language you are using. In python you can change the resolution like this:

import cv2
cap = cv2.VideoCapture(0)
cap.set(3, 640) # Set horizontal resolution
cap.set(4, 480) # Set vertical resolution
_, img = cap.read()
cv2.imwrite("lower_res.jpeg", img)

Further reference here: https://docs.opencv.org/3.3.0/d8/dfe/classcv_1_1VideoCapture.html#a8c6d8c2d37505b5ca61ffd4bb54e9a7c

answered Mar 29, 2020 at 23:30
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.