Android app using native code crashes at line cvAddWeighted (Bug #2251)


Added by Shishir Joshi over 12 years ago. Updated over 12 years ago.


Status:Cancelled Start date:2012-08-08
Priority:Normal Due date:
Assignee:Alexander Smorkalov % Done:

0%

Category:android
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

I've used cvBlobsLib (http://opencv.willowgarage.com/wiki/cvBlobsLib/) to implement skin colour based face detection in native code. But, the app crashes at the line cvAddWeighted(&imageBGR,alpha,temp2,beta,0.0,&imageBGR). The images imageBGR and temp2 have the same depth, same number of channels and same size, but the app still crashes. I found the app crashes at this line by commenting out the other lines.

The app I'm using for testing is a modified version of the tutorial-3 app in the samples of the opencv android package. I'm attaching the jni_part.cpp and java source files.

I've included the blob libraries by putting all the source and header files of the blob library in the jni folder. Also, I'm attaching the android.mk and application.mk files I'm using.


jni_part.cpp (6.2 kB) Shishir Joshi, 2012-08-08 07:47 am

Sample3Native.java (656 Bytes) Shishir Joshi, 2012-08-08 07:47 am

Sample3View.java (1.2 kB) Shishir Joshi, 2012-08-08 07:47 am

SampleViewBase.java (7.1 kB) Shishir Joshi, 2012-08-08 07:47 am

Android.mk (621 Bytes) Shishir Joshi, 2012-08-08 07:47 am

Application.mk (84 Bytes) Shishir Joshi, 2012-08-08 07:47 am


Associated revisions

Revision 4b31b9cb
Added by Andrey Pavlenko about 11 years ago

Merge pull request #2251 from ilya-lavrenov:tapi_sqrboxfilter

History

Updated by Daniil Osokin over 12 years ago

  • Category set to android

Updated by Andrey Kamaev over 12 years ago

  • Assignee set to Alexander Smorkalov

Updated by Alexander Smorkalov over 12 years ago

Not openCV bug.
Application crashes in cvResize function due to different image types:

D/Tutorial3/JNI( 5298): Depth: 8 vs 8
D/Tutorial3/JNI( 5298): Channels: 3 vs 4
E/cv::error()( 5298): OpenCV Error: Assertion failed (src.type() == dst.type()) in void cvResize(const CvArr*, CvArr*, int), file /home/alexander/Projects/OpenCV_Master_new/opencv/modules/imgproc/src/imgwarp.cpp, line 3711
F/libc    ( 5298): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 5318 (Thread-240)

Image from camera has RGBA_C4 type
Image loaded from .jpg has BGR_C3 type
Image loaded from *.png file has BGR_C3 type by default.
To load *.png image with alpha channel you need to fill flags: http://docs.opencv.org/trunk/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=cvloadimage#IplImage
%20cvLoadImage%28const%20char*%20filename,%20int%20iscolor%29

  • Target version set to 2.4.3
  • Status changed from Open to Cancelled

Also available in: Atom PDF