Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB camera issue #45

Open
immkapoor opened this issue Nov 4, 2021 · 12 comments
Open

USB camera issue #45

immkapoor opened this issue Nov 4, 2021 · 12 comments

Comments

@immkapoor
Copy link

I am using a simple logitech usb camera with jetson xavier but I am getting a uvc_find_error error but the camera is getting detected and activated. Everything is working well with simple codes.

@immkapoor
Copy link
Author

Can you please provide me the dependencies for this repo? Which versions of opencv and pytorch are you using?

@tomasz-lewicki
Copy link
Owner

tomasz-lewicki commented Nov 9, 2021 via email

@immkapoor
Copy link
Author

@tomek-l Thank you for responding. I am using a FLIR E75 camera along with legion usb camera. Both are getting detected by other codes but i am getting a device error while running this code. I am using opencv v4.4.0. I am getting warnings from gstreamer. Can you suggest anything? It'll be helpful.
Screenshot from 2021-11-09 12-25-58
r

@tomasz-lewicki
Copy link
Owner

Hi @immkapoor,

Here you would change:
https://github.com/tomek-l/ai-thermometer/blob/6be49fe3880a3381ed5b66a7fcbf8b74992ab476/rgb/rgb_thread.py#L24

To something like:

self._stream = cv2.VideoCapture("/dev/video1")  

Where /dev/video1 will be device handle to your USB webcam.

@tomasz-lewicki
Copy link
Owner

I implemented this project with Raspberry Pi CM V2.1 which is a CSI (Camera Serial Interface) camera, which has different API than your USB camera - that's why you're getting errors.

Keep in mind that when you get these two to work without errors, you will still have to make sure that the images from the two cameras "align". It's fairly simple for FLIR Lepton 3.5 and Rpi CM V2.1, because they have very similar field-of-view.

@immkapoor
Copy link
Author

@tomek-l I made the suggested changes. But I am still getting the same error. The usb camera is getting enabled but I am not able to see the camera's capture screen. Do you think it's because of warnings raised by gstreamer
Screenshot from 2021-11-09 13-44-37
?

@tomasz-lewicki
Copy link
Owner

That's odd. Did you remove the call to make_imx219_capture()?
That's the line of code that initializes gstreamer pipeline.

@immkapoor
Copy link
Author

@tomek-l No, i haven't made any changes in code. Just added legion camera in init.py and flir camera in rgb_thread

@immkapoor
Copy link
Author

@tomek-l Hey, I was able to solve the Gstreamer warning by replacing cv2.VIdeoCapture("/dev/video*") in cv2.VIdeoCapture("/dev/video", cv2.CAP_V4L2) and if I do make_imx_capture() then I get uvc device error and program terminates. If I replace that with another simple video capture then also I get ucv find device error but nothing comes on screen. Do you have any idea?

@immkapoor
Copy link
Author

@tomek-l I am not able to find the find device error in init code of libuvc wrapper. Can you please tell me where its definition is coming from?

@tomasz-lewicki
Copy link
Owner

Hi @immkapoor

These two are two separate methods of creating a camera device:

  • cv2.VIdeoCapture()
  • make_imx_capture()

You have to choose just one. Since you are working with a USB camera, I recommend doing cv2.VIdeoCapture("/dev/video0", cv2.CAP_V4L2) and deleting the make_imx_capture() call.

@tomasz-lewicki
Copy link
Owner

As far as the error codes go, you can look them up in libuvc source code.

Specifically, in libuvc.h you have definitions of what each error number means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants