I'm working on an Android app that uses OpenCV 3.1.0 and displays the camera preview. Initially, we call setMaxFrameSize(640, 480) because the processing that is required is heavy and we don't need the best video quality that the camera offers. The app works fine on every device except the client's phone. Classic story huh?
The exact problem is the fact that even though we explicitly set the max frame size to be 640 x 480, on his device (Samsung J3) the resolution will be 1280 x 720.
I looked inside JavaCameraView file from OpenCV and called getSupportedPreviewSizes. 640 x 480 is in that list. Everything works well, we set a couple of parameters and in the end we call mCamera.setParameters(params);
The next line in the class is: params = mCamera.getParameters();
When setting the parameters, params.getPreviewSize() = 640 x 480. After calling mCamera.getParameters(), the params.getPreviewSize() will be 1280 x 720. And it's only reproducing on that device.
I've tested the app on Nexus 6P, Samsung S6, Samsung tablet and a couple of phones and everything works fine, the resolution is 640 x 480. But on Samsung J3 whatever resolution i'm setting, the camera will be displaying a 1280 x 720 frame.
Thank you!
Update: 2 days later. Didn't found any solution.