Feiyun
unread,May 4, 2012, 4:22:21 AM5/4/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
I am new of Android-OpenCV. Currently, I am working on the gesture
recognition. I am trying to use Imgproc.convexityDefects to find the
convexity defects, but the native function always threw exceptions
like below. I can get the contours and hull of contours successfully,
but when I call Imgproc.convexityDefects, it always threw the
exception. Can you help take a look there are any issues here? or
share me some example android codes? Thanks.
"4-03 22:42:14.648: E/AndroidRuntime(32468): CvException
[org.opencv.core.CvException: /Users/bluremployee/git/intr/opencv/
opencv/modules/imgproc/src/convhull.cpp:572: error: (-27) NULL storage
pointer in function CvSeq* cvConvexityDefects(const CvArr*, const
CvArr*, CvMemStorage*)"
Here is the code, and some logs.
Log.i(TAG,"handCT:"+handCt + "
handCT.dump:"+handCt.dump());
Log.i(TAG,"hull:"+hull + " hull.dump:"+hull.dump());
Log.i(TAG,"convexityDefects:"+convexityDefects + "
convexityDefects.dump:"+convexityDefects.dump());
Imgproc.convexityDefects(handCt, hull, convexityDefects);
Logs,
04-03 22:50:42.908: I/Sample::SampleCvViewBase(1017): handCT:Mat
[ 56*1*CV_32SC2, isCont=true, isSubmat=false, nativeObj=0x318f60,
dataAddr=0x318520 ] handCT.dump:[415, 201; 415, 202; 414, 203; 413,
203; 413, 208; 412, 209; 409, 209; 409, 214; 408, 215; 407, 215; 407,
218; 406, 219; 406, 224; 408, 224; 409, 225; 409, 233; 413, 233; 413,
229; 414, 228; 414, 223; 413, 223; 412, 222; 412, 219; 413, 218; 414,
218; 415, 219; 415, 220; 418, 220; 419, 221; 419, 226; 426, 226; 426,
225; 427, 224; 428, 224; 428, 223; 429, 222; 430, 222; 430, 217; 425,
217; 425, 218; 424, 219; 423, 219; 422, 218; 422, 215; 421, 215; 420,
214; 420, 211; 421, 210; 426, 210; 426, 209; 427, 208; 428, 208; 428,
203; 421, 203; 420, 202; 420, 201]
04-03 22:50:42.918: I/Sample::SampleCvViewBase(1017): hull:Mat
[ 13*1*CV_32SC1, isCont=true, isSubmat=false, nativeObj=0x2c0f38,
dataAddr=0x2c0fc0 ] hull.dump:[36; 30; 16; 15; 12; 11; 9; 6; 3; 0; 55;
52; 37]
04-03 22:50:42.918: I/Sample::SampleCvViewBase(1017):
convexityDefects:Mat [ 0*0*CV_8UC1, isCont=false, isSubmat=false,
nativeObj=0x2c1010, dataAddr=0x0 ] convexityDefects.dump:[]