Ticker

6/recent/ticker-posts

USING MOBILE CAMERA AS WEBCAM WITH THE HELP OF PYTHON

 STEP 1:-


Connect your pc/laptop and mobile to a local area network
open mobile hotspot and connect your pc

Step 2:-



Install Ip Webcam android application start application and select start server option, then app will start 
capturing videos, see the ip address


Step 3:-


python code

import cv2

import numpy as np

url = "ip_address_here/video"

cp=cv2.VideoCapture(url)

while(True):

    ret, frame=cap.read()

    if frame is not None:

        cv2.imshow("frame", frame)

    q= cv2.waitKey(1)

    if  q==ord("q"):

            break

cv2.destroyAllWindows()













Post a Comment

0 Comments