原文链接:http://answers.opencv.org/question/134783/android-opencv-finding-extreme-points-in-contours/
提出问题:
Good Evening,
I have a trouble with finding extreme points in frames. I am detecting all contours, but I want find there one extreme point, which is lowest from others (southernmost contour). Here is a preview of screen, what I have.
And here is a preview of screen, what I want ! For example, lowest point will bounded by red rectangle.
.
And here is my code, what I have now.
Imgproc.threshold(mFGMask, mFGMask, , , Imgproc.THRESH_BINARY);
Imgproc.erode(mFGMask, mFGMask, , , , ), );
/*for (int idx = 0; idx < contours.size(); idx++) {
double contourarea = Imgproc.contourArea(contours.get(idx));
rect = boundingRect(contours.get(idx));
c1.x = rect.x; c1.y = rect.y;
c2.x = rect.x + rect.width; c2.y = rect.y + rect.height;
if (contourarea > 1024 && contourarea < 30000) {
Imgproc.rectangle(mRgba, c1, c2, new Scalar(255, 0, 0), 3);
}
}*/
return mRgba;
Thanks everybody for help and comments !
;
}
cvtColor(mSrc,mDst,COLOR_GRAY2BGR);
, ) );
vector; i,,), );
ptsContour],,Scalar(,,),);
}
imshow( source_window, mDst );
waitKey();
;
}