Ask Your Question
1

Android, high definition view

asked 2013-04-26 15:41:11 -0600

Vardan gravatar image

updated 2013-04-26 15:41:51 -0600

Hello, I'm trying to make an app that has 1024x786 or 1920x1080 resolution camera view on it. So far, from what I understand you cant view with resolution higher than your screen using the usual class CameraBridgeViewBase. From what I understand what happens is that my view resolution is around 1200x500 so the highest resolution I get is 800x480. Is there something I'm missing? By the way, I checked out the third tutorial and the way they changed their resolution but as I said it doesnt work because my view is smaller than 1024x786 or 1920x1080. A perfect solution would be if I somehow could get 1920x1080 frames in the onCameraFrame function. Then I could process the frame, downscale it and return it so it fits in my view.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-04-29 01:09:28 -0600

updated 2013-04-29 02:00:17 -0600

Andrey Pavlenko gravatar image

You are right about camera resolution selection. CamereView classes select the maximum resolution that you view can fit. What version of OpenCV4Android SDK do you use? In 2.4.5 automatic resize on frame drawing was introduced. CameraBridgeViewBase scales frame up to fit it to view. It was done for resolutions, that are smaller then view to improve performance on some devices with hd screens. Resolution selection logic is the same. If you want to work with higher resolution then your view size you need to use OpenCV4Android 2.4.5 and implement subclass of JavaCameraView or NativeCameraView and overload calculateCameraFrameSize method. It implements resolution selection logic. If camera resolution is greater then view size frame will be scaled automatically with the same aspect ratio. Find the default implementation in src/org/opencv/android/CameraBridgeViewBase.java:457.

edit flag offensive delete link more

Comments

Hi, I change the value of width and height in the calculateCameraFrameSize function and i return it like this: return new Size(1080, 1920); i tried also return new Size(1920, 1080); and it still doesn't work for me. my device is galaxy s3, what i do wrong?

itay gravatar imageitay ( 2013-10-01 01:38:33 -0600 )edit

Question Tools

Stats

Asked: 2013-04-26 15:41:11 -0600

Seen: 1,680 times

Last updated: Apr 29 '13