Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running sample has green overlay over camera, how to remove it? #23

Open
falbertp opened this issue Feb 23, 2018 · 2 comments
Open

Running sample has green overlay over camera, how to remove it? #23

falbertp opened this issue Feb 23, 2018 · 2 comments

Comments

@falbertp
Copy link

Hi,
I am running the example code, but the camera has been overlayed by green screen with normal rectangular screen on top right corner. How to remove the green overlay?

Thank you

@ShantiRanjanDas
Copy link

ShantiRanjanDas commented May 18, 2018

Just use this in initCamera in ArActivity.
This solves my two problems.

  1. Green overlay over camera.
  2. Camera view is stretched(people and objects are distorted).

List<Camera.Size> mSupportedPreviewSizes = camera.getParameters().getSupportedPreviewSizes();
Camera.Size mPreviewSize = getOptimalPreviewSize(mSupportedPreviewSizes,metrics.widthPixels,
metrics.heightPixels);
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
camera.setParameters(parameters);
camera.startPreview();
arCamera.setCamera(camera);

I am getting this issue in Redmi devices.

@AbhishekPandey21
Copy link

AbhishekPandey21 commented Jan 7, 2020

getting an error-: Cannot resolve getOptimalPreviewSize method.
please specify the metric variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants