I am working with python opencv and I am not able to disable autofocus, autoexposure etc on windows 10.
I am using Logitech BRIO 4k webcam.
Everything works perfectly on Ubuntu 18.04. With Opencv 3.4.4 using v4l backend I am able to set focus, exposure, video resolution successfully. However the same code doesn't work on windows
on windows I have tried:
Unofficial pre-built OpenCV packages for Python: opencv-contrib-python https://pypi.org/project/opencv-contrib-python/
build from source opencv 3.4.3 with MSMF, VFW, DSHOW backends.
With VFW I am not able to open video capture at all
build from source opencv 4.1 with MSMF, DSHOW backends
in every case above (except VFW backend) I am able to use opencv functionality, read and show frames from a webcam, but not able to disable autofocus.
code that I use from official opencv GitHub repo https://github.com/opencv/opencv/blob/master/samples/python/video_v4l2.py
I create video capture like so to specify backend VideoCapture(0 + BACKEND_ID) where BACKEND_ID is taken from here
https://docs.opencv.org/3.4.3/d4/d15/group__videoio__flags__base.html
Environmental variable OPENCV_VIDEOIO_DEBUG=True
confirms that I use particular backend
Questions on the same topic without answers Disable webcam's autofocus in Windows using opencv-python
cap.set( cv.CAP_PROP_SETTINGS, 1 );
doesn't work on both windows and linux
Since the code works on linux I believe that the problem is in the videoio backend. Can you suggest some other backend or maybe v4l analog on windows that opencv supports.
Forgot to mention, I was using virtual box to run on windows.
If I run the same code on windows machine directly everything works))
Must be some problem with virtual box
The only difference is that focus values seem to be in range 0-255. But in the sample code I provided above they are in 0-100 range
Related
I'm using wsl version 2 and Xlaunch to connect with x11 server. The problem is when I'm running this code:
import sounddevice as sd
print(sd.query_devices())
It returns nothing or even running $python3 -m sounddevice ,again returns nothing. what can be the problem?
You mention setting up Xlaunch (VcXsrv), but this only provides graphical support, not audio. PulseAudio is typically used to provide a connection between the Linux code running in WSL and the Windows audio source.
While you can configure PulseAudio manually, I would recommend simply using the WSLg feature of WSL2, since it's now available for both Windows 10 and 11 users. WSLg should automatically configure PulseAudio for you with no additional effort.
See this Ask Ubuntu answer where I cover how to upgrade your system (hopefully) to the latest Windows release and then upgrade WSL to use the 1.0.0 (or later) application package that includes this support.
I have created an app that displays rtsp streams in Kivy grid view. It works just fine on my computer, but when I deploy it to another PC everything works up until the video needs to be playing in the grid (i just get white squares in the lower left of the tile). I strongly feel that there is a package I need to download that Kivy Documentation does not mention.
I have pip installed all kivy dependencies, Cython, and Pillow on the other PC.
I would like to see video in each block as I do on the PC that I built the app on
No RTSP Stream Coming Through
***Update: (On the other PC (mini PC)) I uninstalled Python 3.7.3, reinstalled it, installed kivy in the proper order according to their install for windows documentation, and installed Cython. This got it working but now some the text is missing in the app. Also, I am getting multiple .dll errors (libopus-0.dll and libgstopus.dll) I tried removing gstreamer from the python share folder and that got it back to just showing white boxes.
Hey guys I want to get the live video frames from my usb webcam connected to my Pynq FPGA. The goal is to make motion detection on each frame but I've been struggling to get a live video. I've tried the first example in this link but I get a really bad frame rate. I tried to get a better rate by adding the following line:vc.set(cv2.CAP_PROP_FPS, 60) but it didn't change anything. I tried an example in MATLAB and I had no problems connecting to the webcam and I had a smooth frame rate.
I've read that OpenCV can't be used together with Python3 yet but I still get images in the notebook what I don't understand. I also don't know how to install other packages or libraries like pygame for jupyter notebooks on the pynq, it says everywhere that I have to enter pip install "name" and put the library in the site-packages directory but I haven't seen that directory on jupyter notebooks. So I'm trying to find a way without installing new libraries.
I really need your help guys, do you have some suggestions how to get a live video stream from my webcam on jupyter notebooks?
OpenCV can work with python3. I am using that
at first you need to install pip, it is pretty easy flow.
After that connect the board to the web and use pip install
I'm trying to connect raspberry pi with MatLab. I use the toolbox within matlab to configure raspberry pi. It automatically connects through network however it also gives you OS within that setup procedure, you can't connect to raspberry pi without it. Although the system it gives is technically Raspbian Jessie it comes with limited package.
When it launches and I input dir into console it only shows files such as: satkin_ws install ros_indigo.sh install_ros_package.sh and ros_catkin_ws. No other folders or files are pre-loaded onto the system. I tried to install some packages for display manager such as gdm3 and lightdm but I still have a problem with loading desktop environment. Can someone give me suggestions on how to resolve this issue?
Alright after doing some research I found that the system installed by Matlab is Raspbian Jessie Lite which does not come with GUI/Desktop environment by default but you can install it you want. Here is the link to get you going:
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=133691
I'm working with python and using wx for my GUI. I'm using OpenCv to capture frames from my webcam and this works fine when using the webcams default driver. However, I'm also trying to use pyUSB with a libusb backend to detect which USB devices are plugged in at any given moment. In order to use pyUSB to determine which devices are plugged in, I need to use libusb to generate a driver for the webcam. The driver generated from libusb is automatically installed and then I can use pyUSB's find usb.core.find method to enumerate the USB devices connected.
My problem is that now OpenCv is unable to capture frames. I believe my code actually gets a camera capture object and it gets the frames, but the frames are black. I can immediately check that the driver is causing the problem by uninstalling the libusb driver and reinstalling the default webcam driver. Do I need to instruct OpenCv to use this new libusb driver? If so, how? Google didn't turn up anything obvious.
Edit: In case it's important, I'm on Windows 7 64 bit using python 2.7.3