Android camera zoom in specific region - android

is it possible to automatically traverse a surfaceview doing zoom in operations?
Specifically:
-Divide a surfaceview in a grid.
-Do zoom in of each grid without any user gesture.
Thank you for your help.

Depending on the android in question it may very well be possible, however to be able to do this would require you to be able to run processes alongside the camera if you are looking to do this "live" it may well be easier and effectively simpler to use an image taken on the camera and then perform the given operation you desire.

Related

Limit Detection Area in Vision API

It seems I've found myself in the deep weeds of the Google Vision API for barcode scanning. Perhaps my mind is a bit fried after looking at all sorts of alternative libraries (ZBar, ZXing, and even some for-cost third party implementations), but I'm having some difficulty finding any information on where I can implement some sort of scan region limiting.
The use case is a pretty simple one: if I'm a user pointing my phone at a box with multiple barcodes of the same type (think shipping labels here), I want to explicitly point some little viewfinder or alignment straight-edge on the screen at exactly the thing I'm trying to capture, without having to worry about anything outside that area of interest giving me some scan results I don't want.
The above case is handled in most other Android libraries I've seen, taking in either a Rect with relative or absolute coordinates, and this is also a part of iOS' AVCapture metadata results system (it uses a relative CGRect, but really the same concept).
I've dug pretty deep into the sample app for the barcode-reader
here, but the implementation is a tad opaque to get anything but the high level implementation details down.
It seems an ugly patch to, on successful detection of a barcode anywhere within the camera's preview frame, to simple no-op on barcodes outside of an area of interest, since the device is still working hard to compute those frames.
Am I missing something very simple and obvious on this one? Any ideas on a way to implement this cleanly, otherwise?
Many thanks for your time in reading through this!
The API currently does not have an option to limit the detection area. But you could crop the preview image before it gets passed into the barcode detector. See here for an outline of how to wrap a detector with your own class:
Mobile Vision API - concatenate new detector object to continue frame processing
You'd implement the "detect" method to take the frame received from the camera, create a cropped version of the frame, and pass that through to the underlying detector.

Is it possible in Android to have the camera focus on a specific point in the preview?

I'm looking at the doc http://developer.android.com/reference/android/hardware/Camera.Parameters.html
and I'm not seeing anything that would allow me to make it possible for the user to tap on a specific point in the camera preview and have that become the point on which the camera would try to focus.
Is this simply missing? or am I overlooking how this can be done?
In Android 4.x, this is possible, with the setFocusAreas. You'll have to check getMaxNumFocusAreas first to see if this feature is supported on your device, and how many areas to use.
Then, you'll need to convert the user's touch coordinates to the coordinates used by the Camera.Area object (described here), and call setFocusAreas with the coordinates. From then on, calls to autoFocus will use that region for selecting focus.

Draw/create vector images from app

I need users to be able to draw and type on a vector image. The user shall also be able to resize and move paths/texts so the "elements" needs to be able to receive click/touch events.
The problem is that I don't know how I should draw them on screen to be able to handle the events and save the result. Canvas doesn't seem to let me do that.
Anyone that can lead me to the right track?
The only thing I can think of is a WebView and develop the hole thing using JS and SVG. But that doesn't feel right...
I will use a API level of at least 11 but up to 13 is okay.
You could have one big AndroidGraphics stretched on the screen and catch all the touchDown Events, which give you coordinates and decide for yourself what to do with them.
Try libGdx framework which has already implemented most details for you (plus it runs GL Es)

How to make Android screen see-through using backside camera?

Is there a way I could show what the hind-side camera captures on a full-screen such that it creates an illusion of screen being see-through? It doesn't need to be perfect, just convincing enough, a little lag won't make any difference.
Is it possible to create such an effect using phone camera? If yes, how can the effect be achieved? (as in what transformations to apply etc.)
(I already know how to create a simple Camera Preview)
Edit : Now, I also know it has been done, http://gizmodo.com/5587749/the-samsung-galaxy-s-goes-see+through, But, I still have no clue how to properly do this, I know trial and error is one way, other is calculating what part a user should be seeing if phone wasn't there.
I think there would be some factors involved like -
viewing distance,
viewing angle,
camera zoom range,
camera focus,
camera quality,
phone orientation,
camera position (where is camera located on phone) etc.
So, I don't feel this problem has a simple enough solution, if it is not so, please clarify with an answer.
Thanks for help,
Shobhit,
You can use standard 3D projection math to project a portion of the backside camera image onto the display; you can manage this by assuming everything the camera sees is at a particular depth from the backside camera, and by assuming a particular viewpoint for the observer
You can improve on this by looking for faces/eyes using the frontside camera. You can get a rough estimate of the the viewing distance from the eye spacing, and assume a viewer position midway between the eyes. Of course, this only works for one viewer at a time (e.g., if your face tracker finds multiple faces, you can select one of them).
Also, you can improve the illusion by calibrating the camera and screen so you can match the color and brightness from one to the other.

OpenGL model Overlay of Camera Preview

I am trying to display a .md2 model over top of the camera preview on my android phone. I don't need to use the accelerometers or anything. If anyone could even just point me in the right direction as to have to set up an opengl overlay that would be fantastic. If you are able to provide code that shows how to enable this that would be even better! It would be greatly appreciated..
I'm not able to provide code until later this week, but you might want to check out a library called min3d, because I believe they already have a parser written for .md2 files. Then I believe that if you use a GLSurfaceView, the background can be set to be transparent, and you can put a view of the camera behind it. Are you trying to get some kind of augmented reality effect? There are android specific libraries for that too, but they're pretty laggy (at least on my Motorola Droid).

Categories

Resources