read_image (Image, 'C:/Users/sunjie/Desktop/2D测量/170908cg0z381ud1qw0gub.jpg') rgb1_to_gray (Image, GrayImage) median_image (GrayImage, ImageMedian, 'square', 4, 'mirrored') emphasize (ImageMedian, ImageEmphasize, 21, 21, 2)
create_metrology_model (MetrologyHandle) dev_get_window (WindowHandle) draw_rectangle2 (WindowHandle, Row, Column, Phi, Length1, Length2) gen_rectangle2 (Rectangle, Row, Column, Phi, Length1, Length2)
RowBegin := Row + Length1 * sin(Phi) ColBegin := Column - Length1 * cos(Phi) RowEnd := Row - Length1 * sin(Phi) ColEnd := Column + Length1 * cos(Phi)
gen_cross_contour_xld (Cross, RowBegin, ColBegin, 16, 0) gen_cross_contour_xld (Cross1, RowEnd, ColEnd, 16, 0)
add_metrology_object_line_measure (MetrologyHandle,RowBegin,ColBegin,RowEnd,ColEnd, 20, 5, 1.5, 30, [], [], Index) set_metrology_object_param (MetrologyHandle, 'all', 'num_instances', 1) set_metrology_object_param (MetrologyHandle, 'all', 'measure_transition', 'negative') set_metrology_object_param (MetrologyHandle, 'all', 'measure_select', 'first') set_metrology_object_param (MetrologyHandle, 'all', 'min_score', 0.95) apply_metrology_model (ImageEmphasize, MetrologyHandle) get_metrology_object_measures (Contours, MetrologyHandle, 0, 'all', Row1, Column1) get_metrology_object_result (MetrologyHandle, 0, 'all', 'result_type', 'all_param', Parameter) get_metrology_object_result_contour (Contour, MetrologyHandle, 0, 'all', 1.5)
|