- read_image (Image, 'C:/Users/Administrator/Desktop/无标题.jpg')
- gen_rectangle1 (ROI_0, 15.3253, 8.60566, 347.871, 336.718)
- reduce_domain (Image, ROI_0, ImageReduced)
- lines_gauss (ImageReduced, Lines, 2.5, 8, 11, 'dark', 'true', 'bar-shaped', 'true')
- segment_contours_xld (Lines, ContoursSplit, 'lines', 5, 4, 2)
- select_shape_xld (ContoursSplit, SelectedXLD, 'rect2_phi', 'and', -0.5, 0.5)
- union_adjacent_contours_xld (SelectedXLD, UnionContours, 10, 1, 'attr_keep')
- fit_line_contour_xld (UnionContours, 'tukey', -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
- select_shape_xld (ContoursSplit, SelectedXLD2, ['rect2_phi','rect2_phi'], 'or', [-1.7,1.4], [-1.4,1.7])
- union_adjacent_contours_xld (SelectedXLD2, UnionContours2, 10, 1, 'attr_keep')
- fit_line_contour_xld (UnionContours2, 'tukey', -1, 0, 5, 2, RowBegin1, ColBegin1, RowEnd1, ColEnd1, Nr1, Nc1, Dist1)
- rows:=[]
- cols:=[]
- for Index := 0 to |RowBegin|-1 by 1
- for Index1 := 0 to |RowBegin1|-1 by 1
- intersection_lines (RowBegin[Index], ColBegin[Index], RowEnd[Index], ColEnd[Index], RowBegin1[Index1], ColBegin1[Index1], RowEnd1[Index1], ColEnd1[Index1], Row, Column, IsOverlapping)
- rows:=[rows,Row]
- cols:=[cols,Column]
- endfor
- endfor
- gen_cross_contour_xld (Cross, rows, cols, 36, 0.785398)
复制代码 |