Open idrisbohra opened 7 years ago
I also have the same issue, Have you find any solution(@idrisbohra). @dat-ng please give an idea atleast on this.
I don't know if this helps you but i remember i had a runtime error with previewSize
having the wrong values. What i did to fix it was to add these lines of code under surfaceChanged
inside ARCamera.java
:
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
if(camera != null) {
this.cameraWidth = width;
this.cameraHeight = height;
Camera.Parameters params = camera.getParameters();
// Quick fix for Runtime error (previewSize has wrong value)
List<Camera.Size> sizes = params.getSupportedPreviewSizes();
Camera.Size cs = sizes.get(0);
params.setPreviewSize(cs.width, cs.height);
requestLayout();
camera.setParameters(params);
camera.startPreview();
generateProjectionMatrix();
}
}
...good luck!
It won't work
If you rotate the device to landscape does it look normal?
camera previewing the image as stretched in both horizontal and vertical orientation. the stretched level is look like double the original object size.