处理要求
分别找出扇形左上角,左下角,右上角,右下角,最高点,下面弓形最高点
原图
halcon 处理程序
read_image (Image14208259e49d7b1cf7c544, '544.bmp')
rgb1_to_gray (Image14208259e49d7b1cf7c544, GrayImage)
threshold (GrayImage, Region, 128, 255)
closing_circle (Region, RegionClosing, 10.5)
gen_contour_region_xld (RegionClosing, Contours, 'border')
select_obj (Contours, ObjectSelected, 1)
smooth_contours_xld (ObjectSelected, SmoothedContours, 3)
segment_contours_xld (SmoothedContours, ContoursSplit, 'lines_circles', 5, 2, 3)
select_shape_xld (ContoursSplit, SelectedXLD, ['contlength','compactness'], 'and', [30,0], [150,40])
fit_circle_contour_xld (SelectedXLD, 'algebraic', -1, 0, 0, 3, 2, Row, Column, Radius, StartPhi, EndPhi, PointOrder)
gen_circle_contour_xld (ContCircle, Row, Column, Radius, 0, 6.28319, 'negative', 1)
select_shape_xld (ContoursSplit, SelectedXLD1, 'contlength', 'and', 200, 500)
fit_line_contour_xld (SelectedXLD1, 'tukey', -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
intersection_line_circle (RowBegin[0], ColBegin[0], RowEnd[0], ColEnd[0], Row[0], Column[0], Radius[0], 0, 3.1415926, 'positive', Row1, Column1)
gen_cross_contour_xld (Cross, Row1, Column1, 50, 6.28319)
intersection_line_circle (RowBegin[0], ColBegin[0], RowEnd[0], ColEnd[0], Row[1], Column[1], Radius[1], 0, 3.1415926, 'positive', Row2, Column2)
gen_cross_contour_xld (Cross1, Row2, Column2, 50, 6.28319)
intersection_line_circle (RowBegin[1], ColBegin[1], RowEnd[1], ColEnd[1], Row[0], Column[0], Radius[0], 0, 3.1415926, 'positive', Row3, Column3)
gen_cross_contour_xld (Cross2, Row3, Column3, 50, 6.28319)
intersection_line_circle (RowBegin[1], ColBegin[1], RowEnd[1], ColEnd[1], Row[1], Column[1], Radius[1], 0, 3.1415926, 'positive', Row4, Column4)
gen_cross_contour_xld (Cross3, Row4, Column4, 50, 6.28319)
intersection_line_circle ([Row1+Row3]/2.0, [Column1+Column3]/2.0, [Row2+Row4]/2.0, [Column2+Column4]/2.0, Row[0], Column[0], Radius[0], 0, 3.1415926, 'positive', Row5, Column5)
gen_cross_contour_xld (Cross4, Row5, Column5, 100, 0)
intersection_line_circle ([Row1+Row3]/2.0, [Column1+Column3]/2.0, [Row2+Row4]/2.0, [Column2+Column4]/2.0, Row[1], Column[1], Radius[1], 0, 3.1415926, 'positive', Row6, Column6)
gen_cross_contour_xld (Cross5, Row6, Column6, 100, 0)
dev_display (GrayImage)
dev_display (Cross)
dev_display (Cross1)
dev_display (Cross2)
dev_display (Cross3)
dev_display (Cross4)
dev_display (Cross5)