我正在尝试使用Aforge检测墙壁开裂,下面是我的代码。 如何突出原始图片中的裂缝,以及是否有更好的代码来检测墙体开裂? 我应该如何测量裂缝宽度的长度?Left hand side is the original image, right hand side is the "crack" i detect
Bitmap temp = (Bitmap)org.Clone();
// create grayscale filter
Grayscale filter_grayscale = new Grayscale(0.299, 0.587, 0.114);
temp = filter_grayscale.Apply(temp);
// create thresholding filter
Threshold filter = new Threshold(120);
filter.ApplyInPlace(temp);
// create filter
CannyEdgeDetector filter_edge = new CannyEdgeDetector();
filter_edge.ApplyInPlace(temp);
// create filter
Invert filter_invert = new Invert();
filter_invert.ApplyInPlace(temp);
// create and configure the filter
FillHoles filter_hole = new FillHoles();
filter_hole.MaxHoleHeight = 20;
filter_hole.MaxHoleWidth = 20;
filter_hole.CoupledSizeFiltering = false;
filter_hole.ApplyInPlace(temp);
pictureBox2.Image =temp;