Search

CN-122023172-A - Image processing method and computer program product

CN122023172ACN 122023172 ACN122023172 ACN 122023172ACN-122023172-A

Abstract

The present disclosure provides an image processing method and a computer program product, relating to the technical field of image processing, the image processing method comprises the steps of obtaining an image to be processed; the method comprises the steps of determining a target fixed point data type according to fuzzy demand information of an image to be processed, determining parameters after fixed point processing according to the target fixed point data type and preset fixed point rules, and carrying out Gaussian filtering processing on the image to be processed according to the parameters after fixed point processing to obtain a processed image. The present disclosure can reduce the consumption of hardware resources and the time-consuming period of image processing.

Inventors

  • LI XIAOBO
  • Fei Yulu
  • HU XUEFENG
  • GU CHENGMING
  • DENG DEXIN
  • ZHANG WENDONG
  • ZHAO MINGFEI
  • PI JINYONG
  • DENG XIN

Assignees

  • 北京三快网络科技有限公司

Dates

Publication Date
20260512
Application Date
20260121

Claims (10)

  1. 1. An image processing method, comprising: acquiring an image to be processed; determining a target fixed point data type according to the fuzzy demand information of the image to be processed; Determining parameters after fixed-point processing according to the target fixed-point data type and preset fixed-point rules; and carrying out Gaussian filtering processing on the image to be processed according to the parameters after the fixed-point processing to obtain the processed image.
  2. 2. The method of claim 1, wherein determining the parameters after the localization process based on the target setpoint data type and the preset localization rule comprises: Determining a fixed-point scaling factor according to floating point type information in the image to be processed and the target fixed-point data type; and carrying out fixed-point processing on the core input parameters of Gaussian filtering according to the fixed-point scaling factors to obtain the fixed-point processed parameters, wherein the fixed-point processed parameters comprise damping coefficients, edge compensation coefficients and scaling factors.
  3. 3. The method according to claim 1 or 2, wherein processing the image to be processed according to the parameters after the pointing processing to obtain a processed image comprises: performing horizontal filtering processing and vertical filtering processing on the image to be processed according to the parameters after the fixed-point processing to obtain an intermediate information set; And performing scaling processing on the intermediate information set to obtain the processed image.
  4. 4. A method according to claim 3, wherein performing horizontal filtering processing and vertical filtering processing on the image to be processed according to the parameters after the fix-up processing to obtain an intermediate information set comprises: Determining filtering frequency information; Determining a first value range of bit numbers representing decimal according to a fixed-point scaling factor, a parameter after fixed-point processing, a pixel maximum value of the image to be processed and the filtering frequency information; determining an overflow protection factor of unidirectional line filtering according to the filtering frequency information and the first value range; Performing line filtering processing on the image to be processed according to the overflow protection factor of the unidirectional line filtering, the filtering frequency information and the parameters after the fixed-point processing to obtain a first intermediate information set; And performing vertical filtering processing on the first intermediate information set according to the parameters after the fixed-point processing to obtain a second intermediate information set.
  5. 5. The method according to claim 4, wherein performing line filtering processing on the image to be processed according to the overflow protection factor of the unidirectional line filtering, the filtering number information, and the parameters after the fix-up processing to obtain a first intermediate information set, includes: when the filtering frequency information is determined to indicate the filtering frequency to be M, determining the unidirectional line filtering frequency to be 2M, wherein M is a positive integer; Performing first line filtering processing on the image to be processed according to the overflow protection factor of the unidirectional line filtering and the parameters after the fixed point processing, determining a first updated pixel value of a starting position and a first updated pixel value of a non-starting position in the image to be processed, and And executing 2M-1 times of line filtering processing on the first updated pixel value of the initial position and the first updated pixel value of the non-initial position according to the overflow protection factor of the unidirectional line filtering and the parameter after the fixed-point processing so as to determine the first intermediate information set.
  6. 6. The method of claim 5, wherein performing a first line filtering process on the image to be processed according to the overflow protection factor of the unidirectional line filtering and the parameters after the fix-up process, determining a first updated pixel value of a start position and a first updated pixel value of a non-start position in the image to be processed comprises: determining a first initial updated pixel value according to the pixel value of the initial position in the image to be processed and the edge compensation coefficient in the horizontal direction in the parameter after the fixed-point processing, and determining the first updated pixel value of the initial position according to the first initial updated pixel value and the overflow protection factor of the unidirectional line filtering; And determining a second initial updated pixel value according to a first updated pixel value of a previous adjacent position of a non-initial position and a damping coefficient in the horizontal direction in the parameter after the fixed point processing, and determining a first updated pixel value of the non-initial position according to the second initial updated pixel value, the overflow protection factor of the unidirectional line filtering, the pixel value of the non-initial position and the fixed point scaling factor.
  7. 7. The method of claim 6, wherein determining the first set of intermediate information by performing 2M-1 line filtering on the first updated pixel value of the start position and the first updated pixel value of the non-start position based on the one-way line filtered overflow protection factor, the fixed point processed parameter, comprises: Performing 2M-1 line filtering processing on the first updated pixel of the start position and the first updated pixel value of the non-start position, each line filtering processing performing the following operations: determining a third initial updated pixel value according to the pixel value of the initial position in the previous stage and the edge compensation coefficient in the horizontal direction in the parameter after the fixed-point processing, and determining a second updated pixel value of the initial position according to the third initial updated pixel value, the overflow protection factor of unidirectional line filtering and the fixed-point scaling factor; Determining a fourth initial updating pixel value according to the pixel value of the previous adjacent position of the non-initial position in the unidirectional line filtering and the damping coefficient in the horizontal direction in the parameter after the fixed-point processing; Determining a sixth initial updated pixel value according to the pixel value of the non-initial position and the overflow protection factor of the unidirectional line filtering in the previous stage, and determining a second updated pixel value of the non-initial position according to the fifth initial updated pixel value and the sixth initial updated pixel value; and determining the first intermediate information set according to the second updated pixel value of the starting position and the second updated pixel value of the non-starting position determined by the last line filtering process in the 2M-1 line filtering processes.
  8. 8. The method of claim 4, wherein performing vertical filtering processing on the first intermediate information set according to the parameters after the fix-up processing to obtain a second intermediate information set, comprises: Determining a second value range according to the fixed-point scaling factor, the filtering frequency information, the first value range, the parameters subjected to fixed-point processing and the pixel maximum value of the image to be processed; determining an overflow protection factor of unidirectional column filtering according to the filtering frequency information and the second value range; And performing column filtering processing on each pixel in the first intermediate information set according to the overflow protection factor of the unidirectional column filtering, the filtering frequency information and the parameters after the fixed-point processing to obtain a second intermediate information set.
  9. 9. The method according to claim 8, wherein performing column filtering processing on each pixel in the first intermediate information set according to the one-way column-filtered overflow protection factor, the filter count information, and the fixed-point processed parameter to obtain a second intermediate information set, comprising: when the filtering frequency information is determined to indicate the filtering frequency to be M, determining the unidirectional column filtering frequency to be 2M, wherein M is a positive integer; Performing 2M column filtering processes on each pixel in the first intermediate information set, each column filtering process performing the following operations: Determining a seventh initial updated pixel value according to the pixel value of the initial position in the previous stage and the edge compensation coefficient in the vertical direction in the parameter after the fixed-point processing, and determining a third updated pixel value of the initial position according to the seventh initial updated pixel value, the overflow protection factor of the unidirectional column filtering and the fixed-point scaling factor; Determining an eighth initial updating pixel value according to the pixel value of the previous adjacent position of the non-initial position in the unidirectional column filtering and the damping coefficient in the vertical direction in the parameter after the fixed-point processing; Determining a tenth initial updated pixel value according to the pixel value of the non-initial position and the overflow protection factor of the unidirectional column filtering in the previous stage, and determining a third updated pixel value of the non-initial position according to the ninth initial updated pixel value and the tenth initial updated pixel value; and determining the second intermediate information set according to the third updated pixel value of the starting position and the third updated pixel value of the non-starting position determined by the last column filtering process in the 2M times of column filtering processes.
  10. 10. A computer program product, characterized in that the computer program, when being executed by a processor, implements the image processing method of any of claims 1-9.

Description

Image processing method and computer program product Technical Field The present disclosure relates to the field of image processing technology, and in particular, to an image processing method and a computer program product. Background Gaussian blur (GaussianBlur, gblur) is a common blurring algorithm used in image processing, and is widely applied to image blurring processing and preprocessing links before video coding. In the related art, when the Gaussian blur processing is performed, the floating point number is directly used for operation, and occupied storage is large. The method not only does not occupy large storage and consumes more hardware resources, but also consumes long operation time when image blurring processing or video coding is carried out later, and influences the processing effect on images and videos. Disclosure of Invention The disclosure is directed to an image processing method and a computer program product, so as to overcome the problems of more hardware resources consumption and longer image processing time consumption in the related art at least to a certain extent. Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure. According to one aspect of the disclosure, an image processing method is provided, which comprises the steps of obtaining an image to be processed, determining a target fixed point data type according to fuzzy requirement information of the image to be processed, determining parameters after fixed point processing according to the target fixed point data type and preset fixed point rules, and performing Gaussian filtering processing on the image to be processed according to the parameters after fixed point processing to obtain the processed image. In an exemplary embodiment of the disclosure, determining parameters after fixed-point processing according to the target fixed-point data type and the preset fixed-point rule includes determining a fixed-point scaling factor according to floating-point information in the image to be processed and the target fixed-point data type, performing fixed-point processing on core input parameters of Gaussian filtering according to the fixed-point scaling factor to obtain the parameters after fixed-point processing, wherein the parameters after fixed-point processing include damping coefficients, edge compensation coefficients and scaling factors. In one exemplary embodiment of the disclosure, the processing the image to be processed according to the parameters after the pointing processing to obtain a processed image includes performing horizontal filtering processing and vertical filtering processing on the image to be processed according to the parameters after the pointing processing to obtain an intermediate information set, and performing scaling processing on the intermediate information set to obtain the processed image. In an exemplary embodiment of the disclosure, horizontal filtering processing and vertical filtering processing are performed on the image to be processed according to the parameters after the fixed-point processing to obtain an intermediate information set, wherein the method comprises the steps of determining filtering frequency information, determining a first value range representing decimal bit numbers according to the fixed-point scaling factor, the parameters after the fixed-point processing, a pixel maximum value of the image to be processed and the filtering frequency information, determining an overflow protection factor of unidirectional line filtering according to the filtering frequency information and the first value range, performing line filtering processing on the image to be processed according to the overflow protection factor of unidirectional line filtering, the filtering frequency information and the parameters after the fixed-point processing to obtain a first intermediate information set, and performing vertical filtering processing on the first intermediate information set according to the parameters after the fixed-point processing to obtain a second intermediate information set. In one exemplary embodiment of the disclosure, performing line filtering processing on the image to be processed according to the overflow protection factor of unidirectional line filtering, the filtering frequency information and the parameter after fixed point processing to obtain a first intermediate information set, wherein when the filtering frequency information indicates that the filtering frequency is M, the unidirectional line filtering frequency is determined to be 2M, M is a positive integer, performing first line filtering processing on the image to be processed according to the overflow protection factor of unidirectional line filtering and the parameter after fixed point processing to determine a first updated pixel value of a starting position and a first updated pixel