tomasz-lewicki / ai-thermometer

Fever screening with IR & RGB cameras and Deep CNNs
148 stars 39 forks source link

Using an USB camera #35

Open jjferreira opened 3 years ago

jjferreira commented 3 years ago

Hi there how can make this code run using a usb camera, instead of the camera suggested in your article.

tomasz-lewicki commented 3 years ago

Hi @jjferreira !

1) You're probably better off using CSI camera. Using a USB camera will need more CPU to copy data & decode the video stream from USB. 2) If you still want to use a USB camera here's how you'd do it:

Substitute this line from

cap = cv2.VideoCapture(gst_string, cv2.CAP_GSTREAMER)

to

cap = cv2.VideoCapture('/dev/video3')

This assumes that your USB camera is on /dev/video3. If you don't know which device node the USB cam is associated with, do dmesg -w and observe the output while plugging the USB camera.

Hope this helps!

jjferreira commented 3 years ago

Hi @tomek-l , thank you for this response, but I'm a bit confused. This file u asked me to make a change its on a different project and repository. I downloaded the ai-thermometer repository and the changes are on the jetson-cameras repository, do you mind clarifying.

Thank you

tomasz-lewicki commented 3 years ago

Hi there!

Solution:

In order to clone everything, including submodules do:

git clone --recursive https://github.com/tomek-l/ai-thermometer

Explanation:

When you see something like this: image It means the author is using git submodules. This is basically a git repository containing another git repository inside of it.

I also updated instructions to include --recursive flag.

jjferreira commented 3 years ago

Hi @tomek-l thank you for your explanation. It runs but not as expected see picture attached.

image

tomasz-lewicki commented 3 years ago

Hi @jjferreira ,

What webcam are you using? Did you have any success so far in getting the image in other applications?

jjferreira commented 3 years ago

Hello @tomek-l,

I tried my intel realsense d435i, and a standard logitech Usb camera. Same behaviour. But if i run a simple python script i can see both cameras working as expected.

Tks

On Fri, 14 May 2021 at 08:46, Tomasz Lewicki @.***> wrote:

Hi @jjferreira https://github.com/jjferreira ,

What webcam are you using? Did you have any success so far in getting the image in other applications?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomek-l/ai-thermometer/issues/35#issuecomment-841076784, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY2X4JYDQ4XDPI2ZWDB7ODTNTIORANCNFSM44FT625A .

jjferreira commented 3 years ago

The issued I was having was to do with the lens of the thermal became loose.