Example #1
0
 /// <summary>
 /// Extracts MSER by C++-style code (cv::MSER)
 /// </summary>
 /// <param name="gray"></param>
 /// <param name="dst"></param>
 private void CppStyleMSER(Mat gray, Mat dst)
 {
     MSER mser = MSER.Create();
     Point[][] contours;
     Rect[] bboxes;
     mser.DetectRegions(gray, out contours, out bboxes); 
     foreach (Point[] pts in contours)
     {
         Scalar color = Scalar.RandomColor();
         foreach (Point p in pts)
         {
             dst.Circle(p, 1, color);
         }
     }
 }