Android app using native code crashes at line cvAddWeighted (Bug #2251)
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.
Associated revisions
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