How to manage an image with the library? #4

Open
jabrena opened this Issue Mar 27, 2010 · 1 comment

Comments

Projects
None yet
3 participants

jabrena commented Mar 27, 2010

Hi,

I tested all examples but they use a remote camera.
I would like to process an image stored in the phone or in the application and I would like to use the internal camera to process the frames.
How to do it?

Cheers

I don't quite understand what you mean with "using the internal camera to process the frames", but here is a snippet to modify SocketCamera.java:69-79 to use a image file as a stream instead of reading from a socket:

InputStream in = new BufferedInputStream(new FileInputStream(
        "/data/data/org.siprop.opencv/files/example.jpg"));
bitmap = BitmapFactory.decodeStream(in);

I would encourage you to simply read the stream once as opposed to constantly having the thread read the file over and over, but this is only to give you an idea of how it could be done.

Of course you will have to push example.jpg to the correct path onto the device in order for this to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment