Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Streaming DroidCam video to OpenCV Python in ANYWAY possible

I currently have the Droid cam Application installed on my android, it is being detected and is streaming on Skype through wifi (Droid Cam client). It is however not streaming to OpenCV, no matter what number I put in for the following.

cap=cv2.VideoCapture()

In addition to this, I have an IP address, so is there any way I can implement this so that OpenCV can read an process images wireless from my camera? I know that it does not even begin to read the camera as I have tested it with the following code, which returns FALSE every time I run it.

cap=cv2.Videocapture(0) #Use default cam
i=0
while(i<50):
    ret,frame=cap.read()
    print ret

Keeps returning false, meaning camera isn't being recognized :L

like image 448
DhruvK Avatar asked Mar 19 '16 13:03

DhruvK


People also ask

Can you use DroidCam via USB?

We tried a few apps, and we recommend using DroidCam Wireless Webcam. This app supports Android, iOS and Windows. It lets you connect your laptop or a PC over the Wi-Fi network or with the help of a USB cable.


1 Answers

You have to enter the ip address of the droidcam followed by the format.The following method worked flawlessly for me : cap = cv2.VideoCapture('http://0.0.0.0:4747/mjpegfeed?640x480')

Make sure you open the client and do not access the camera feed elsewhere

like image 77
Manoj Guha Avatar answered Sep 24 '22 01:09

Manoj Guha