MathJax 3

Showing posts with label Webcam. Show all posts
Showing posts with label Webcam. Show all posts

Friday, 20 May 2022

Webcam not working on Ubuntu

 When it comes to OS upgrade, I'm not the kind of guy who get excited very easily. So, on my main machine which runs on Ubuntu, I tend to install always a LTS versions, which is updated for five years.

The downside is that every year or two, it can happen that some software stops working due to some driver becoming incompatible with a new version of that software, as it happened few days ago with Cheese, the Ubuntu standard webcam application. Also, any other software dependent on that particular driver, stopped functioning.

Luckily, I soon found an easy fix.

After the usual googling, I discovered this project called Linux UVC, which provides kernel support for UVC devices.

To install the webcam drivers, it's enough to install the shared library like this:


sudo apt update

sudo apt install libucv0



To install the development file, instead:


sudo apt update

sudo apt install libucv-dev


 

If you like to build your software from source, here there is their github repository.

Thursday, 12 August 2021

How to fix the webcam not working with opencv on Windows 10


If my blog is not ranked higher than stackoverflow.com, a good chance exists that you have been reading this SO's thread before landing here. Well, if you landed on my blog, it signifies SO didn't help you. If so, then keep reading.

 I installed OpenCV for the first time about 15 years ago. Since I can remember,  using a webcam has always been the most tricky part of working with it. Don't get me wrong, OpenCV is a magnificent open-source library, really of a high standard. But when it comes to closed source drivers, it may suffer from some compatibility problems, as it happens with nearly all open-source software.
There are other times instead when the causes for malfunctioning webcam lye outside of OpenCV source code.

As you may know already, Windows 10 offers some privacy setting which enables the user to exclude any program from using the webcam.
The good news is that these settings might be all that is preventing your webcam from working.
Open Settings and hit Privacy. On the left pane, hit Camera, go in the main panel and scroll all down. If you followed along, you should see this:

 



Make sure the last switch is on. Now, close the Settings and try out your OpenCV code.
Everything works, right?

With no shame, I admit that I reinstalled OpenCV 4.3.5 several times before realizing that switch had been turned off by Windows, for who knows which reasons.

I hope this helped you.