Comments (5)
What is the camera resolution you have set in the camera parameter?
And does your device support that camera resolution..!
Remember that not all devices support all resolution..so you will have to get the list of supported camera resolution and then set the resolution or any other parameters... accordingly.. otherwise usually app crashes...
There are multiple resources online to do so...
Hope it helps..
from ar-location-based-android.
In ARCamera.java (Line 206) - replace your surfaceChanged() function with the following -
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
if(camera != null) {
this.cameraWidth = width;
this.cameraHeight = height;
Camera.Size previewSize = supportedPreviewSizes.get(0);
Camera.Parameters params = camera.getParameters();
params.setPreviewSize(previewSize.width, previewSize.height);
requestLayout();
camera.setParameters(params);
camera.startPreview();
generateProjectionMatrix();
}
}
from ar-location-based-android.
Do you know where code is possible to set the camera resolution? Would it be the z_near and z_far parameters?
from ar-location-based-android.
In the ARCamera.java Line 212. we have params.setPreviewSize(previewSize.width, previewSize.height);
Change the width and height to an appropriate one.
Try hardcoding it first like(choose one of the supported camera resolution by your device)
params.setPreviewSize(1280,720); //1280*720 resolution
Though getOptimalPreviewSize() in ARCamera line 167 is suppose to select an appropriated camera resolution of the device, it maybe not picking the right resolution in your case.
You can output the selected preview size and see if the selected resolution are the supported ones.
If this is also not helping, try checking for the other camera parameters like focus mode etc. See if making the orientation of the the activity to either landscape or portrait helps. Also check if camera permission is given.
Most of these are already handled by the ARCamera.java but i guess there some issue in your case.
NOTE: z_near and z_far are parameters related to creating the viewing frustum in OpenGL ES. i.e it's used to define the space in which the rendering is viewed.
from ar-location-based-android.
is anyone manage to make it work in landscape at all?
changing camera size did not work for me.
Any example would appreciated
from ar-location-based-android.
Related Issues (20)
- AROverlayView Question HOT 1
- Why points are not fixed in android like iOS ? HOT 1
- Display 3d elements instead of points HOT 2
- Running sample has green overlay over camera, how to remove it? HOT 2
- Collision between points
- Show points based on the distance HOT 1
- How do I show the 3D objects in the air? HOT 2
- java.lang.RuntimeException: setParameters failed HOT 1
- Increase acuracy when the ArPoint is near
- Is your code exported as a library? HOT 1
- Azimuth
- Drawing distorted polylines and polygons
- collide with one another
- I do not see anything on camera. HOT 2
- Android. Augumented Reality move views more smooth HOT 1
- Portrait mode distortion HOT 1
- Point Collision & add custom views instead of default circles (SOLUTIONS) HOT 1
- In location base canvas not pointing specific area like distance not mention
- how can I apply low pass filter on it?
- Exception configuring surface
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ar-location-based-android.