Camera2Vision icon indicating copy to clipboard operation
Camera2Vision copied to clipboard

Camera 'zoomed-in' in landscape mode with Camera2

Open thiyagab opened this issue 7 years ago • 3 comments

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 avatar Nov 19 '17 12:11 thiyagab

@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.

brittonjg avatar Nov 30 '17 09:11 brittonjg

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.

EzequielAdrianM avatar Nov 30 '17 13:11 EzequielAdrianM

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.

brittonjg avatar Nov 30 '17 13:11 brittonjg