/// <summary> /// Creates a smart pointer to a FastLineDetector object and initializes it /// </summary> /// <param name="lengthThreshold">Segment shorter than this will be discarded</param> /// <param name="distanceThreshold"> A point placed from a hypothesis line segment farther than /// this will be regarded as an outlier</param> /// <param name="cannyTh1">First threshold for hysteresis procedure in Canny()</param> /// <param name="cannyTh2">Second threshold for hysteresis procedure in Canny()</param> /// <param name="cannyApertureSize">Aperturesize for the sobel operator in Canny()</param> /// <param name="doMerge">If true, incremental merging of segments will be perfomred</param> /// <returns></returns> public static FastLineDetector CreateFastLineDetector( int lengthThreshold = 10, float distanceThreshold = 1.414213562f, double cannyTh1 = 50.0, double cannyTh2 = 50.0, int cannyApertureSize = 3, bool doMerge = false) { return(FastLineDetector.Create(lengthThreshold, distanceThreshold, cannyTh1, cannyTh2, cannyApertureSize, doMerge)); }
public void DetectUsingVector() { using var fld = FastLineDetector.Create(); using var image = Image("building.jpg", ImreadModes.Grayscale); Vec4f[] lines = fld.Detect(image); Assert.NotNull(lines); Assert.True(lines.Length > 0); }
public void DetectUsingVector() { using (var fld = FastLineDetector.Create()) using (var image = Image("building.jpg", ImreadModes.GrayScale)) { Vec4f[] lines = fld.Detect(image); Assert.That(lines, Is.Not.Null.And.Length.GreaterThan(0)); } }
public void DrawSegmentsUsingVector() { using var fld = FastLineDetector.Create(); using var image = Image("building.jpg", ImreadModes.Grayscale); using var view = image.Clone(); Vec4f[] lines = fld.Detect(image); fld.DrawSegments(view, lines, true); ShowImagesWhenDebugMode(view); }
public void DetectUsingOutputArray() { using var fld = FastLineDetector.Create(); using var image = Image("building.jpg", ImreadModes.Grayscale); using var lines = new Mat(); fld.Detect(image, lines); Assert.False(lines.Empty()); Assert.Equal(MatType.CV_32FC4, lines.Type()); Assert.True(lines.Rows > 0); }
public void DrawSegmentsUsingVector() { using (var fld = FastLineDetector.Create()) using (var image = Image("building.jpg", ImreadModes.GrayScale)) using (var view = image.Clone()) { Vec4f[] lines = fld.Detect(image); fld.DrawSegments(view, lines, true); Window.ShowImages(view); } }
public void DrawSegmentsUsingInputArray() { using (var fld = FastLineDetector.Create()) using (var image = Image("building.jpg", ImreadModes.GrayScale)) using (var view = image.Clone()) using (var lines = new Mat()) { fld.Detect(image, lines); fld.DrawSegments(view, lines, true); //Window.ShowImages(view); } }
public void DetectUsingOutputArray() { using (var fld = FastLineDetector.Create()) using (var image = Image("building.jpg", ImreadModes.GrayScale)) using (var lines = new Mat()) { fld.Detect(image, lines); Assert.That(lines.Empty, Is.False); Assert.That(lines.Type(), Is.EqualTo(MatType.CV_32FC4)); Assert.That(lines.Rows, Is.GreaterThan(0)); } }
public void New1() { var fld = FastLineDetector.Create(); fld.Dispose(); }