create_ncc_model

read_image (Image, 'smd/smd_on_chip_05')
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, 307.019400352734, 312.941176470588,0, 155.294117647059, 130.031746031746)
area_center (Rectangle, Area, RowRef, ColumnRef)
reduce_domain (Image, Rectangle, ImageReduced)
create_ncc_model (ImageReduced, 'auto', 0, 0, 'auto', 'use_polarity', ModelID)
dev_display (Image)
dev_display (Rectangle)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
for J := 1 to 11 by 1
    read_image (Image, 'smd/smd_on_chip_' + J$'02')
    find_ncc_model (Image, ModelID, 0, 0, 0.5, 1, 0.5, 'true', 0, Row, Column, Angle, Score)
    vector_angle_to_rigid (RowRef, ColumnRef, 0, Row, Column, Angle, HomMat2D)
    gen_contour_region_xld (Rectangle, Contours, 'border')
*     affine_trans_region (Rectangle, RegionAffineTrans, HomMat2D, 'nearest_neighbor')
    dev_display (Image)
    dev_display (Contours)
    if (J < 11)
        disp_continue_message (WindowHandle, 'black', 'true')
    endif
    stop ()
endfor
clear_ncc_model (ModelID)

你可能感兴趣的:(前端)