move overlay image on camera preview - android

I want overlay an image in live camera preview using surface view. There are lot of tutorial in this case and my program run perfectly. Now i want add ability to move overlay image in live camera preview with touch event. I can't find any code or tutorial that explain that. Can somebody help me please?

if you do not use OpenGL and just float your overlay with opacity over surfaceView, you can set your own onDragListener() that handles android DragEvent( http://developer.android.com/reference/android/view/DragEvent.html) that can move the overlay detecting user's finger

Related

Display camera preview in a circle

I want to display a camera preview in a circular shape using the camera2 api. I want to display the preview in a circular shape, but I dont't want the image to be captured in a circular shape.
The captured image would be a face( later want to implement face detection and auto capture). I did have a look at few questions already asked, but none of them are with the new camera2 api's and most of them talk about having an overlay image cropped with a transparent circle. But this will not work in a case where I need to auto detect a face(as the face may appear out side the cropped circular image).
Is there any way I can implement this ? I did try an example with TextureView and set it to a LinearLayout with fixed width and height, but the preview appeared a bit squeezed and in a square shape.
I don't see why face detection matters here - if you enable the camera API's face detector, it'll run on the full image no matter what you do in drawing it inside a circle.
You can either use a circle overlay on top of a correctly-shaped TextureView or SurfaceView, or do your own OpenGL rendering of a circle with the camera preview as a EGL texture.
The latter you'll probably want a GLSurfaceView for the OpenGL drawing context, and a SurfaceTexture to send camera data to and expose it as a EGL texture.
JPEGs captured will still be full-FOV, and the camera API will know nothing about your circular preview drawing, so face detection and everything else will work on the full field of view.

Camera screen orientation issue in titanium appcelerator

I have some issue in device orientation. What i did is that, i have to open camera for screen capture. The camera view is customized by using overlay. Overlay contains a button view, when click on it it will capture image.
I implement device orientation in it. When custom camera opens it looks fine. But when we rotate(that is, rotate to 180 degree) the over lay looks fine, but the camera view inverted the screen. That is for example, if we wish to capture a tree by rotating device, it'll see like upside down and when after capture, the image also inverted. Does anybody have any idea about how to remove this camera invert while rotating.
This issue is headache for many devs.
How do you rotate the camera? You have to rotate your overlay and pretend user that user is rotating the camera.
To get More info see this
Explanation is good.

Android camera accessing "outside current field of view" on zoom in

Here is an interesting problem I am trying to solve.
In my app I have extended SurfaceView to create a custom cameraview. And now I want to implement ZOOM and PAN functionality in it. Following are the steps;
With my Android device properly mounted(still in a position)
1) I will zoom in on the camera view
2)Now I can pan with my finger on the camera view. As the device is NOT MOVING and I am trying to pan on cameraview(which is "zoomed in"), I want camera view to start showing preview of areas which were outside the scope of "current view" after zoom in(but were visible before I zoomed in).
Do you think this functionality is possible in Andorid today?
I am trying to explain the problem in this picture

Android : adding transformed overlay on top of camera view

In my android project I want to add an overlay (which is simple image with text on it) on top of the camera view.
The overlay is not simple rectangle but it is transformed at each camera frame.
What I'm looking for is kind of like image below:
I'm getting camera frame with OpenCV library (CvCameraViewListener and CameraBridgeViewBase).
My question is what is the best and fastest way to do this?
How can I transformed the overlay at each frame in the way as figure above shows.
Any help and suggestion is appreciated.

How to draw on top of camera preview?

I want to draw some thing on the view which we get when our camera is on in android mobile.
I do not want to take picture nor record video just that view from camera and then draw some thing on screen.
Drawing on screen will not be and issue but when we turn on camera which view we get and how can we use that view in our application?
You'll want to check androids camera-API.
You can get the preview to display in a SurfaceView or your own View-subclass, which can then be used to draw on. Some more knowledge might be found here.
You can use a RelativeLayout to put other views aligned with the surfaceView used for camera preview

Categories

Resources