Updated by Alexander Shishkov about 13 years ago

It appears that the BitmapToMat [[BitmapToMat]] function cannot open images that don't have the Bitmap.Config.ARGB_8888 Config. Calling the function on images with other types, such as RGB_565, results in the Mat object having zero size and one channel. Using Bitmap.copy to convert the image to ARGB_8888 before calling the function fixes the problem.

Here is an example log output for the source code I attached:
$ adb logcat
08-06 03:18:21.506 18438 18438 D OpenBitmaps: [[OpenBitmaps]]: /mnt/sdcard/Images/windsor_chair_0002.jpg: exists=true
08-06 03:18:21.506 18438 18438 D OpenBitmaps: [[OpenBitmaps]]: /mnt/sdcard/Images/windsor_chair_0002.jpg: 300x180
08-06 03:18:21.506 18438 18438 D OpenBitmaps: [[OpenBitmaps]]: /mnt/sdcard/Images/windsor_chair_0002.jpg: 0.0x0.0

Android 2.3.3 was used. Here is the processor info:
$ adb shell cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS [[BogoMIPS]] : 299.95
Features : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2

Hardware : mapphone_CDMA
Revision : 0000
Serial : 0000000000000000

Back