Jump to content

Front Facing Cameras Focus/ Android dev

Sign in to follow this  

Recommended Posts

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"

Edited by Im_CIA

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

 

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.

Share this post


Link to post
On 1/12/2019 at 10:09 PM, BTGBullseye said:

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

Edited by Im_CIA

Share this post


Link to post

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)

Edited by BTGBullseye

Share this post


Link to post

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.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in the community.

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.