Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to manage an image with the library? #4

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

How to manage an image with the library? #4

jabrena opened this issue Mar 27, 2010 · 1 comment

Comments

@jabrena
Copy link

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

@pflammertsma
Copy link

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
Projects
None yet
Development

No branches or pull requests

3 participants