Front Facing Cameras Focus/ Android dev

Im_CIA

Im_CIA
I'm going be skirting around my NDA here a bit, but this past week I was trying to use a samsung S4 front-facing camera to capture some... stuff using Google Vision. Yes, it has to be a front-facing camera.

The biggest problem is that I'm capturing PreView frames and the content (text) I'm looking for is too blurry for the API to detect.  At least,  I think that's what happening. I tried both YUV and Bitmap formats, different focus modes which appear to be disabled, and using a convolution matrix to sharpen the image.  The the latter is slow as fuck and doesn't even work. The only method that DOES work is continuously taking pictures.

I'm not that good with image processing or camera work. Does anyone know hack to activate secret focusing settings on the front cameras on samsung phones and tablets? Like third party open source Camera handles that can possibly circumvent the android SDK one.

Edit: please disregard the fact that my handle literally says "Im CIA"

 
Last edited by a moderator:
Well the thing is most front facing cameras as far as I know have a fixed focus point. They literally do not have focusing hardware. Unless you talk about seriously high end phones that have front facing good cameras as a highlight. So maybe there is a software way to make it work but as far as I'm aware, there aren't many phones that have hardware that enables the front facing camera to focus as a back camera would usig different glass elements on the lenses.

 
Yeah I figured as much. I even made a callback for focusing, and it wall only triggered once at the very beginning. I guess this a general software question now of why google vision sucks so much. I mean, I made the frame look like a still from Take on Me and it still didn't work.

 
By "front facing" you mean the "selfie camera" right? As Luis said, all but an extremely few have fixed focal lengths, and software for focus adjustments on any of them have always been very buggy at best. (the ASUS Zenfone line being a notable exception, having great software with good hardware)

As far as the API is concerned, that's just how it is when it's a radically new experimental technology.

 
As far as the API is concerned, that's just how it is when it's a radically new experimental technology. 
Update: tried ffmpeg today. Same shit(too slow, lot of overhead ). Gonna attempt implementing the convolution matrix in RenderScript

 
Last edited by a moderator:
Good luck! Also, you might want to check and see if you're using the Camera1 or Camera2 API since Camera1 puts out images in NV21 (the default for Vision) instead of YUV420. (and it apparently takes some finagling to get Camera2 to work with Vision, and it's supposedly not planned to ever be officially supported)

 
Last edited by a moderator:
Update:

Came back to this project after a long solution. There is no "straight forward" way of doing.  At its heart, its a signal processing problem. Currently in arms race with a consulting firm to see who can come up with a tailored solution faster.

 
Back
Top