APP下载

基于粒子群优化的自适应灰度化算法

2019-10-21黄虎雷宇辉杨丁熊晨皓

微型电脑应用 2019年6期

黄虎 雷宇辉 杨丁 熊晨皓

摘 要: 为了解决传统图像灰度化方法难以充分保存初始图像的原有特征的缺点,提出了一种基于粒子群优化的自适应灰度化算法。根据高像素值像素在彩色图像单通道的灰度直方图分布,通过粒子群寻优选取最好的阈值并自动生成的各分量权值进行图像灰度化。仿真实验表明,比起传统灰度化方法,提出的方法避免了在灰度化过程中,面对不同的彩色图像而通道权值一成不变的缺陷,更好地保留了初始彩色图像的原有特征,为后续的图像处理提供了良好的基础。

关键词: 图像灰度化; 粒子群算法; 灰度直方图

中图分类号: TP391.41

文献标志码: A

文章编号:1007-757X(2019)06-0094-04

Abstract: To overcome the shortcomings of traditional image graying methods that can hardly preserve the original features of the original image, an adaptive gray-level algorithm based on particle swarm optimization is presented. According to the gray histogram distribution of the high pixel in the single channel of the color image, the best threshold is selected by the particle swarm optimization and the weight values of each component are automatically generated to grayscale the image. Simulation experiments prove that compared with the traditional grayscale method, the method proposed in this paper avoids the defect that the weight of the channel is unchangeable in the face of different color images in the process of grayscale. The original feature of the initial color image is preserved better, which provides a good basis for the subsequent image processing.

Key words: Image grayscale; Particle swarm optimization; Gray histogram

0 引言

图像灰度化,即彩色图像到灰度图像的变换过程。目前,图像灰度化在图像处理技术、模式识别等领域中有着广泛应用,例如人脸识别、黑白印刷、车牌识别等都需要进行图像灰度化。如果以提取物体轮廓特征为目的,色彩将被视为冗余信息,良好圖像灰度化不仅可以减小图像对系统资源的占用[1],还可以有效地提高图像处理速度、降低后续图像特征提取的难度。

传统灰度化方法主要分为分量法、最值法、平均值法、加权平均值法等,其中只有加权平均值法考虑了人眼视觉特点,但是在计算机视觉研究中,最主要的目的不是满足人眼对色彩感知特点而是提取相关图像特征,所以如何在灰度化过程中保存原图像的有效信息是目前仍需研究和探讨的问题。……

登录APP查看全文