* Width:=5632
* Height:=5632
Width:=9344
Height:=7000
v_w:=0.64
v_h:=0.64
sx:=1000/v_w
sy:=1000/v_h
* py:=-14.52
* px:=-14.52
py := 128.9684
px :=-82.5722
gen_image_const (Image, 'byte', Width, Height)
*read_object (TempRow15Col15, 'D:/Qtprogram/QiangYi-AOI-6TC/CeramicProjectTest/Build/Settings/x1/Model/CP1_L7/dxfRegionPath/Temp_row15_col15.hobj')
*read_object (Cp1PrintL7, 'C:/Users/dengwenxing/Desktop/xiawu log/0831/66/Bailu_66sites_BGA.hobj')
read_object (Cp1PrintL7, 'C:/Users/dengwenxing/Desktop/xiawu log/0831/229/Bailu_229sites_HT_A7_Drill2_3.hobj')
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_scale (HomMat2DIdentity,sy, sx, py+0.5, px+0.5, HomMat2DScale)
hom_mat2d_translate (HomMat2DScale, Height/2-py, Width/2-px, HomMat2DTranslate)
phi := rad(0)
hom_mat2d_rotate (HomMat2DTranslate, phi, Height/2, Width/2, HomMat2DRotate)
homend := HomMat2DRotate
affine_trans_contour_xld (Cp1PrintL7, ContoursAffineTrans, homend)
crop_contours_xld (ContoursAffineTrans, CroppedContours, 0, 0, Height-1,Width-1, 'true')
count_obj (CroppedContours, Number)
gen_region_contour_xld (CroppedContours, Region, 'filled')
select_shape (Region, SelectedRegions, 'area', 'and', 10, Height*Width*1.1)
count_obj (SelectedRegions, Number1)
if(Number1==0)
stop()
endif
union1 (SelectedRegions, RegionUnion)
mirror_region (RegionUnion, RegionMirror, 'row', Height-1)
region_to_bin (RegionMirror, BinImage, 255, 60, Width, Height)
write_image (BinImage, 'bmp', 0, 'C:/Users/dengwenxing/Desktop/xiawu log/0831/test1')
本文来自博客园,作者:七星落地,转载请注明原文链接:https://www.cnblogs.com/dwx-bzdcxy/p/22947186
浙公网安备 33010602011771号