JavaCameraView slow and blurry and stutters on OpenCV above 2.4.3 (Bug #3033)


Added by Martin Grasser almost 4 years ago. Updated over 3 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Alexander Smorkalov % Done:

0%

Category:android
Target version:2.4.7
Affected version:2.4.0 - 2.4.5 Operating System:Android
Difficulty:Medium HW Platform:ARM
Pull request:

Description

If Im running "OpenCV Tutorial 5 - CameraControl" which can be found in the samples from the OpenCV 2.4.3 release everything is fine, that means, the JavaCameraPreview is smooth and looks as good as the NativeCameraView or the standard app camera preview that comes with my phone to take pictures.

But if Im now running "OpenCV Tutorial 3 - CameraControl" which can be found in the samples from the OpenCV 2.4.5 release, the CameraPreview now looks horrible. Its slow and blury and it stutters and it hurts to see it.

Changing the preview resolution does not solve the problem.

Its the same problem with OpenCV 2.4.4

With my own developed code its the same behavior as with the OpenCV samples.
Changing CvCameraViewListener*2* to CvCameraViewListener also has no effect.

Tested with:
Xperia Mini St15i
Android 4.0.4
ARMv7 Processor rev 2 (v71)
No error output on logcat


example-tutorial-3-cameracontrol-debug.apk (4 MB) Alexander Smorkalov, 2013-07-08 10:59 am


History

Updated by Alexander Shishkov almost 4 years ago

  • Category set to android
  • Priority changed from High to Normal
  • Assignee set to Andrey Pavlenko

Updated by Andrey Pavlenko almost 4 years ago

  • Start date deleted (2013-05-17)
  • Assignee changed from Andrey Pavlenko to Alexander Smorkalov

Updated by Alexander Smorkalov almost 4 years ago

What is the version of OpenCV Manager is installed on you device? DO you install it manually from SDK or from Google Play? If you install it manually from SDK what hardware platform do you choose?
It looks like you install OpenCV Manager for armeabi (arm v5 and arm v6). It is much slower then arm v7 versions and preview fps can be less. Try to remove OpenCV Manager from your device and install it from Google Play. It intellects the most appropriate version. After that check preview quality.

  • Target version set to 2.4.6
  • Assignee changed from Alexander Smorkalov to Martin Grasser

Updated by Martin Grasser almost 4 years ago

I have installed version 2.7. automatically while starting an OpenCV App which required it.
I uninstalled it now und reinstalled it.
I will try it again soon after I modified my source code and post the answer here.

Updated by Martin Grasser almost 4 years ago

I reinstalled OpenCV Manager directly from Google Play.
If I start OpenCV Manager it again says Im using ver 2.7.
Under Device Information it says: ARM v7 with Neon / Os version: Rel(4.04), API 15

I tested it in my code again and changed nothing but the OpenCV version in my project to build from 2.4.3 to 2.4.5.

BUT NOTHING CHANGED!!! Its still messed up with 2.4.5.

Please fix that bug.

Updated by Alexander Smorkalov almost 4 years ago

  • Assignee changed from Martin Grasser to Alexander Smorkalov

Updated by Alexander Smorkalov almost 4 years ago

I investigate your issue. In 2.4.5 automatic frame scaling is added to JavaCameraView and NativeCamera view classes. Check application logcat output for string "mStretch value: xxx". If xxx differs from 0 then application scales each frame for fitting View size. This behavior is enabled by setting android:layout_width and android:layout_height to "match_parent" value. Such behavior has been enabled by default in tuturial3 since OpenCV version 2.4.5.

Ticket canceled as not an issue.

  • Status changed from Open to Cancelled

Updated by Martin Grasser almost 4 years ago

I dont agree to you.
I changed match_parent to wrap_content and the mStretch value changed from 1.0 to 0.0.
But this doesn't change the quality of the camera preview in any way.

In comparison to opencv 2.4.3 its the same huge quality loss that I described above.
It seems the quality changes can best be recognized in daylight scenarios with bright scenarios.

Updated by Martin Grasser almost 4 years ago

I just also testes it with the LG L9 P760 smartphone.

The quality loss is the same!!

So its not platform dependent!!

Please just try it yourself and notice how preview quality changes.

Updated by Alexander Smorkalov almost 4 years ago

  • Status changed from Cancelled to Open

Updated by Kirill Kornyakov almost 4 years ago

  • Target version changed from 2.4.6 to 2.4.7

Updated by Alexander Smorkalov almost 4 years ago

Hello, Martin Grasser!

I make several fixes in JavaCameraView, that can potentially fix your issue too. I attach tutorial-3 package with internal OpenCV build, that is not use OpenCV Manager. Could you, plese, install it on your device and check its performance. I cannot reproduce your issue on any device I have, so your help will be very useful.

Updated by Martin Grasser over 3 years ago

Ok I will test it.

Unfortunately I dont get email notification if you post something here and I dont know how to change it, so I wont miss post.

Updated by Alexander Smorkalov over 3 years ago

Hello Martin!

Do you have any updates about the issue? Can I close the ticket?

Updated by Alexander Smorkalov over 3 years ago

I close the ticket. Martin, fill free to reopen it in case of problems.

  • Status changed from Open to Done

Also available in: Atom PDF