We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I have OpenCV from https://github.com/atduskgreg/opencv-processing up and running fine. I wondered what the method is to pass multiple images to it?
So, I have a few source images I want to run the face detect on, and I guess the best way to do this is to create one OpenCV object and pass it different sources throughout the draw loop?
For instance, it works likes this:
opencv = new OpenCV(this, "myimage.png");
faces = opencv.detect();
which makes an array of faces (within that image) that I can loop through and do my stuff.
I don't know how to pass it another image, I would guess it's something like this:
opencv.load("anotherImage.png");
But I have no idea. And I'm not really sure where to look for documentation. Any guidance would be really appreciated!
Thanks.
Answers
Hi, thanks for the reply. I didn't get notified, so that's why I'm late back!
That was a real help. There were a couple of bits that caught me out, so I'm posting my version of the code:
Okay try to print the image path in the consol and see if you are getting the correct path. If you are not getting desired path then there would be error in while creating the path. If the error in path creating then there must be some bug in any of these line 1,2, & 9 but it seems correct to me so th eproblem is in image address that you have saved in the String array in line 1. What is it pointing?
Some points
Hi, sorry I didn't say, but the code works fine and does what I want it to now.
I am getting the images from the internet, so the array of images actually looks more like this:
(I had to remove the http part as it got formatted strangely in this forum)
And it all works as I expect it to.
Thanks again!
Indeed it's a forum bug! :-L But you can create a constant like:
in order to avoid the bug. Then concatenate it to the rest of the URL when loading images:
Since all images come from the same host, I'd even go as far as creating this more complete URL constant: :ar!
Ah, thanks for the advice. Nice and tidy code.
The next step is to get the list of images from JSON from the server!