Halcon calculates image pyramids, downsamples, and scales images

1. Halcon has a special operator to calculate the image pyramid, and also has a special zoom operator. It is very suitable for project compression images, whether it is upsampling or downsampling.
2. Code

read_image (Image, 'C:/Users/Dell/Desktop/11.bmp')
*计算图像高斯金字塔,每层为原来1/2,得到N层金字塔,第N层是1×1
gen_gauss_pyramid (Image, ImagePyramid, 'constant', 0.5)
*查看金字塔一共有多少层
count_obj (ImagePyramid, Number)
*获取第4层,即原图的1/8
select_obj (ImagePyramid, ObjectSelected, 3)

*降采样算子,可以实现金字塔降采样功能,同时可以升采样。
zoom_image_factor (Image, ImageZoomed, 0.1, 0.1, 'constant')
*图像缩放到指定尺寸
zoom_image_size (ImageZoomed, ImageZoom, 2512, 2512, 'constant')
*冲击波滤波,可以明显增强边缘对比度,减少过度像素
shock_filter (ObjectSelected, SharpenedImage,0.5, 10, 'canny', 1.5)

insert image description here

Guess you like

Origin blog.csdn.net/Douhaoyu/article/details/128422144