protected void OnDetectBlobsButtonClicked(object o, EventArgs e)
    {
        HideEdit();

        if (OriginalImage != null)
        {
            Application.Invoke(delegate
            {
                using (var mat = cv.ToMat(OriginalImage))
                {
                    GtkSelection.Selected = 0;

                    cv.DetectBlobsMat(
                        mat,
                        cannyThreshold.Value,
                        linkingThreshold.Value,
                        minArea.Value,
                        maxArea.Value,
                        GtkSelection.Selection,
                        Convert.ToDouble(imageBox.WidthRequest) / OriginalImage.Width,
                        Convert.ToDouble(imageBox.HeightRequest) / OriginalImage.Height
                        );
                }
            });
        }
    }
Beispiel #2
0
 public static void EdgeBlobs(OpenCV cv, Pixbuf pixbuf, Select selection, double ScaleX, double ScaleY)
 {
     if (pixbuf != null)
     {
         using (var mat = cv.ToMat(pixbuf))
         {
             cv.DetectBlobsMat(
                 mat,
                 EdgeThreshold,
                 LinkingThreshold,
                 MinArea,
                 MaxArea,
                 selection,
                 ScaleX,
                 ScaleY
                 );
         }
     }
 }