Set WebCamera focus with OpenCv in Raspberry Pi - opencv

I have a logitech C920 Web camera.
I was able to follow this https://stackoverflow.com/a/42819965 to get the autofocus turned off and manually set the desired focus while I ran the python code on My Windows 10 pc. Also, I could see the changes in focus when adjusting value.
But when I tried to connect the same camera to Raspberry Pi (3 B+ ) and run the same code, for whatever the value of focus I set, it just doesn't respond. Same blurry images always.
What could be the possible reason for this?

Depends on the driver and/or video backend used by cv::VideoCapture.
You can try setting the focus directly with v4l2-ctl:
https://www.christitus.com/logitech-c920-linux-driver/

Related

openvr driver about overwriting vive hmd positioning and getting vive hmd gyroscope rotation data

I created an openvr driver and it works fine. I have tried adding a device in the driver: TrackedDeviceClass_GenericTracker, this tracker device receives 3rd party positioning data via UDP, and overlays the positioning data with the helmet positioning data by using trackingoverrides; I don't use a base station.
The problem now is:
When I use trackingoverrides to override the HMD positioning, the window of the steamVR application immediately pops up a prompt box, prompting me to set the room, the error code is C200; and the VR view is not displayed on the PC.
enter image description here
I see there are some methods that say other chaperone json files can be used directly, but I don't know how to use it, can anyone tell me the details? How to unify the coordinate system in the openvr driver, and how to avoid the frequent pop-up of room settings in steamvr?
I want to use the position data in the third-party positioning data in the driver (without its rotation), and then use the rotation data of the HTC VIVE helmet's own gyroscope, and combine the third-party position data with the rotation data of the HTC vive helmet's gyroscope. After fusion, I set the positioning and rotation of the helmet together, because I know its own gyro rotation data is very accurate. Is my method correct? And how to get the rotation data of HTC vive helmet gyroscope through openvr driver? Note that I do not use lighthouse base stations.
I have tested a lot of examples, but all of them have the above problems, including the vive official git sample, OpenVR-driver-for-DIY, Simple-OpenVR-Driver-Tutorial and many more.
Hope to get help, thanks. I asked the same question on the steam forum because I was really bothered by it for a long time, I hope to get help, thanks.

Is it possible to remove camera frame but still continue detection in command prompt console?

I am working with YOLOv4 for detection through IP Camera. I have a GUI for camera control. So I don't want the camera frame to show the detected objects. However, I want the detected objects and the percentage to be shown in the Command Prompt console. Is it possible to make that? If yes, please suggest the way. Thank You
Add -dont_show after the command

V4L2 / Beaglebone Black / Radiumboard HD Camera / Controls

I am trying to take snapshots with a Beaglebone Black paired with a RadiumBoards HD Camera Cape. I've noticed that using the built-in application (like cheese) will auto-adjust exposure. However, if I write custom C/C++ code on top of the v4l2 libraries to take a snapshot, the exposure is off (too bright or too dark, rarely correct). I would like to be able to either manually adjust exposure or allow the camera to auto-adjust. How can I do this in C/C++ source code?
Resources online indicate that I can change exposure settings through v4l2-ctl. This doesn't work for me. When I issue v4l2-ctl -l to list available controls, I get none.
The driver is reported as cssp_camera version 3.8.13.
I am not really sure if this is the issue, but you may try to specify the device that you want to control.
Assuming that is /dev/video0, you may do that by:
$ v4l2-ctl -d /dev/video0 -l
I am also assuming that you have granted permissions to the device.
Hope that I have helped.
Cheers

OpenCV Ip Camera Image Deterioration

I have successfully connected with a IP camera using OpenCV. If I just show the image using imshow, then it's all fine... But if I try to do some CPU processing with the image (I equalize the image and run a face detector...), the image starts to deteriorate (I keep getting ac-tex damaged in the console)... Is starts to blur and blur and blur... I dont know why this is happening. I can confirm that this does not happen when getting images from my iSight camera (I am running on a iMac...) Besides that, I am having a really weird time with OpenCV. The face detection doesn't seem to work when I run the app in Release mode. I am on Windows 8 and using VS 2010.
Can someone shed some light at these problems?
I suggest you break up your problem into small parts. Some questions that I have for you:
The image capture and presentation are working without any processing?
A local camera with the face detector algorithm is working?
You said about release mode, it means that is working on the debug version?

How to disable automatic white balance from Webcam?

I got a webcam and I'm running some algorithm on the received images to find movements in it.
But, the automatic auto white balance is changing the excepted result of the pixels color variance.
That's why I'm trying to disable it.
Some one knows a way to get the web can image with out this automatic color balance or disable it ?
Tks
If you are on Linux, you can test disabling automatic white balance using the uvcdynctrl command line utility. This is not a permanent solution, since these settings are reset every time the webcam is disconnected from the computer. As of OpenCV 2.1, configuring white balance is not supported using cv::VideoCapture::set(). Assuming this is still the case in OpenCV 2.2, you will need to use another library to configure your webcam and capture frames.
If you on Linux, you can see an example of using direct Video4Linux (V4L) syscalls to do this in one of my Github projects.
In my case I found on driver two options that must be disabled, auto white exposure and auto white balance, I disable both of them and the image got as I needed.

Resources