Xamarin.Android.OpenCV icon indicating copy to clipboard operation
Xamarin.Android.OpenCV copied to clipboard

Camera preview orientation locked to landscape?

Open rringham opened this issue 5 years ago • 1 comments

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?

rringham avatar Oct 02 '18 14:10 rringham

Have you solved this?

dfaruque avatar Jan 15 '19 12:01 dfaruque