Closed FrankOcean11 closed 9 years ago
ok now i reDownloaded 2.2.1 and now im getting the OpenCV for processing folder to show up in contributed libraries in Java Examples in processing, but the issue now is that im getting your face showing up rather then the camera get a image from the camera and retun it to processing for me to view in the new pop up window?
and a msg on the bottom of processing saying
OpenCV for Processing 0.5.2 by Greg Borenstein http://gregborenstein.com Using Java OpenCV 2.4.5.0 Load cascade from: C:/Users/Franks/Documents/Processing/libraries/opencv_processing/library/cascade-files/haarcascade_frontalface_alt.xml Cascade loaded: haarcascade_frontalface_alt.xml
OpenCV for Processing is not yet compatible with Processing 3. In Processing 2, try the LiveCamTest example which will show you how to load a live camera.
you misunderstand me,
Capture video; OpenCV opencv;
void setup() { size(640, 480); video = new Capture(this, 640/2, 480/2); opencv = new OpenCV(this, 640/2, 480/2); opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
video.start(); }
void draw() { scale(2); opencv.loadImage(video);
image(video, 0, 0 );
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); } }
void captureEvent(Capture c) { c.read(); }
My issue is that i dont see how this here helps me "select" my particular camera to use for my project. "usb web cam"
Look at the Processing documentation for Capture. Particularly the list() function which lets you list the available cameras:
https://processing.org/reference/libraries/video/Capture_list_.html
-- Greg
On Nov 21, 2015, at 8:14 AM, Frank notifications@github.com wrote:
you misunderstand me,
Capture video; OpenCV opencv;
void setup() { size(640, 480); video = new Capture(this, 640/2, 480/2); opencv = new OpenCV(this, 640/2, 480/2); opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
video.start(); }
void draw() { scale(2); opencv.loadImage(video);
image(video, 0, 0 );
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); } }
void captureEvent(Capture c) { c.read(); }
My issue is that i dont see how this here helps me "select" my particular camera to use for my project. "usb web cam"
— Reply to this email directly or view it on GitHub.
name=Microsoft LifeCam Rear,size=960x544,fps=15 name=Microsoft LifeCam Rear,size=848x480,fps=30 name=Microsoft LifeCam Rear,size=640x360,fps=30 name=Microsoft LifeCam Rear,size=640x480,fps=30 name=Microsoft LifeCam Front,size=640x360,fps=30 name=Microsoft LifeCam Front,size=640x480,fps=30 name=Microsoft LifeCam Front,size=424x240,fps=15 name=Microsoft LifeCam Front,size=424x240,fps=30 name=Microsoft LifeCam Front,size=320x240,fps=15 name=Microsoft LifeCam Front,size=320x240,fps=30 name=Microsoft LifeCam Front,size=320x180,fps=15 name=Microsoft LifeCam Front,size=320x180,fps=30 name=Microsoft LifeCam Front,size=160x120,fps=15 name=Microsoft LifeCam Front,size=160x120,fps=30 name=Microsoft LifeCam Front,size=1280x800,fps=5 name=Microsoft LifeCam Front,size=1280x720,fps=30 name=Microsoft LifeCam Front,size=960x544,fps=30 name=Microsoft LifeCam Front,size=848x480,fps=30 name=Microsoft LifeCam Front,size=960x544,fps=15 name=Microsoft LifeCam Front,size=848x480,fps=30 name=Microsoft LifeCam Front,size=640x360,fps=30 name=Microsoft LifeCam Front,size=640x480,fps=30 name=USB2.0 Camera,size=640x480,fps=30 name=USB2.0 Camera,size=352x288,fps=30 name=USB2.0 Camera,size=320x240,fps=30 name=USB2.0 Camera,size=176x144,fps=30 name=USB2.0 Camera,size=160x120,fps=30
now how does this list help me pick that one device i want the sketch to use? when i try to rewrite the sketch?
the webcam i like to use is name=USB2.0 Camera,size=640x480,fps=30 how do i choose this cam?
Read the Processing docs: https://processing.org/reference/libraries/video/Capture.html
You can pass any of the elements from that list to the Capture constructor.
yes according to that link you just sent i follow the instructions of parsing over from the array element and i found the camera i wanted to use * cam = new Capture(this, cameras[37]); * but if i use any other example in processing that has todo with camera or video i dont see the same setup being used from the example on any other example ,....u kno the whole cam = new Capture(this, cameras[37]); as cam #37 is part of the element but in anyother sketch it would not be asking me to input the element "37" cuz here in that sketch Getting Started with Capture the algorithm is made to address as such in element but in face recognition example from processing for opencv this example cant be exercise by just using the function cam = new Capture(this, cameras[37]); sowhat am i left with to use in any other opencv example can i use?
@FrankOcean11 I cannot understand your comment here. Of course you can use the OpenCV for Processing functions demonstrated in every example with the live camera. You just need to write your own code that combines the two. Usually I'd recommend starting with a copy of the LiveCameTest sketch which implements camera selection and the cameraEvent callback, etc. and then adding in the filtering or other opencv function calls that you want to use from the other examples into that.
you mean this ?
import gab.opencv.; import processing.video.; import java.awt.Rectangle;
Capture video; OpenCV opencv; Rectangle[] faces;
void setup() { size(640, 480); video = new Capture(this, 640/2, 480/2); opencv = new OpenCV(this, 640/2, 480/2); opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE); faces = opencv.detect(); }
void draw() { scale(2); opencv.loadImage(video);
image(video, 0, 0 );
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); } } void captureEvent(Capture c) { c.read(); }
so what i did here i meger the livecamtest and the face detection and i get nothing from that
You didn't call video.start()
Frank wrote:
you mean this ?
import gab.opencv./; import processing.video./; import java.awt.Rectangle;
Capture video; OpenCV opencv; Rectangle[] faces;
void setup() { size(640, 480); video = new Capture(this, 640/2, 480/2); opencv = new OpenCV(this, 640/2, 480/2); opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE); faces = opencv.detect(); }
void draw() { scale(2); opencv.loadImage(video);
image(video, 0, 0 );
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); } } void captureEvent(Capture c) { c.read(); }
so what i did here i meger the livecamtest and the face detection and i get nothing from that
— Reply to this email directly or view it on GitHub https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159032968.
right sorry i just noticed that from the email conversation, but like i said before im still not able to choose or say which want i want to use
name=Microsoft LifeCam Rear,size=960x544,fps=15 name=Microsoft LifeCam Rear,size=848x480,fps=30 name=Microsoft LifeCam Rear,size=640x360,fps=30 name=Microsoft LifeCam Rear,size=640x480,fps=30 name=Microsoft LifeCam Front,size=640x360,fps=30 name=Microsoft LifeCam Front,size=640x480,fps=30 name=Microsoft LifeCam Front,size=424x240,fps=15 name=Microsoft LifeCam Front,size=424x240,fps=30 name=Microsoft LifeCam Front,size=320x240,fps=15 name=Microsoft LifeCam Front,size=320x240,fps=30 name=Microsoft LifeCam Front,size=320x180,fps=15 name=Microsoft LifeCam Front,size=320x180,fps=30 name=Microsoft LifeCam Front,size=160x120,fps=15 name=Microsoft LifeCam Front,size=160x120,fps=30 name=Microsoft LifeCam Front,size=1280x800,fps=5 name=Microsoft LifeCam Front,size=1280x720,fps=30 name=Microsoft LifeCam Front,size=960x544,fps=30 name=Microsoft LifeCam Front,size=848x480,fps=30 name=Microsoft LifeCam Front,size=960x544,fps=15 name=Microsoft LifeCam Front,size=848x480,fps=30 name=Microsoft LifeCam Front,size=640x360,fps=30 name=Microsoft LifeCam Front,size=640x480,fps=30 name=USB2.0 Camera,size=640x480,fps=30 name=USB2.0 Camera,size=352x288,fps=30 name=USB2.0 Camera,size=320x240,fps=30 name=USB2.0 Camera,size=176x144,fps=30 name=USB2.0 Camera,size=160x120,fps=30
the webcam i like to use is name=USB2.0 Camera,size=640x480,fps=30 how do i choose this cam?
You have all the tools you need to do that from the Processing Capture API. You can ask for the resolution you want and let it pick the correct device, you can select the camera based on its device name, you can use Capture.list() to display a text list of the available cameras and let the user select one by typing a key or clicking, etc. This is not an OpenCV for Processing issue, but a question of your learning how to use Processing Capture library. Processing comes with some good examples showing you how to do that and there are other good materials online that also teach you how to do this.
Frank wrote:
right sorry i just noticed that from the email conversation, but like i said before im still not able to choose or say which want i want to use
— Reply to this email directly or view it on GitHub https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159034254.
but thats the issue i already ren that sketch and is giving me that list but does not let me click on it and even so me clicking on it does not mean nothing to any other project i use so what am i missing ?
Frank's Desig'Nature
"Designed Signature Inspired by Nature"
On Mon, Nov 23, 2015 at 2:24 PM, Greg Borenstein notifications@github.com wrote:
You have all the tools you need to do that from the Processing Capture API. You can ask for the resolution you want and let it pick the correct device, you can select the camera based on its device name, you can use Capture.list() to display a text list of the available cameras and let the user select one by typing a key or clicking, etc. This is not an OpenCV for Processing issue, but a question of your learning how to use Processing Capture library. Processing comes with some good examples showing you how to do that and there are other good materials online that also teach you how to do this.
Frank wrote:
right sorry i just noticed that from the email conversation, but like i said before im still not able to choose or say which want i want to use
— Reply to this email directly or view it on GitHub < https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159034254 .
— Reply to this email directly or view it on GitHub https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159035914 .
You have to write the code. It's not going to "give you something to click on". You have to write the code to select which camera to use based on one of the techniques I described in the last message.
Frank wrote:
but thats the issue i already ren that sketch and is giving me that list but does not let me click on it and even so me clicking on it does not mean nothing to any other project i use so what am i missing ?
Frank's Desig'Nature
"Designed Signature Inspired by Nature"
On Mon, Nov 23, 2015 at 2:24 PM, Greg Borenstein notifications@github.com wrote:
You have all the tools you need to do that from the Processing Capture API. You can ask for the resolution you want and let it pick the correct device, you can select the camera based on its device name, you can use Capture.list() to display a text list of the available cameras and let the user select one by typing a key or clicking, etc. This is not an OpenCV for Processing issue, but a question of your learning how to use Processing Capture library. Processing comes with some good examples showing you how to do that and there are other good materials online that also teach you how to do this.
Frank wrote:
right sorry i just noticed that from the email conversation, but like i said before im still not able to choose or say which want i want to use
— Reply to this email directly or view it on GitHub <
https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159034254
.
— Reply to this email directly or view it on GitHub
https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159035914 .
— Reply to this email directly or view it on GitHub https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159036778.
you said ( you can use Capture.list() to display a text list of the available cameras and let the user select one by typing a key or ""clicking"", etc. ) so then i guess im lost im not sure what you mean by clicking i mean capture is playing with me cuz i see that the cam i want is in there i see the name and i see in what number is at IF we are talking about the element of the Array in which case is number 30 but when i use that number 30 here like so // The camera can be initialized directly using an element // from the array returned by list(): cam = new Capture(this, cameras[30]);// HERE swap for the 0 IT DOES NOT PICK that camera
and if i use the name given which is name=USB2.0 Camera,size=640x480,fps=30 i guess i should be able to swap this out as well correct?
so forget about the number lets use from the list like you say:
//cam = new Capture(this, 640, 480, "Built-in iSight", 30);//swap for this name=USB2.0 Camera,size=640x480,fps=30 so it looks like this //cam = new Capture(this, USB2.0 Camera, 640, 480, 30); and i get a error about the unexpected token:0
Frank's Desig'Nature
"Designed Signature Inspired by Nature"
On Mon, Nov 23, 2015 at 2:31 PM, Greg Borenstein notifications@github.com wrote:
You have to write the code. It's not going to "give you something to click on". You have to write the code to select which camera to use based on one of the techniques I described in the last message.
Frank wrote:
but thats the issue i already ren that sketch and is giving me that list but does not let me click on it and even so me clicking on it does not mean nothing to any other project i use so what am i missing ?
Frank's Desig'Nature
"Designed Signature Inspired by Nature"
On Mon, Nov 23, 2015 at 2:24 PM, Greg Borenstein < notifications@github.com> wrote:
You have all the tools you need to do that from the Processing Capture API. You can ask for the resolution you want and let it pick the correct device, you can select the camera based on its device name, you can use Capture.list() to display a text list of the available cameras and let the user select one by typing a key or clicking, etc. This is not an OpenCV for Processing issue, but a question of your learning how to use Processing Capture library. Processing comes with some good examples showing you how to do that and there are other good materials online that also teach you how to do this.
Frank wrote:
right sorry i just noticed that from the email conversation, but like i said before im still not able to choose or say which want i want to use
— Reply to this email directly or view it on GitHub <
https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159034254
.
— Reply to this email directly or view it on GitHub
< https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159035914
.
— Reply to this email directly or view it on GitHub < https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159036778 .
— Reply to this email directly or view it on GitHub https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159038177 .
Frank. You really should try to learn some basics of processing. Post your support request into forums like the processing forum or stackoverflow. This is not an issue with the openCV library. Also it would be useful if you try to pinpoint your problem. I tried to follow the conversation and it's really hard to understand where the problem is. You write sentences that take up a whole paragraph.
You can't click on the output of the console. You have to tell the capture class which cam to use by defining it via the index of the "camera[index]". It corresponds with the list you get as output in the console.
cam = new Capture(this, cameras[0]);
@fabiantheblind thank you for this comment.
@FrankOcean11 Maybe try starting with @shiffman's video tutorial about using Capture: https://www.youtube.com/watch?v=WH31daSj4nc
@FrankOcean11, you should try to specify more your problems and try to ask better. I didn't understand what is your problem.
I tested now the LiveCamTest
and it works, with the Built-in Camera and with an external USB Camera.
You should really check the Processing Documentation. The method that I usually use to pick different cameras is this:
cam = new Capture(this, 640, 480, "USB 2.0 Camera");
Being "USB 2.0 Camera"
the name of my external USB Camera that I get with the list()
method. In your case, to use the USB Camera, you could write this (notice that your USB camera is listed lightly different than mine, without a space between USB
and 2.0
):
cam = new Capture(this, 640, 480, "USB2.0 Camera");
and to use your rear camera, you should write this:
cam = new Capture(this, 640, 480, "Microsoft LifeCam Rear");
Check the other constructor options here. Notice that you can even specify different resolutions and frame rates.
thanks for your OUTLINEING WHAT I SHOULD REPLACE i spent 5days going back and forth and everyone just telling me what todo or just being argumentative JUST to find out that it was something so STUPID such as cam = new Capture(this, 640, 480, "USB2.0 Camera"); .....what you was saying was wrong was suggested by ppl in processing website and programming fun forums, SMH im thankful and what do you know its Thanksgiving Ha! that being said Happy thanksgiving !
Well, next time read the documentation, try everything and if you still need help, then ask, but more specific about what you want to do and what have you tried so far. We are not supposed to figure it out by ourselves like magic. It will spare you frustration and we won't waste our effort and free time for nothing.
fair enough,moving forward why am i getting 2 diff resolution ?
Frank's Desig'Nature
"Designed Signature Inspired by Nature"
On Thu, Nov 26, 2015 at 4:17 PM, Jordi Tost notifications@github.com wrote:
Well, next time read the documentation, try everything and if you still need help, then ask, but more specific about what you want to do and what have you tried so far. We are not supposed to figure it out by ourselves like magic. It will spare you frustration and we won't waste our effort and free time for nothing.
— Reply to this email directly or view it on GitHub https://github.com/atduskgreg/opencv-processing/issues/90#issuecomment-159995036 .
i been getting this msg "No library found for gab.opencv Libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder" so where do i get this from ? to fix it?