halcon中放大图片
- Halcon从某一个图片以指定区域绘制到另一个图像
- Author: LiGuangyu
- Date: 2018-02-26
- 在Halcon中找了很多次都没找到这种算子,后来自己想出来的一个办法
*读取图像
read_image(Image, ‘fabrik’)
get_image_size(Image, Width, Height)
*生成图像全部区域
gen_rectangle1(Rectangle, 0, 0, Height-1, Width-1)
*从区域生成所有的像素坐标
get_region_points(Rectangle, Rows, Cols)
读取图像的全部像素
get_grayval(Image, Rows, Cols, Grayvals)
生成一个2倍大小的空白图像
gen_image_const(Image1, ‘byte’, Width2, Height2)
*将所有像素坐标加上偏移量
Rows:=Rows+(Height/2)
Cols:=Cols+(Width/2)
*将图像的所有像素覆盖到空白图像的指定区域
set_grayval(Image1, Rows, Cols, Grayvals)