调试代码0

dev_update_off ()
* read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-12.0/examples/images/smd/smd_on_chip_01.png')
read_image (Image, 'D:/图像文件/图片/图片/基板/20230609-103004-0.bmp')
get_image_size (Image, Width, Height)
* dev_close_window ()
* dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
* set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
* dev_set_color ('green')
* dev_set_draw ('margin')

* draw_rectangle2 (WindowHandle, Row1, Column1, Phi, Length1, Length2)
gen_rectangle2 (Rectangle, 1160.3527336860, 1339.7735849056,0.10059596322155395, 486.22061690051726, 452.83619153113818)
area_center (Rectangle, Area, RowRef, ColumnRef)
reduce_domain (Image, Rectangle, ImageReduced)
create_ncc_model (ImageReduced, 'auto', rad(-45), rad(90), 'auto', 'use_polarity', ModelID)
dev_display (Image)
dev_display (Rectangle)
* disp_continue_message (WindowHandle, 'black', 'true')
stop ()
list_files ('D:/图像文件/图片/图片/基板', 'files', ImageFiles)
tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima)$','ignore_case'], ImageFiles)  
for J := 0 to |ImageFiles| by 1
    read_image (Image1, ImageFiles[J])
    find_ncc_model (Image, ModelID,rad(-45), rad(90), 0.5, 1, 0.5, 'true', 0, Row, Column, Angle, Score)
    gen_cross_contour_xld (Cross, Row, Column, 6, Angle)
    vector_angle_to_rigid (RowRef, ColumnRef, -0, Row, Column, Angle, HomMat2D)
    affine_trans_region (Rectangle, RegionAffineTrans, HomMat2D, 'nearest_neighbor')
    gen_contour_region_xld (RegionAffineTrans, Contours, 'border')
    dev_display (Image1)
    dev_display (Contours)
*     if (J < 11)
*         disp_continue_message (WindowHandle, 'black', 'true')
*     endif
    stop ()
endfor
clear_ncc_model (ModelID)

你可能感兴趣的:(笔记,开发语言)