APP下载

一种基于边缘算子的自适应图像缩放算法

2021-08-05李鸿燕傅奕融乔嘉炜赖方也姚龙

软件工程 2021年7期

李鸿燕 傅奕融 乔嘉炜 赖方也 姚龙

摘  要:本文算法将像素点自适应分为边缘和非边缘区域,对边缘区域的像素点,确定出边缘点的梯度方向和边缘线方向。对边缘线上的点,采用线性插值;对边缘区域梯度方向的点,采用最近邻域插值法;对其他情形的像素点,采用双线性插值。MATLAB仿真环境实验结果表明:该算法提高了边缘及插值方向检测的准确性,与传统的Bilinear、Cubic算法相比,在处理边缘细节较多的图像时,具有更好的边缘估计和插值效果,提高了缩放后图像的视觉质量。

关键词:图像缩放;边缘检测;线性插值;双线性插值

中图分类号:TP301.6     文献标识码:A

A Self-adaptive Image Scaling Algorithm based on Edge Operator

LI Hongyan, FU Yirong, QIAO Jiawei, LAI Fangye, YAO Long

(School of Mathematics, Physics and Statistics, Shanghai University of Engineering Science, Shanghai 201620, China)

wxsh2001@163.com; fuyirong75@163.com; 2476105736@qq.com;

1966577211@qq.com; 1832991860@qq.com

Abstract: The algorithm proposed in this paper adaptively divides pixel points into edge and non-edge areas, and determines gradient direction and edge line direction for the pixel points in edge areas. For points on edge line, linear interpolation is used; for points in the gradient direction of the edge areas, nearest neighbor interpolation is used; for pixels in other situations, bilinear interpolation is used. The experimental results of MATLAB (Matrix & Laboratory) simulation environment show that the algorithm improves the accuracy of edge and interpolation direction detection. Compared with the traditional Bilinear and Cubic algorithms, it has better edge estimation and interpolation effect when processing images with more edge details, so to improve visual quality of the zoomed image.

Keywords: image scaling; edge detection; linear interpolation; bilinear interpolation

1   引言(Introduction)

图像缩放,也称图像重采样、图像分辨率转换。图像缩放可通过插值算法实现,传统基于像素的图像缩放算法[1-4]在缩放时会引起边缘锯齿和细节模糊;针对传统基于像素的插值算法不足,文献[5]提出了基于边缘的图像缩放算法,该类算法较好地消除了邊缘锯齿问题,但是计算量大,同时算法受噪声干扰大,目标图像易出现判断失误。

基于边缘的图像缩放算法中,边缘检测的准确度和边缘区域像素点插值方向判定的精度是算法的关键,对缩放后图像质量好坏有至关重要的影响。若不能找到完整的边缘,插值后的图像仍会存在锯齿;若以边缘点为中心的插值方向定位不准确,沿边缘方向的插值会出现错误,从而影响图像的质量。

本文采用边缘检测最优的Canny算子检测图像中物体的边缘[6-7]。……

登录APP查看全文