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
Related
I am working on an app where I need to use ARCore. Since I don't have any prior experience in ARCore. I don't know how to do it.
REQUIREMENT
I have a requirement where I have to open a camera and place an ARObject on any x,y coordinates.
I know the ARObject needs 'z' as well.
If My camera view shows a shelf with items placed on it, I want to show an ARObject at 3rd item from left. I already have the x,y points of that item on shelf and now just have to place the AR object.
Please let me know if it is even possible or not?
What I Tried
The anchor object. It is not created using x and y coordinates.
I tried the Hello Sceneform example from google. But to use that
I need to calibrate the ARScene first by moving the camera in a
specific manner.
I tried the Augmented Images example from Medium, which lets me add an ARObject/AugmentedImage on the camera without calibrating. But it needs an Augmented Image position as a reference. The item on shelf won't be an AugmentedImage.
Also, the camera view very blur on the ARScene.
Please guide me how can I achieve this. Any tutorial links are welcome
For an app I'm working on the user needs to be able to zoom in and out using pinch gestures, but only within a certain boundary.
There are multiple "levels" on which users can see the map and there should be a settable zoom boundary for each of these.
We got this working partially by resetting the camera back to the limit if pinching has brought it outside of it's boundaries, but the user shouldn't be able to pinch out/in of the boundaries at all.
Here's a video of how it's working now:
https://www.youtube.com/watch?v=WfAle_M-i0k
And how it should work is that once the camera is at the zoomlevel-limit, zooming out further shouldn't be possible.
This is important because we'll be drawing a lot of objects on the screen and the app crashes when it's zoomed out too far.
We're using the default pinch-zoom that comes with
mMap.getUiSettings().setZoomGesturesEnabled(true);
Is there a way to disable further zooming in/out when the boundary has been reached?
I don't see any other way of doing this that implementing zoom controls by yourself, i.e. setting
mMap.getUiSettings().setZoomGesturesEnabled(false);
and adding buttons on top of your map with actions with zoomBy inside (with respect to your zoom boundaries kept somewhere).
You may also check lite mode.
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
Is there a way, in which I can select a focus area on the camera preview by touch gesture and zoom into that specific area?
The short answer is: yes, you can.
If your camera supports video resolution higher than the preview area, zoom in can show more details. Often, it's not the case, and zoomed in picture will not look good.
So, I'm trying to create a Augmented reality app on android (client/server).
My question is if i can overlay images and text boxes over the camera in real time or only if i have the capture to display it on the screen and add the extra information
If the first version can be implemented can someone help me with some starting code or links with suggestions
I did something similar for one of my apps,
And the way i did it is by placing an empty View on top of camera surfaceView using FrameLayout, then used onDraw method in the View class, to play with canvas and put anything i wanted on top of the camera view, you can practically do everything with Canvas, and since literally your view is overlaying the camera surfaceView, will do exactly the trick you are trying to accomplish here...
Regards!