Ask Your Question
3

Ensuring compatibility across Android devices

asked 2013-01-09 16:32:06 -0600

Nolan gravatar image

updated 2013-01-10 12:27:24 -0600

We have a consumer-targeted Android app for which OpenCV support is critical. We need it to work on as many devices as possible. We've been unable to capture images on about 40% of the devices we've tried, apparently due to cv::VideoCapture's use of vendor-specific APIs.

Questions:

  1. Is this (~40%) failure rate in line with what others have seen?
    • Devices that fail: Motorola Droid/X/RAZR, HTC Evo 4G, and (sometimes) Samsung Galaxy S III
  2. What can we do to maximize compatibility across consumer devices?
    • For example, can we capture images using the Android Camera API, convert them to OpenCV-style images, and supply them to our OpenCV processing code, thereby avoiding cv::VideoCapture altogether?
  3. How can we identify devices that will or won't work?
    • Is there a list of Android devices and their support of OpenCV available somewhere?
    • Does the OpenCV team have access to a variety of test devices?

More info:

  • We use static initialization of the OpenCV libraries. Our app is intended for consumers (teachers, specifically), and expecting them to download an additional item from Google Play (OpenCV Manager) is a no-go.
  • For now, we do all image capture and processing operations in native code.
edit retag flag offensive close merge delete

Comments

The app isn't on Google Play yet; I'll update here as soon as I have a version I can share.

Nolan gravatar imageNolan ( 2013-01-11 14:10:56 -0600 )edit

Check out the app on Google Play

Nolan gravatar imageNolan ( 2013-03-21 01:20:12 -0600 )edit

And on the iOS App Store

Nolan gravatar imageNolan ( 2013-09-17 01:38:56 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
4

answered 2013-01-10 04:14:28 -0600

  1. We do not have enough devices to comment your estimation.

  2. The most appropriate solution for maximizing compatibility across consumer devices is to use Java API for camera. There are several samples in OpenCV that works in such way.

  3. You can find list of known camera problems on OpenCV issue tracker and in release notes. There are two sort of problems. There are problems with some TI SoC based devices with old Android 2.2. Most of them get updates and works fine with newer Android version. There are problems with some Android 4.0.x devices, i.e. HTC One S, HTC One X, Motorola Atrix 2. Most of them already had received updates (or will received in nearest future) up to 4.1.x and works OK with OpenCV. OpenCV team has access to some of such devices, but there is no solution.

  4. Using static initialization is not good idea. Since OpenCV 2.4.3 OpenCV Manager uses new features of Google Play and includes internal OpenCV library. It is enough in most cases and binary package is not needed. Manager and optional packages installation also were simplified. It is not annoying like in 2.4.2. Initialization with manager gives you several advantages. First of all, performance speed up on platforms with hardware optimizations. The second is support and bug fixes. OpenCV team make package updates with every new version of Android to support camera and other version specific features.

edit flag offensive delete link more

Comments

  1. Okay.
  2. Great! I had the false impression that the OpenCV Java API was merely a wrapper for Native functions, so it would use cv::VideoCapture anyway. It seems the OpenCV Java API does indeed use the Android Camera API in JavaCameraView.java.
  3. Thanks for the tips.
  4. I've updated the question to reflect needing only OpenCV Manager. However, any additional download - even just one - will be confusing for many of our users. If we use static initialization and the Java Camera API, will we have significant compatibility issues, or will only performance suffer?
Nolan gravatar imageNolan ( 2013-01-10 12:36:44 -0600 )edit
  1. Okay

  2. Most of OpenCV Java API is merely wrapper for native functions. Most of all are generating automatically. VideoCapture class in Java is direct wrapper for cv::VideoCapture in C++. But JavaCamera (JavaCameraView class) uses android.hardware.camera package from standard Android API, that makes this approach more portable across devices.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-01-10 23:52:50 -0600 )edit
  1. Okay

  2. Okay

  3. Okay

  4. OpenCV Manager makes OpenCV independent from your application. It allows OpenCV team fix bugs and make improvements for existing apps. For the same version of OpenCV developer team makes mostly compatibility improvements and bug fixes. For example, there were several updates of 2.4.2 package that improve compatibility with some old Android 2.3 devices and add support for Android 4.1. In case of version change some performance improvements can be done. Since OpenCV 2.4.2 all versions of OpenCV are binary compatible, so update to new library version does not break old apps.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-01-10 23:55:36 -0600 )edit

Question Tools

Stats

Asked: 2013-01-09 16:32:06 -0600

Seen: 1,457 times

Last updated: Jan 10 '13