private void hLinesWPreprocessingToolStripMenuItem_Click(object sender, EventArgs e) { if (img == null) { return; } float angleSpacing = 1; float minAngle = 0; float maxAngle = 180; InputBox Threshold = new InputBox(); Threshold.ShowDialog(); int T = Convert.ToInt32(Threshold.ValueTextBox.Text); imgUndo = img.Copy(); ImageClass.sobelfilter(imgUndo, img, 3); ImageClass.otsu(imgUndo, img); Image <Gray, float> houghImg = ImageClass.HoughTransform(img.Convert <Gray, byte>(), angleSpacing, minAngle, maxAngle); Image <Bgr, byte> lines = ImageClass.ShowHoughLines(img, imgOri, T); ShowIMG.ShowIMGStatic(img, lines); }
private void houghLinesToolStripMenuItem_Click(object sender, EventArgs e) { if (img == null) { return; } float angleSpacing = 1; float minAngle = 0; float maxAngle = 180; int T = 2; Image <Gray, float> houghImg = ImageClass.HoughTransform(img.Convert <Gray, byte>(), angleSpacing, minAngle, maxAngle); // Image<Bgr, byte> img1 = null; Image <Bgr, byte> lines = ImageClass.ShowHoughLines(img, img, T); ShowIMG.ShowIMGStatic(houghImg, lines); }