Camera2Vision
Camera2Vision copied to clipboard
Camera 'zoomed-in' in landscape mode with Camera2
When we use the sample in landscape mode, the whole sample starts to act weird and the camera preview seems to be zoomed in, I tried the same with Camera1 mode manually overriden, it worked fine, there is something wrong with Camera2 implementation in landscape mode. Otherwise the code is really great and helpful
@thiyagab what is your Camera2 error in landscape mode?
I am finding that getBestAspectPictureSize doesn't find a suitable aspect ratio, so it fails to work. Is that the same issue you are finding? I'm trying to scope out how much work this would be to solve.
Sorry, the app was originally not intended to be used in landscape mode. As seen on the AndroidManifest.xml activity android:screenOrientation="portrait" the orientation is locked to portrait so you can expect several bugs using it landscape mode. You will also notice the face detector does only catch faces while holding your phone on portrait mode.
If you are interested in helping the project to support landscape mode, pull requests are welcome. Thanks.
Thanks for your reply @EzequielAdrianM.
Having looked at it further, I see you're definitely correct that the Face Detector only picks up face in portrait (which makes sense). Although that could be overcome by making sure the detector is seeing the face in portrait. If I get a chance, I'll look into this further and make a PR if I can.