Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

First, a KeyPoint is a class which not only holds the location but more information, like size, etc. , see http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_feature_detectors.html?highlight=cv2.keypoint#keypoint-keypoint . Second, a Feature-detector like MSER gives you a list of KeyPoints which are not related to Contours at all. You can however draw them using the drawKeypoints() function, see http://docs.opencv.org/java/org/opencv/features2d/Features2d.html.

If you were aware of both points and you really want to use drawContours, then your second approach should actually work (but haven't tested it myself), however you'd need to set the index to 0 (since you only have one contour), i.e. Imgproc.drawContours(mat, lmop, 0, s);