protected void OnDetectCirclesButtonClicked(object o, EventArgs e) { HideEdit(); if (OriginalImage != null) { Application.Invoke(delegate { using (var mat = cv.ToMat(OriginalImage)) { cv.DetectCirclesMat( mat, dp.Value, minDist.Value, cannyThreshold.Value, circleAccumulatorThreshold.Value, Convert.ToInt32(minRadius.Value), Convert.ToInt32(maxRadius.Value), GtkSelection.Selection, Convert.ToDouble(imageBox.WidthRequest) / OriginalImage.Width, Convert.ToDouble(imageBox.HeightRequest) / OriginalImage.Height ); } }); } }
public static void HoughCircles(OpenCV cv, Pixbuf pixbuf, Select selection, double ScaleX, double ScaleY) { if (pixbuf != null) { using (var mat = cv.ToMat(pixbuf)) { cv.DetectCirclesMat( mat, dp, CircleDistance, EdgeThreshold, HoughThreshold, MinRadius, MaxRadius, selection, ScaleX, ScaleY ); } } }