measure a curved petiole

asked 2020-02-26 09:24:19 -0500

SylvainArd gravatar image

updated 2020-11-08 05:13:01 -0500

Hello I want to measure the length of a bramble petiole so there are spines and it is often curved. Ideas please ? Thank you :) Bye

Hi I am trying to extract the petiole of a leaf even if it is very small andif there are tooth on the leaf. An idea ? Thank you :) Bye

Hi I am trying to extract the midrib of a leaf Here is my code :

int main( int argc, char** argv )
    src = imread(  "foliole1.jpg" , IMREAD_COLOR ); // Load an image

    Mat drawing = src.clone();

    Mat bgr[3];   //destination array
    split(src,bgr);//split source
    src_gray=bgr[1];//green channel

    Mat grayBlurred;
    blur( src_gray, grayBlurred, Size(4,4) );

    Mat detected_edges_canny;
    Canny( grayBlurred, detected_edges_canny,50,100,3);
    vector<Vec4i> lines;
    HoughLinesP(detected_edges_canny, lines, 1, CV_PI/360, 30,100, 20);
    double maxLength=0;
    bool found;
    Segment midRib;
    Mat segments=src.clone();
    for( size_t i = 0; i < lines.size(); i++ )
        Vec4i l = lines[i];
        Segment S=Segment(Point(l[0], l[1]), Point(l[2], l[3]));
        if (S.getLength()>maxLength)
    Mat midrib=src.clone();

and the images are at : like you can see it doen't works. please help me thank you :) bye

Hi, for doing several spines measurements I want firstly to extract the contour of the underside of bramble stems. For example for this image : I want the contours in red in this image : other examples of stems are : Thank you ! Best regards

edit retag flag offensive close merge delete


You wanna to remove stem?

supra56 gravatar imagesupra56 ( 2020-04-10 22:18:44 -0500 )edit

No to detect them but it's goodI suceeded

SylvainArd gravatar imageSylvainArd ( 2020-04-11 03:03:24 -0500 )edit

You wanna contour on red but not on top or both? Is that right?

supra56 gravatar imagesupra56 ( 2020-04-11 21:44:27 -0500 )edit

yes but I succeeded, thank you

SylvainArd gravatar imageSylvainArd ( 2020-04-12 05:00:16 -0500 )edit

I succeeded

SylvainArd gravatar imageSylvainArd ( 2020-04-12 05:01:30 -0500 )edit

Post result image. Will you?

supra56 gravatar imagesupra56 ( 2020-04-12 07:28:15 -0500 )edit