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
1 | initial version |
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
2 | merged revision |
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
3 | merged revision |
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
imwrite("gray.bmp",src_gray);
Mat grayBlurred;
blur( src_gray, grayBlurred, Size(4,4) );
Mat detected_edges_canny;
Canny( grayBlurred, detected_edges_canny,50,100,3);
imwrite("grayBlurred.jpg",grayBlurred);
imwrite("detected_edges_canny.jpg",detected_edges_canny);
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]));
S.draw(segments,2,Scalar(0,0,255));
if (S.getLength()>maxLength)
{
midRib=S;
found=true;
maxLength=S.getLength();
}
}
imwrite("segments.jpg",segments);
Mat midrib=src.clone();
midRib.draw(midrib,2,Scalar(0,0,255));
imwrite("midrib.jpg",midrib);
}
and the images are at : http://sylvain-ard.fr/temp/ please help me thank you :) bye
4 | merged revision |
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
imwrite("gray.bmp",src_gray);
Mat grayBlurred;
blur( src_gray, grayBlurred, Size(4,4) );
Mat detected_edges_canny;
Canny( grayBlurred, detected_edges_canny,50,100,3);
imwrite("grayBlurred.jpg",grayBlurred);
imwrite("detected_edges_canny.jpg",detected_edges_canny);
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]));
S.draw(segments,2,Scalar(0,0,255));
if (S.getLength()>maxLength)
{
midRib=S;
found=true;
maxLength=S.getLength();
}
}
imwrite("segments.jpg",segments);
Mat midrib=src.clone();
midRib.draw(midrib,2,Scalar(0,0,255));
imwrite("midrib.jpg",midrib);
}
and the images are at : http://sylvain-ard.fr/temp/ like you can see it doen't works. please help me thank you :) bye
5 | merged revision |
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
imwrite("gray.bmp",src_gray);
Mat grayBlurred;
blur( src_gray, grayBlurred, Size(4,4) );
Mat detected_edges_canny;
Canny( grayBlurred, detected_edges_canny,50,100,3);
imwrite("grayBlurred.jpg",grayBlurred);
imwrite("detected_edges_canny.jpg",detected_edges_canny);
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]));
S.draw(segments,2,Scalar(0,0,255));
if (S.getLength()>maxLength)
{
midRib=S;
found=true;
maxLength=S.getLength();
}
}
imwrite("segments.jpg",segments);
Mat midrib=src.clone();
midRib.draw(midrib,2,Scalar(0,0,255));
imwrite("midrib.jpg",midrib);
}
and the images are at : http://sylvain-ard.fr/temp/ 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 : http://www.sylvain-ard.fr/temp/image2.jpg I want the contours in red in this image : http://www.sylvain-ard.fr/temp/image.jpg other examples of stems are : http://www.sylvain-ard.fr/temp/image3.jpg http://www.sylvain-ard.fr/temp/image4.jpg Thank you ! Best regards