-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Why the result photo is zoom in than actual before take the picture❓ #2135
Comments
Hi, I'm also seeing this on Android. I'm getting the issue with both Samsung and Google Pixel (both front and back cameras). The photo that is taken is either more zoomed or less zoomed than the camera preview was at the time the photo is taken. This is true even if the Camera preview and Result photo preview are both set to "contain". Often the resulting photo will show details that were never in the preview. Is it taking the photo using a different format than the preview is displayed with? Or is this a configuration issue on our end? I have read the docs. Thanks, |
I'm still testing, but here's my current understanding of what happens:
To mitigate this, you likely want to update your code to look more like this:
This should prioritise fetching a format where the photo and video aspect ratios are the same, and then the camera preview should match the output photo. I'm still learning how all of this works, so somebody please correct me if I'm wrong. Edit: Must be something more going on. On my Google Pixel phone the output photo is still sometimes zoomed out (contains content around the sides that wasn't in the preview), even with the aspect ratios matching and everything set to contain. This behavior is flaky - sometimes it happens sometimes it doesn't.
|
@Kieraano You don't know how many hours I had spent trying to fix a problem with the aspect ratio and how it fit on the screen. And now, just reading |
Glad I could help. Here's the context I found for that behaviour: Maybe worth adding to the Readme so that other people don't get caught up by it. |
Preview is in video aspect, yes. There is one bug (#2142) which I'm fixing soon |
Question
Why the result after Camera.takePhoto() is zoom in before take the picture ?
thats my code useCameraDevice and useCameraFormat
![gambar](https://private-user-images.githubusercontent.com/64245684/280894611-41a901be-d5c6-4d15-ae01-a82686296990.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjAyNTIsIm5iZiI6MTczOTI1OTk1MiwicGF0aCI6Ii82NDI0NTY4NC8yODA4OTQ2MTEtNDFhOTAxYmUtZDVjNi00ZDE1LWFlMDEtYTgyNjg2Mjk2OTkwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3NDU1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUzZmNkNWY3YzY4YmMwYzg4Mjc3YzhiY2ZhMjBjOGE0YTY0MGU0ZTEyN2ZmMDZjYTVkMWVhNzk5Njk2ODI5YWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dtkxjw3TXfDpMkvmzFeXMX86X0bnluMBfnvJoP_0re8)
this code for create CameraUI in my app
![gambar](https://private-user-images.githubusercontent.com/64245684/280894963-81f14d70-a9eb-44c7-8aaa-6888ce017454.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjAyNTIsIm5iZiI6MTczOTI1OTk1MiwicGF0aCI6Ii82NDI0NTY4NC8yODA4OTQ5NjMtODFmMTRkNzAtYTllYi00NGM3LThhYWEtNjg4OGNlMDE3NDU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3NDU1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU3MTQ2NzU1M2E5NWM0YzNkMzlmMTkzODEyNDEzM2U2ZTQzOTg0YzMwZDBlNWQ1YzY0MTliMWJiNDVmNDI5YWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9sCsUYhH8tExdbYIhRlBZXsFmvJ_reKGVqdScPFIAY0)
What I tried
I tried setting the aspect ratio of camera in component Camera
VisionCamera Version
3.4.1
Additional information
The text was updated successfully, but these errors were encountered: