Ask Your Question
0

Android Application Programming with OpenCV - HEAP MEMORY CORRUPTION

asked 2014-05-02 08:30:25 -0600

alampi gravatar image

I am working through this book, it is excellent and I highly recommend.

That said, I'm stuck in Chapter 2, receiving the below error. So far, I've tried: *Searching all the forums, it seems these memory heap errors are hard to fix for most and I had trouble figuring out what tmalloc_small is *Using the project files you have for download here: http://nummist.com/opencv/5206_02.zip *Updating the call in CameraActivity.java to "OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback);" from 2_4_3 to 2_4_5 (to match the current version of OpenCV)

None of these resolved the error below. I'm running this on an HTC Sense 3.6, Android 4.0.3, OpenCV Manager 2.4.8.0 (latest one). When I run, it opens the app then crashes after about 30 seconds, with the following error in the console:

05-02 08:05:43.421: D/OpenCV_NativeCamera(20633): initCameraConnect: preview format is set to yuv420sp 05-02 08:05:43.421: A/libc(20633): @@@ ABORTING: HEAP MEMORY CORRUPTION IN tmalloc_small 05-02 08:05:43.421: A/libc(20633): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)

Any direction you can provide is greatly appreciated. Thank you!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-05-04 11:20:59 -0600

The failure is a bug in OpenCV Native camera implementation for Android. Native camera is experimental api for camera access for native code without Java API. You have two ways to fix the issue

  1. Switch to Java camera. The solution is applicable for Java apps only. Replace 'NativeCameraView' on 'JavaCameraView'.

  2. Update OpenCV for Android up to 2.4.9.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-05-02 08:30:25 -0600

Seen: 875 times

Last updated: May 04 '14