河北大学学报(自然科学版) ›› 2024, Vol. 44 ›› Issue (1): 92-103.DOI: 10.3969/j.issn.1000-1565.2024.01.012

• • 上一篇    下一篇

基于异构平台的图像中值滤波的OpenCL加速算法

肖诗洋1,王镭2,杜莹3,肖汉2   

  • 收稿日期:2022-09-28 出版日期:2024-01-25 发布日期:2024-03-15
  • 通讯作者: 肖汉(1970—)
  • 作者简介:肖诗洋(2000—),男,东南大学在读硕士研究生.E-mail: xsytt626@163.com
  • 基金资助:
    国家自然科学基金资助项目(61250007;61572444);河南省高等学校重点科研项目(22A520049)

OpenCL acceleration algorithm of image median filtering based on heterogeneous platform

XIAO Shiyang1, WANG Lei2, DU Ying3, XIAO Han2   

  1. 1. School of Civil Engineering, Southeast University, Nanjing 211189, China; 2. School of Information Science and Technology, Zhengzhou Normal University, Zhengzhou 450044, China; 3. School of Geography and Tourism, Zhengzhou Normal University, Zhengzhou 450044, China
  • Received:2022-09-28 Online:2024-01-25 Published:2024-03-15

摘要: 图像噪声降低了图像信噪比和质量,去噪是图像处理工作的重要环节之一.本文提出了一种基于开放式计算语言(OpenCL)架构的图像中值滤波快速降噪并行算法.介绍了OpenCL体系结构特点和中值滤波处理流程.根据图形处理器(GPU)的并发结构特点,对图像中值滤波功能模块进行了并行优化,降低了算法复杂度.通过充分激活NDRange索引空间中的工作组和工作项来提高数据访问效率,优化内核工作组配置参数,实现了中值滤波器的并行处理.实验结果表明,在图像质量保持不变的情况下,与基于CPU的串行算法、基于开放多处理(OpenMP)并行算法和基于统一计算设备架构(CUDA)并行算法性能相比,图像中值滤波并行算法在OpenCL架构下NVIDIA GPU计算平台上分别获得了29.74、17.29、1.15倍的加速比.验证了算法的有效性和平台的可移植性,基本满足应用的实时性处理要求.

关键词: 中值滤波, 椒盐噪声, 图形处理器, 开放式计算语言, 并行算法

Abstract: Image noise reduces the signal-to-noise ratio and quality of image, and denoising is one of the important steps in image processing. In this paper, an image median filtering parallel fast denoising filtering algorithm based on Open Computing Language(OpenCL)is proposed. The architecture characteristics of OpenCL and median filtering processing flow are introduced. According to the concurrent structure characteristics of Graphics Processing Unit(GPU), the image median filtering function module is optimized in parallel, and the complexity of the algorithm is reduced. By fully activating the work-groups and work-items in the workspace to improve the efficiency of data access, optimize the configuration parameters of the kernel work-group, the parallel processing of the median filter is realized. The experimental results show that under the condition that the image quality remains unchanged, compared- DOI:10.3969/j.issn.1000-1565.2024.01.012基于异构平台的图像中值滤波的OpenCL加速算法肖诗洋1,王镭2,杜莹3,肖汉2(1.东南大学 土木工程学院,江苏 南京 211189;2.郑州师范学院 信息科学与技术学院,河南 郑州 450044;3.郑州师范学院 地理与旅游学院,河南 郑州 450044)摘 要:图像噪声降低了图像信噪比和质量,去噪是图像处理工作的重要环节之一.本文提出了一种基于开放式计算语言(OpenCL)架构的图像中值滤波快速降噪并行算法.介绍了OpenCL体系结构特点和中值滤波处理流程.根据图形处理器(GPU)的并发结构特点,对图像中值滤波功能模块进行了并行优化,降低了算法复杂度.通过充分激活NDRange索引空间中的工作组和工作项来提高数据访问效率,优化内核工作组配置参数,实现了中值滤波器的并行处理.实验结果表明,在图像质量保持不变的情况下,与基于CPU的串行算法、基于开放多处理(OpenMP)并行算法和基于统一计算设备架构(CUDA)并行算法性能相比,图像中值滤波并行算法在OpenCL架构下NVIDIA GPU计算平台上分别获得了29.74、17.29、1.15倍的加速比.验证了算法的有效性和平台的可移植性,基本满足应用的实时性处理要求.关键词:中值滤波;椒盐噪声;图形处理器;开放式计算语言;并行算法中图分类号:TP311 文献标志码:A 文章编号:1000-1565(2024)01-0092-12OpenCL acceleration algorithm of image median filtering based on heterogeneous platformXIAO Shiyang1, WANG Lei2, DU Ying3, XIAO Han2(1. School of Civil Engineering, Southeast University, Nanjing 211189, China;2. School of Information Science and Technology, Zhengzhou Normal University, Zhengzhou 450044, China;3. School of Geography and Tourism, Zhengzhou Normal University, Zhengzhou 450044, China)Abstract: Image noise reduces the signal-to-noise ratio and quality of image, and denoising is one of the important steps in image processing. In this paper, an image median filtering parallel fast denoising filtering algorithm based on Open Computing Language(OpenCL)is proposed. The architecture characteristics of OpenCL and median filtering processing flow are introduced. According to the concurrent structure characteristics of Graphics Processing Unit(GPU), the image median filtering function module is optimized in parallel, and the complexity of the algorithm is reduced. By fully activating the work-groups and work-items in the workspace to improve the efficiency of data access, optimize the configuration parameters of the kernel work-group, the parallel processing of the median filter is realized. The experimental results show that under the condition that the image quality remains unchanged, compared- 收稿日期:2022-09-28;修回日期:2023-02-11 基金项目:国家自然科学基金资助项目(61250007;61572444);河南省高等学校重点科研项目(22A520049) 第一作者:肖诗洋(2000—),男,东南大学在读硕士研究生.E-mail: xsytt626@163.com 通信作者:肖汉(1970—),男,郑州师范学院教授,主要从事并行算法研究与设计、图像并行处理方向研究.E-mail: xiaohan70@163.com第1期肖诗洋等:基于异构平台的图像中值滤波的OpenCL加速算法with the serial algorithm based on CPU, the parallel algorithm based on Open Multi-Processing(OpenMP)and the parallel algorithm based on Compute Unified Device Architecture(CUDA), the parallel algorithm of image median filtering achieves 29.74 times, 17.29 times and 1.15 times acceleration ratio on the NVIDIA GPU computing platform based on OpenCL architecture, respectively. The effectiveness of the algorithm and the portability of the platform are verified, and the real-time processing requirements of the application are basically met.

Key words: median filtering, salt and pepper noise, graphics processing unit(GPU), open computing language(OpenCL), parallel algorithm

中图分类号: