try OUTPUT_Flag:=0 rgb1_to_gray(INPUT_Image, INPUT_Image) *把图片外围干扰因素剔除 **** draw_spoke(Image, Regions, 3600, 30, 60, 15, ROIRows, ROICols, Direct) ROIRows:=[1584.25, 1216.88, 661.489, 297.014, 297.014, 649.918, 1130.1, 1497.47, 1584.25] ROICols:=[1158.75, 800.276, 762.869, 1096.41, 1751.02, 2050.27, 2084.56, 1819.6, 1158.75] spoke (INPUT_Image, Regions1, 50, 90, 15, 3, 20, 'all', 'first', ROIRows, ROICols, 'inner', ResultRow, ResultColumn, ArcType) pts_to_best_circle(Circle, ResultRow, ResultColumn, 'circle', 40, OUTPUT_RowCentre, OUTPUT_ColCentre, Radius, StartPhi, EndPhi, PointOrder, ArcAngle) * dev_display (INPUT_Image) * dev_display(Circle) if(|Radius|=1) gen_circle(Circle1, OUTPUT_RowCentre, OUTPUT_ColCentre, Radius) reduce_domain (INPUT_Image, Circle1, ImageReduced) gen_circle(Circle2, OUTPUT_RowCentre, OUTPUT_ColCentre, Radius*0.74) reduce_domain(ImageReduced, Circle2, ImageReduced1) difference(ImageReduced, ImageReduced1, RegionDifference) reduce_domain (INPUT_Image, RegionDifference, ImageReduced2) zoom_image_factor(ImageReduced2, ImageZoomed, 0.9, 0.9, 'constant') get_region_points(ImageZoomed, Rows, Columns) get_grayval(ImageZoomed, Rows, Columns, Grayval) gen_image_const(OUTPUT_PreTreatedImage, 'byte', 1440, 1440) gen_image_proto(OUTPUT_PreTreatedImage, OUTPUT_PreTreatedImage, 255) set_grayval(OUTPUT_PreTreatedImage, Rows-OUTPUT_RowCentre*0.9+720, Columns-OUTPUT_ColCentre*0.9+720, Grayval) *查找模板,并对图片进行旋转 find_ncc_model(OUTPUT_PreTreatedImage, ModelID, -3.14, 3.14, 0.3, 1, 0.5, 'true', 0, Row, Column, Angle, Score) * Angle:=Angle if(|Angle|=1) tuple_deg(Angle,Deg ) rotate_image(OUTPUT_PreTreatedImage, ImageRotate, -Deg, 'constant') gen_circle(Circle3, 720, 720, Radius*0.95) reduce_domain(ImageRotate, Circle3, ImageReduced3) get_region_points(ImageReduced3, Rows, Columns) get_grayval(ImageReduced3, Rows, Columns, Grayval) gen_image_const(OUTPUT_PreTreatedImage, 'byte', 1440, 1440) gen_image_proto(OUTPUT_PreTreatedImage, OUTPUT_PreTreatedImage, 255) set_grayval(OUTPUT_PreTreatedImage, Rows, Columns, Grayval) OUTPUT_Flag:=1 else OUTPUT_Flag:=1 endif endif catch (Exception) OUTPUT_Flag:=0 zoom_image_size(INPUT_Image, OUTPUT_PreTreatedImage, 1440, 1440, 'constant') endtry return ()