예제 #1
0
 public static void Blobs(OpenCV cv, Pixbuf pixbuf, Select selection, double ScaleX, double ScaleY)
 {
     if (pixbuf != null)
     {
         using (var mat = cv.ToMat(pixbuf))
         {
             cv.BlobDetectorMat(
                 mat,
                 MinArea,
                 MaxArea,
                 selection,
                 ScaleX,
                 ScaleY
                 );
         }
     }
 }
예제 #2
0
    protected void OnBlobDetectorButtonClicked(object o, EventArgs e)
    {
        HideEdit();

        if (OriginalImage != null)
        {
            Application.Invoke(delegate
            {
                using (var mat = cv.ToMat(OriginalImage))
                {
                    cv.BlobDetectorMat(
                        mat,
                        Convert.ToInt32(minArea.Value),
                        Convert.ToInt32(maxArea.Value),
                        GtkSelection.Selection,
                        Convert.ToDouble(imageBox.WidthRequest) / OriginalImage.Width,
                        Convert.ToDouble(imageBox.HeightRequest) / OriginalImage.Height
                        );
                }
            });
        }
    }