Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Distorted Camera Preview

I am currently writing an android app which runs displays a circle drawable on the preview frame, runs edge detection and then takes a photo once the user lines up a coin perfectly in the circle.

For some reason (despite being fullscreen with no title etc.), I am started to realize the camera preview is every so slightly distorted. I have tried setting the previewsize to 480x640 while also setting the surfaceholder size to 480x640, however if I save the preview to bitmap and also take a photo, you can notice the distortion.

Has anybody else had this kind of problem / or have any ideas as to a solution?

like image 532
Paul Biggs Avatar asked Jan 28 '26 19:01

Paul Biggs


1 Answers

I have encountered the same issue. Hopefully I found that ApiDemos includes a working example with Camera.
You can find it here: com.example.android.apis.graphics.CameraPreview.

I didn't digged the example, but I saw it's working fine just as my real camera, no distortion at all.

like image 152
Andy Res Avatar answered Jan 30 '26 09:01

Andy Res



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!