Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Using IP-Capture library with IP-Webcam app on android

$
0
0

Hello,

Im trying to do some image processing with the openCV library and im trying to connect my android phone's camera to processing through an app called IP-Webcam, but I cant get the IP-Capture library to connect to my phone, heres the code im using :

` import gab.opencv.*; import java.awt.*; import ipcapture.*;

IPCapture cam; OpenCV opencv;

void setup() { size(640, 480); cam = new IPCapture(this, "192.168.1.9:8080", "", ""); //local ip for the ipwebcam cam.start(); opencv = new OpenCV(this, 640, 480); opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);

}

void draw() { scale(2); //println(cam.isAvailable()); if (cam.isAvailable()) { cam.read(); image(cam,0,0); }

opencv.loadImage(cam);

noFill(); stroke(0, 255, 0); strokeWeight(3); Rectangle[] faces = opencv.detect(); println(faces.length);

for (int i = 0; i < faces.length; i++) { println(faces[i].x + "," + faces[i].y); rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height); } } `

The program doesnt find the camera, the cam.isAvailable() function returns false.

Thank you.


Viewing all articles
Browse latest Browse all 2896

Trending Articles