ITCoders / Human-detection-and-Tracking

Human-detection-and-Tracking
Apache License 2.0
850 stars 307 forks source link

how to apply usb-camera to this codes? #33

Closed swjtuccy closed 5 years ago

swjtuccy commented 6 years ago

Issues should contain the following details which increases the probability of it get resolved quickly

i am sorry to bother you .I wanna know how to use usbcamera to run your demo? i am using opencv3.4.0 python3.4.0 ubantu in jetsontx2

julayelei commented 6 years ago

Change VideoCapture(videofile) to VideoCapture(0) or VideoCapture(1), depending of the port used for the camera. Oh, btw, I see you are using Jetson TX2, so in order to use the cam you need to use: cv2.VideoCapture("nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink")