java - Why is my convexity defect OpenCV in Android getting error? -
i'm beginner in android development , newbie in opencv too. have project hand gesture recognition in android. want convexity defect on it. before convexity defect, should have done finding contour , convex hull. have done them already. now, i'm doing convexity defect defect of hand , fingers. there wrong. when build code convexity defect in android, it's unfortunately stopped. don't know whether convexity defect function wrong, or way value of defect (matofint4) point wrong. somebody, please me. thank you. code :
list<matofint> hull = new arraylist<matofint>(); list<matofint4> defect = new arraylist<matofint4>(); for(int = 0; < newcontours.size(); i++) { hull.add(new matofint()); imgproc.convexhull(newcontours.get(i), hull.get(i)); imgproc.convexitydefects(newcontours.get(i), hull.get(i), defect.get(i)); } point defectsp= new point(); point defectep= new point(); point defectfp= new point(); for(int = 0; < defect.size(); i++) { point[] startp = new point[newcontours.get(i).rows()]; point[] endp = new point[newcontours.get(i).rows()]; point[] farp = new point[newcontours.get(i).rows()]; point[] depthp = new point[newcontours.get(i).rows()]; for(int j = 0; j < defect.get(i).rows(); j++) { int distp = (int) defect.get(i).get(j, 3)[3]; if (distp > 20*256) { startid = (int) defect.get(i).get(j, 0)[0]; endid = (int) defect.get(i).get(j, 1)[1]; farid = (int) defect.get(i).get(j, 2)[2]; defectsp.x = startid; defectsp.y = startid; defectep.x = endid; defectep.y = endid; defectfp.x = farid; defectfp.y = farid; } } }
Comments
Post a Comment