jeremy-ellis-tech / Xamarin.Android.OpenCV

C# bindings for the OpenCV Android SDK
MIT License
92 stars 44 forks source link

Camera preview orientation locked to landscape? #24

Open rringham opened 6 years ago

rringham commented 6 years ago

I'm seeing the classic Android OpenCV landscape orientation issue with this library - basically, there doesn't seem to be a way to force the camera preview into portrait orientation, short of an extremely expensive, per frame rotation that results in an absolutely massive performance drop - e.g.:

        public Mat OnCameraFrame(CameraBridgeViewBase.ICvCameraViewFrame inputFrame)
        {
            var frame = inputFrame.Rgba();
            Mat frameTranspose = frame.T();
            Imgproc.Resize(frameTranspose, frameTranspose, frame.Size());
            return frameTranspose;
        }

There has to be another solution - but I'm not seeing it. There does not seem to be a way to get a reference to the underlying Camera object, to be able to call setDisplayOrientation().

Any ideas?

dfaruque commented 5 years ago

Have you solved this?