Get the coordinates of non-geometric lines in a binary image

I am trying to recognize hand positions in OpenCV for Android. I would like to reduce the detected hand shape to a set of simple lines (= dotted sequences) . I use the decimation algorithm to find the skeletal lines of detected hand shapes. Here is an example result (left hand image):

enter image description here

In this image, I would like to get the coordinates of the skeletal lines, i.e. "vectorize" the image. I tried HoughLinesP, but it only creates huge sets of very short lines, which I don't want.

My second approach uses findContours :

// Get contours
Mat skeletonFrame; //image above
ArrayList<MatOfPoint> contours = new ArrayList<MatOfPoint>();
Imgproc.findContours(skeletonFrame, contours, new Mat(), Imgproc.RETR_CCOMP, Imgproc.CHAIN_APPROX_SIMPLE);

// Find longest contour
double maxLen = 0;
MatOfPoint max = null;
for (MatOfPoint c : contours) {
    double len = Imgproc.arcLength(Util.convert(c), true);  //Util.convert converts between MatOfPoint and MatOfPoint2f
    if (len > maxLen) {
        maxLen = len;
        max = c;
    }
}

// Simplify detected contour
MatOfPoint2f result = new MatOfPoint2f();
Imgproc.approxPolyDP(Util.convert(max), result, 5.0, false);

; , findContours, , , .

: ( = , )

enter image description here

, : ?

- OpenCV? , , , . !

+4
1

  • / ()
  • , CCD, . ,

  • ,

    xray/kinematics

    // - ( ) - - . , /, . , .

?

, , , . ( treshold), , , , , , , , . .

, OpenCV ( ), , , . ,

geometrical thinning

, ( ). (), !!! .

+2

All Articles