调试代码记录矩形X形

绘制矩形

read_image (Image, 'C:/Users/zhang/Desktop/微信图片_20230603131406.bmp')
binary_threshold (Image, Region, 'max_separability', 'light', UsedThreshold)
connection (Region, ConnectedRegions)
* select_shape (ConnectedRegions, SelectedRegions1, 'row', 'and', 5, 1451)
select_shape (ConnectedRegions, SelectedRegions,['convexity','circularity','rectangularity','area','row'],'and', [0.91,0.603,0.57,5,5],[1,1,1,880,1459])
* select_shape (ConnectedRegions, SelectedRegions,['convexity'],'and', [0.91],[1])
* select_shape (ConnectedRegions, SelectedRegions,['convexity','circularity','rectangularity','area'],'and', [0.5,0.5,0.55,150],[1,1,1,99999])
area_center (SelectedRegions, Area, Row, Column)
gen_cross_contour_xld (Cross, Row, Column, 40, 0)
* select_shape (SelectedRegions, SelectedRegions2, 'row', 'and', 150, 99999)
* gen_region_line (RegionLines, Row[0], Column[0], Row[4], Column[4])
* gen_region_line (RegionLines1,  Row[1], Column[1], Row[3], Column[3])

gen_region_line (RegionLines, Row[0], Column[0], Row[1], Column[1])
gen_region_line (RegionLines1,  Row[1], Column[1], Row[16], Column[16])
gen_region_line (RegionLines2, Row[16], Column[16], Row[15], Column[15])
gen_region_line (RegionLines3,  Row[15], Column[15], Row[0], Column[0])

x形

read_image (Image, 'C:/Users/zhang/Desktop/微信图片_20230603131406.bmp')
binary_threshold (Image, Region, 'max_separability', 'light', UsedThreshold)
connection (Region, ConnectedRegions)
* select_shape (ConnectedRegions, SelectedRegions1, 'row', 'and', 5, 1451)
select_shape (ConnectedRegions, SelectedRegions,['convexity','circularity','rectangularity','area','row'],'and', [0.91,0.603,0.57,5,5],[1,1,1,880,1459])
* select_shape (ConnectedRegions, SelectedRegions,['convexity'],'and', [0.91],[1])
* select_shape (ConnectedRegions, SelectedRegions,['convexity','circularity','rectangularity','area'],'and', [0.5,0.5,0.55,150],[1,1,1,99999])
area_center (SelectedRegions, Area, Row, Column)
gen_cross_contour_xld (Cross, Row, Column, 40, 0)
* select_shape (SelectedRegions, SelectedRegions2, 'row', 'and', 150, 99999)
* gen_region_line (RegionLines, Row[0], Column[0], Row[4], Column[4])
* gen_region_line (RegionLines1,  Row[1], Column[1], Row[3], Column[3])

gen_region_line (RegionLines, Row[0], Column[0], Row[16], Column[16])
gen_region_line (RegionLines1,  Row[1], Column[1], Row[15], Column[15])
intersection_lines (Row[0], Column[0], Row[16], Column[16], Row[1], Column[1], Row[15], Column[15], Row1, Column1, IsOverlapping)
select_shape (ConnectedRegions, SelectedRegions3, 'area', 'and',868, 880)
orientation_region (SelectedRegions3, Phi)
 

你可能感兴趣的:(工作记录,工作记录)