read_image (Image, 'D:/VisionControl/image/123.bmp')
ratio := 180/3.1415
Phi:=-1.57229359755206
*旋转图片
*第一个参数是需要旋转的图片,第二个参数是选之后的图片
*第三个参数是旋转的角度,第四个参数是插值的方式,默认就这个
*旋转中心是图片的中心,旋转方向是逆时针(特别注意旋转的方向!!!!)
*旋转成水平方向
* rotate_image(Image, ImageRotate1, ratio*Phi, 'constant')
get_image_size(Image, Width, Height)
hom_mat2d_identity(HomMat2DIdentity)
deg_:=rad(90)
zoom_image_size(Image, ImageZoom, Width/2, Height/2,'constant')
tile_images_offset(ImageZoom,TiledImage, Width/8, Height/8 ,-1, -1, -1, -1, Width, Height)
hom_mat2d_rotate(HomMat2DIdentity, deg_, Height/2, Width/2, HomMat2DRotate)
affine_trans_image(TiledImage, ImageAffineTrans,HomMat2DRotate , 'constant', 'true')
threshold (ImageAffineTrans, Regions, 49, 255)
connection (Regions, Connection)
reduce_domain (ImageAffineTrans, Connection, ImageReduced)
crop_domain (ImageReduced, ImagePart)
write_image (ImagePart, 'bmp', 0, 'D:/图像文件/1231.bmp')