rotate_image

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')
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值