1 | initial version |
import cv2
img = cv2.imread('bed.jpg', 0);
vis = img.copy()
mser = cv2.MSER_create()
regions = mser.detectRegions(img, None)
hulls = [cv2.convexHull(p.reshape(-1, 1, 2)) for p in regions]
cv2.polylines(vis, hulls, 1, (0, 255, 0))
cv2.imshow('img', vis)
cv2.waitKey(0)
cv2.destroyAllWindows()
SOURCE : https://fossies.org/dox/opencv-3.0.0/mser_8py_source.html
The post above is old. This is how now MSER is used.