0

I am programming an android application. This application uses camera and different visualization modes, like grey, high contrast, etc. It will be used by people with very low vision to read any kind of text. Some of this people can read only in determined colors. So, my application, at the moment supports only the effects offered by Camera.Parameters.EFFECT_X and I need to offer a visualization mode with two colors: color for the font of the image and color for the text of the image. The person should be able to choose the colors from some kind of pallet. So the question is how to make a threshold to obtain frames in only 2 colors. I thought about using opencv4android but i would like to avoid it. I think it could be done mathematically in the callback set for every frame of the camera, but I am not sure...

I checked some topics here but in this How can I manipulate the camera preview?

canvas.lock is used. I can't use it because my application should work on Android versions prior to 3 so I'm forced to put mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); and that crashes the application if I put any canvas.lock. If I could avoid setting the type or the crash...

Any help, please?

Community
  • 1
  • 1
  • I have another question I was looking everywhere but cant find anything...Does Android API support any kind of video stabilization? I'm supposed to offer this functionality too but I think will not be so easy...I'm wrong? – user1890442 Dec 10 '12 at 23:56

1 Answers1

0

You might use a mean threshold method. This answer is a bit more detailed, and has a link to a paper detailing the algorithm. I can't guarantee it will be fast enough to do for every frame, but I've used it for full-resolution stills with no noticeable delay, so for a smaller(preview-sized) image, it should be okay.

For your secondary question, no, I don't believe Android has any built-in video stabilization.

Community
  • 1
  • 1
Geobits
  • 22,218
  • 6
  • 59
  • 103