Ask Your Question
0

camera image in grayscalewith opencv and android

asked 2016-02-25 09:55:52 -0600

nadia gravatar image

I am a beginner in opencv and android .I look for a java code that open the camera of an android in the grayscale and save the image in the gallery of the mobile.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-02-25 18:55:32 -0600

Tetragramm gravatar image

updated 2016-02-25 18:56:28 -0600

Take a look at the first OpenCV android example to see how to get the grayscale image. Then use matToBitmap to get an android Bitmap object, where you use compress with appropriate arguments.

edit flag offensive delete link more

Comments

i found this code but it doesn't save the image after applying the grayscale .how changes should i make to save the gray image. and this the code : http://cs.ucsb.edu/~efujimoto/mobile/...

nadia gravatar imagenadia ( 2016-02-26 02:35:12 -0600 )edit

You see that part where it calls Utils.matToBitmap? That's where you use the compress function I linked, and pass in a FileOutputStream to the appropriate path.

Tetragramm gravatar imageTetragramm ( 2016-02-26 14:10:06 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-02-25 09:55:52 -0600

Seen: 67 times

Last updated: Feb 25 '16