rad表示弧度radian,deg表示角度degree; 1. 用基于轮廓的模版匹配,匹配到之后,会有一个参数输出目标与原模版相比旋转的角度。 2. 原图的左上角点和右下角点连线,再把旋转之后图的上角与下角连线,测量两条线的角度。
notifyIcon实现系统托盘
调试
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','circularity','rectangularity','area','row'],'and', [0.91,0.603,0.57,5,5],[1,1,1,1880,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])
* 0.204325gen_region_line (RegionLines, Row[0], Column[0], Row[16], Column[16])
gen_region_line (RegionLines1, Row[0], Column[0], Row[1], Column[1])
* 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',7310, 7319)
select_shape (ConnectedRegions, SelectedRegions3, 'area', 'and',860, 870)
smallest_rectangle2 (SelectedRegions3, Row2, Column2, Phi1, Length1, Length2)
gen_region_line (RegionLines2, Row2, Column2-300, Row2, Column2+300)
* gen_region_line (RegionLines3, Row[1], Column[1], Row2, Column2)
* angle_ll (Row[0], Column[0], Row[1], Column[1], Row2, Column2-300, Row2, Column2+300, Angle)
* gen_rectangle2 (Rectangle, Row2, Column2, Phi1, Length1, Length2)
* orientation_region (SelectedRegions3, Phi)
* line_orientation (Row[0], Column[0], Row[1], Column[1], Phi2)
line_position (Row[0], Column[0], Row[1], Column[1], RowCenter, ColCenter, Length, Phiposition)
angle_lx (Row[0], Column[0], Row[1], Column[1], Angle1)
* tuple_rad (abs(Phi3), Rad)
* tuple_deg (Phi3, Rad1)
a:=abs(Phiposition)