WO2016095541A1 - Image processing method, device, system and computer storage medium - Google Patents

Image processing method, device, system and computer storage medium Download PDF

Info

Publication number
WO2016095541A1
WO2016095541A1 PCT/CN2015/086910 CN2015086910W WO2016095541A1 WO 2016095541 A1 WO2016095541 A1 WO 2016095541A1 CN 2015086910 W CN2015086910 W CN 2015086910W WO 2016095541 A1 WO2016095541 A1 WO 2016095541A1
Authority
WO
WIPO (PCT)
Prior art keywords
image data
matrix
processing
data
threshold
Prior art date
Application number
PCT/CN2015/086910
Other languages
French (fr)
Chinese (zh)
Inventor
高峰
李仲林
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2016095541A1 publication Critical patent/WO2016095541A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators

Definitions

  • the present invention relates to image processing technologies, and in particular, to an image processing method, apparatus, system, and computer storage medium.
  • the enhancement processing method for the image includes sharpening processing and smoothing processing.
  • the commonly used sharpening processing methods mainly include: a differential method and a high-pass filtering method; commonly used smoothing methods mainly include: an interpolation method, a linear smoothing method, a convolution method, and the like.
  • the above sharpening processing method and smoothing processing method generally have the following problems: 1. Only global processing is performed, and each area in the video is not effectively divided to perform enhancement processing for a specific area; 2. The enhancement strength cannot be flexibly adjusted. 3, inconvenient to achieve hardware flow.
  • embodiments of the present invention provide an image processing method, apparatus, system, and computer storage medium, which can effectively divide each area in a video to perform enhancement processing for a specific area, thereby facilitating hardware implementation. .
  • An embodiment of the present invention provides an image processing method, where the method includes:
  • the image data is image data processed according to a preset scaling processing manner
  • the determining that the image data meets a preset condition comprises: determining that the image data meets a preset condition when the image data is image data processed by three differential amplification processing methods;
  • the sequentially acquiring the pixel points of the preset size in the image data to form the matrix image data and processing the matrix image data according to the first processing manner comprises: sequentially acquiring the pixels of the preset size in the image data. Forming matrix image data and processing the matrix image data in a detail sharpening process;
  • the method includes: determining that the image data meets a preset condition when the image data is image data processed by the B-spline amplification processing manner; And sequentially acquiring the pixel points of the preset size in the image data to form matrix image data and processing the matrix image data according to the first processing manner, including: sequentially acquiring a matrix of pixel points of a preset size in the image data.
  • determining that the image data satisfies a preset condition including: when the image data is image data processed in a reduction processing manner, determining that the image data meets a preset condition; correspondingly, the And sequentially acquiring the pixel data of the preset size in the image data to form the matrix image data, and processing the matrix image data according to the first processing manner, comprising: sequentially acquiring pixel points of the preset size in the image data to form matrix image data; The matrix image data is processed in a smoothing process.
  • the sequentially acquiring pixels of a preset size in the image data to form matrix image data and processing the matrix image data according to a detail sharpening processing manner including: starting position of the image data Starting to sequentially acquire 3 ⁇ 3 pixels in the image data Brightness values to form first matrix data;
  • the sequentially acquiring pixel points of a preset size in the image data to form matrix image data and processing the matrix image data according to an edge sharpening processing manner including: starting position of the image data Starting to sequentially acquire luminance values of 3 ⁇ 3 pixel points in the image data to form first matrix data;
  • the sharpening the first matrix data includes: a second gradient of a central pixel point of the first matrix data acquired according to a preset first Laplacian operator value;
  • the preset sharpening manner comprises: obtaining an absolute value of the second gradient value, and obtaining an average value a parameter; limiting a maximum value of the first parameter to obtain a second parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point;
  • the luminance value of the central pixel point + the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point;
  • the luminance value of the central pixel point - the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point.
  • the sequentially acquiring pixel points of a preset size in the image data to form matrix image data and processing the matrix image data in a smoothing manner includes: starting from a starting position of the image data Obtaining 3 ⁇ 3 pixel points in the image data to form first matrix data;
  • a smoothing result of the first matrix data is obtained according to a pre-configured second Laplacian and a smoothing intensity parameter.
  • An embodiment of the present invention further provides an image processing apparatus, where the apparatus includes: an acquiring unit and an image enhancing unit; wherein
  • the acquiring unit is configured to acquire image data; the image data is image data processed according to a preset scaling processing manner;
  • the image enhancement unit is configured to, when determining that the image data acquired by the acquiring unit meets a preset condition, sequentially acquire pixel image data of a preset size in the image data to form matrix image data, and process the processing according to the first processing manner.
  • the matrix image data is described; the first processing mode is a detail sharpening processing mode, an edge sharpening processing mode, or a smoothing processing mode.
  • the image enhancement unit includes a first image enhancement unit configured to determine that the image data meets a preset condition when the image data is image data processed in a three-time difference amplification processing manner; And configured to sequentially acquire pixel points of a preset size in the image data to form matrix image data, and process the matrix image data according to a detail sharpening processing manner;
  • the image enhancement unit further includes a second image enhancement unit configured to determine that the image data meets a preset condition when the image data is image data processed in a B-spline enlargement processing manner; And configured to sequentially acquire pixel points of a preset size in the image data to form matrix image data, and process the matrix image data according to an edge sharpening processing manner;
  • the image enhancement unit further includes a third image enhancement unit configured to determine that the image data satisfies a preset condition when the image data is image data processed in a reduction processing manner; Obtaining pixel points of a preset size in the image data to form matrix image data and processing the matrix image data in a smoothing manner.
  • the first image enhancement unit is configured to sequentially acquire luminance values of 3 ⁇ 3 pixel points in the image data to form first matrix data from a starting position of the image data; Obtaining, by a Sobel operator, a first gradient value of a central pixel point of the first matrix data; preconfiguring a first threshold, a second threshold, and a third threshold, according to the first threshold, the second threshold, and the The third threshold divides the luminance range into four intervals; wherein the first threshold, the second threshold, and the third threshold are both greater than 0 and less than 255; determining that the first gradient value of the central pixel is in the When the first threshold and the second threshold are in the second interval, the first matrix data is sharpened.
  • the second image enhancement unit is configured to sequentially acquire luminance values of 3 ⁇ 3 pixel points in the image data to form first matrix data from a starting position of the image data; a Sobel operator obtains a first gradient value of a central pixel point of the first matrix data; a fourth threshold is pre-configured, and the luminance range is divided into two intervals according to the fourth threshold; wherein the fourth threshold is greater than 0 is less than 255; determining that the first gradient value of the central pixel point is sharpened in the interval formed by the fourth threshold and 255.
  • the first image enhancement unit and the second image enhancement unit are both configured to acquire a central pixel point of the first matrix data according to a pre-configured first Laplacian operator. a second gradient value; obtaining, according to the second gradient value, a sharpening value of the central pixel point according to a preset sharpening manner; wherein the preset sharpening manner comprises: taking an absolute value of the second gradient value And averaging to obtain a first parameter; limiting a maximum value of the first parameter to obtain a second parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point; When the second gradient value is greater than zero, the luminance value of the central pixel point + the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point; when the second gradient When the value is less than zero, the luminance value of the central pixel point - the sharpening value of the central pixel point is used as a sharpen
  • the third image enhancement unit is configured to sequentially acquire 3 ⁇ 3 pixel points in the image data to form first matrix data from a starting position of the image data; according to a pre-configured The second Laplacian and the smoothing intensity parameter obtain a smoothed result of the first matrix data.
  • the embodiment of the present invention further provides an image processing system, where the image processing system includes: an enhancement module, a register configuration module, and a configuration synchronization module; wherein the enhancement module includes the image processing device according to the embodiment of the present invention;
  • the register configuration module is configured to configure parameters required in the enhancement module
  • the configuration synchronization module is configured to synchronize parameters of the register configuration module configuration to the enhancement module.
  • the enhancement module includes: an input module, a first line cache module, a second line cache module, a reg register, a read cache module, a logic enhancement module, and an output module;
  • the input module is configured to receive image data, and input an Nth row and an N+1th row of the image data into the first row cache module and the second row cache module, respectively; After the input of the Nth line of the image data is completed, input the N+1th line of the image data;
  • the read cache module is configured to be configured when the Nth row of the image data is input to the first row cache module and the N+1th row data of the image data is input into the second row cache module Reading the image data of the preset size from the first line buffer module; when the N+1th line of the image data is input to the second line buffer module and the image data is When the N+2 line data is input into the first line buffer module, the preset size image data is read from the second line buffer module; wherein, when the image data is N+2 When the row data is initially input into the first line buffer module, a preset amount of image data in the Nth row of data of the image data is input into the reg register; and is further configured to be according to the first line cache module Reading image data of a preset size read from the second line buffer module, reading the image data of the preset size, and the preset number of image data in the reg register to generate matrix data; , N is an integer;
  • the logic enhancement module is configured to perform enhancement processing on matrix data in the degree cache module; the enhancement processing includes a sharpening process and a smoothing process;
  • the output module is configured to output matrix data processed by the logic enhancement module.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the image processing method according to the embodiment of the invention.
  • the image processing method, device, system and computer storage medium provided by the embodiments of the present invention acquire image data; the image data is image data processed according to a preset scaling processing manner; and when the image data is determined to meet a preset condition And sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to a first processing manner; the first processing manner is a detail sharpening processing manner, an edge sharpening processing manner, or Smooth processing.
  • the image data area is divided into matrix image data of a preset size, thereby effectively dividing each area in the video to perform enhancement processing for a specific area, and facilitating implementation of the present invention.
  • the hardware flow implementation of the image processing method provided by the example.
  • FIG. 1 is a schematic flowchart diagram of an image processing method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of first matrix data according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an image processing system according to an embodiment of the present invention.
  • 5(a) to 5(e) are diagrams showing the data flow of an image processing method according to an embodiment of the present invention.
  • Embodiments of the present invention provide an image processing method.
  • 1 is a schematic flowchart of an image processing method according to an embodiment of the present invention; as shown in FIG. 1, the image processing method includes:
  • Step 101 Acquire image data; the image data is image data processed according to a preset scaling processing manner.
  • the image processing method of the embodiment is applied to the original image data after the preset scaling processing mode is processed, that is, the original image data is processed by the preset scaling processing manner to obtain the image data described in this embodiment;
  • the zoom processing method includes an enlargement processing manner and a reduction processing manner;
  • the amplification processing manner further includes: a three-time difference amplification processing method and a B-spline amplification processing manner.
  • Step 102 When it is determined that the image data meets a preset condition, sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to a first processing manner; the first processing manner Sharpen the processing, edge sharpening, or smoothing.
  • the determining that the image data satisfies a preset condition comprises: determining that the image data meets a preset condition when the image data is image data processed in a three-time difference amplification processing manner; correspondingly, Obtaining the matrix image data of the preset size in the image data to form the matrix image data and processing the matrix image data according to the first processing manner, comprising: sequentially acquiring pixel points of the preset size in the image data to form matrix image data. And processing the matrix image data according to a detail sharpening processing manner;
  • determining that the image data meets a preset condition including: when the image data When the image data processed by the B-spline processing method is used, it is determined that the image data meets a preset condition; correspondingly, the pixel points of the preset size in the image data are sequentially acquired to form matrix image data, and Processing the matrix image data in a processing manner, comprising: sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to an edge sharpening processing manner;
  • determining that the image data satisfies a preset condition including: when the image data is image data processed in a reduction processing manner, determining that the image data meets a preset condition; correspondingly, the And sequentially acquiring the pixel data of the preset size in the image data to form the matrix image data, and processing the matrix image data according to the first processing manner, comprising: sequentially acquiring pixel points of the preset size in the image data to form matrix image data; The matrix image data is processed in a smoothing process.
  • the sharpening processing manner includes a detail sharpening processing manner and an edge sharpening processing manner; and the corresponding sharpening processing manner may be performed according to different zoom processing manners performed before the image data.
  • the sequentially acquiring the pixel points of the preset size in the image data to form the matrix image data and processing the matrix image data according to the detail sharpening processing manner includes: sequentially acquiring from the starting position of the image data 3 ⁇ 3 pixel points in the image data to form first matrix data;
  • FIG. 2 is a schematic diagram of first matrix data according to an embodiment of the present invention; as shown in FIG. 2, wherein Z1, Z2 to Z9 represent luminance values of respective pixel points.
  • the pixel points corresponding to the Z1, Z2 to Z9 may be any 3 ⁇ 3 pixel matrix in the image data, and the first matrix data is the first row to the third row in the image data.
  • the matrix data consisting of the third column of pixels.
  • the Sobel operator weights the values corresponding to the current row or column, and then averages and differentiates.
  • the Sobel operator expression is as follows:
  • S x and S y represented by the expression (2) and the expression (3) respectively represent the horizontal gradient and the vertical gradient of the Sobel operator.
  • the first threshold T1, the second threshold T2, and the third threshold T3 are pre-configured based on the luminance value range, the first threshold T1, the second threshold T2 and the third threshold T3 are all in the brightness value range (0-255); the brightness range is divided according to the first threshold T1, the second threshold T2 and the third threshold T3
  • the four sections are the first section (0 to T1), the second section (T1 to T2), the third section (T2 to T3), and the fourth section (T3 to 255).
  • the first matrix data falling into the second interval (T1 to T2) is sharpened only for the first gradient value g; and when the first gradient value g falls into the The first interval (0 to T1) and the first matrix data falling in the third interval (T2 to T3) are not subjected to image processing; when the first gradient value g falls within the fourth interval (T3 to 255)
  • the first matrix data is subjected to anti-aliasing processing; the anti-aliasing processing is the same as the prior art, and details are not described herein again.
  • the value of the first threshold T1, the second threshold T2, and the third threshold T3 may be pre-configured according to a specific situation or an empirical value; for example, the first threshold T1 is 32, and the second threshold T2 is 96.
  • the third threshold T3 is 128.
  • the first gradient value g falls within the interval (32-96)
  • the first matrix data corresponding to the first gradient value g is sharpened. .
  • the fourth threshold T is also pre-configured based on the range of the luminance value (0 to 255), and the fourth threshold T is in the luminance value range (0 to 255);
  • the fourth threshold T divides the luminance range into two intervals, which are a fifth interval (0 to T) and a sixth interval (T to 255). In this embodiment, only the first gradient value g falls.
  • the sixth interval The first matrix data of (T ⁇ 255) is subjected to sharpening processing; and when the first gradient value g falls into the first matrix data of the fifth interval (0 to T), image processing is not performed; wherein
  • the value of the fourth threshold T may be pre-configured according to a specific situation or an empirical value; for example, the fourth threshold T is 64, and correspondingly, when the first gradient value g falls within the interval of (64-255), Sharpening processing is performed on the first matrix data corresponding to the first gradient value g.
  • the first matrix data in which the first gradient value g falls within the sixth interval (T to 255) is sharpened, and the sharpening processing performed is the same.
  • the sharpening process of the first matrix data includes: a second gradient value of a central pixel point of the first matrix data acquired according to a preset first Laplacian operator;
  • the preset sharpening manner comprises: obtaining an absolute value of the second gradient value, and obtaining an average value a parameter; limiting a maximum value of the first parameter to obtain a second parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point;
  • the luminance value of the central pixel point + the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point;
  • the luminance value of the central pixel point - the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point.
  • the Laplacian operator in the embodiment may be pre-configured in plurality; the expression of the Laplacian operator may be as follows:
  • the Laplacian operator H1 represented by the expression (6) is a conventional Laplacian operator; the Laplacian represented by the expression (7) and the expression (8)
  • the Laplacian operator is a Laplacian operator transformed according to empirical values.
  • a suitable Laplacian operator may be pre-selected as the first Laplacian according to the type of the image data (such as a face or a landscape type) or an attribute parameter of the image data. Si operator.
  • Step 2 f2 (Z5) is the limit f1 (Z5) has a maximum value of 32;
  • step one the absolute value and the average are obtained for the second gradient value f0 to obtain the first parameter f1 (Z5).
  • Step 2 is to limit the maximum value of the first parameter f1 (Z5) to obtain a second parameter f2 (Z5) to reduce the influence of noise on the video sharpening result; wherein the maximum value may be 32, that is, The value of the first parameter f1 (Z5) is limited to a maximum of 32.
  • Step 3 is to modify the second parameter f2 (Z5) to obtain a sharpening value f3 (Z5); wherein the enhancement_ratio is an enhancement coefficient, and the enhancement_ratio may be configured in advance to achieve adaptive adjustment sharpening strength the goal of.
  • the brightness value of the central pixel point is sharpened according to the attribute of the second gradient value f0.
  • the method further comprises: limiting an output bit width of the sharpening result of the brightness value of the central pixel point. That is, (0 to 255) is used as a threshold to control the sharpening result f4 (Z5) of the luminance value of the central pixel point, and the final output result is obtained.
  • the image data when the image data is image data processed in a reduction processing manner, the image data is processed in a smoothing processing manner.
  • the sequentially acquiring pixel points of a preset size in the image data to form matrix image data and processing the matrix image data in a smoothing manner includes: sequentially acquiring the image from a starting position of the image data. 3 ⁇ 3 pixels in the data to form the first matrix data;
  • a smoothing result of the first matrix data is obtained according to a pre-configured second Laplacian and a smoothing intensity parameter.
  • the first matrix data shown in FIG. 2 is still taken as an example, as shown in FIG. 2, wherein Z1, Z2 to Z9 represent luminance values of respective pixel points.
  • the pixel points corresponding to the Z1, Z2 to Z9 may be any 3 ⁇ 3 pixel matrix in the image data, and the first matrix data is the first row to the third row in the image data.
  • the matrix data consisting of the third column of pixels.
  • the smoothing processing method described in the embodiment of the present invention is to perform smoothing processing globally.
  • the Laplacian operator employed can be pre-configured in plurality; the expression of the Laplacian operator can be as follows:
  • a suitable Laplacian operator may be pre-selected as the second Laplacian according to the type of the image data (such as a face or a landscape type) or an attribute parameter of the image data. Si operator.
  • h is a smoothing intensity
  • the range of the smoothing intensity h is any one of (0 to 127)
  • the value of the smoothing intensity h can be pre-configured.
  • the method further comprises: limiting an output bit width of the smoothing result of the brightness value of the central pixel point. That is, the smoothing result S of the luminance value of the central pixel point is controlled by using (0 to 255) as a threshold to obtain a final output result.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the image processing method according to the embodiment of the invention.
  • FIG. 3 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention; as shown in FIG. 3, the apparatus includes: an acquiring unit 31 And an image enhancement unit 32; wherein
  • the acquiring unit 31 is configured to acquire image data; the image data is image data processed according to a preset scaling processing manner;
  • the image enhancement unit 32 is configured to, when determining that the image data acquired by the acquiring unit 31 meets a preset condition, sequentially acquire pixel image data of a preset size in the image data to form matrix image data, and according to the first processing manner Processing the matrix image data; the first processing mode is a detail sharpening processing manner, an edge sharpening processing manner, or a smooth processing manner.
  • the image enhancement unit 32 includes a first image enhancement unit 321 configured to determine that the image data satisfies a preset condition when the image data is image data processed in a three-time difference amplification processing manner; Forming matrix image data by sequentially acquiring pixels of a preset size in the image data and processing the matrix image data according to a detail sharpening processing manner;
  • the image enhancement unit 32 further includes a second image enhancement unit 322 configured to determine that the image data meets a preset condition when the image data is image data processed in a B-spline enlargement processing manner. And configured to sequentially acquire pixel points of a preset size in the image data to form matrix image data, and process the matrix image data according to an edge sharpening processing manner;
  • the image enhancement unit 32 further includes a third image enhancement unit 323 configured to determine that the image data meets a preset condition when the image data is image data processed in a reduction processing manner;
  • the matrix image data is composed of pixel pixels of a preset size in the image data, and the matrix image data is processed in a smoothing manner.
  • the first image enhancement unit 321 is configured to start from the start position of the image data. And sequentially acquiring the luminance values of the 3 ⁇ 3 pixel points in the image data to form the first matrix data; obtaining the first gradient value of the central pixel point of the first matrix data according to the Sobel operator; preconfiguring the first threshold value a second threshold and a third threshold, dividing the luminance range into four intervals according to the first threshold, the second threshold, and the third threshold; wherein, the a threshold, the second threshold, and the third threshold are both greater than 0 and less than 255; determining that the first gradient value of the central pixel is in the second interval of the first threshold and the second threshold And sharpening the first matrix data.
  • the first image enhancement unit 321 is configured to generate a second gradient value of a central pixel point of the first matrix data acquired according to a preset first Laplacian operator; based on the second gradient Obtaining a sharpening value of the central pixel in a preset sharpening manner; wherein the presetting sharpening manner comprises: obtaining an absolute value of the second gradient value and averaging to obtain a first parameter; Obtaining a maximum value of the first parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point; when the second gradient value is greater than zero, a luminance value of a central pixel point + a sharpening value of the central pixel point as a sharpening result of a luminance value of the central pixel point; and when the second gradient value is less than zero, a luminance value of the central pixel point
  • the sharpening value of the central pixel point is a sharpening result of the luminance value of the central pixel point.
  • the second image enhancement unit 322 is configured to start from the start position of the image data. And sequentially acquiring luminance values of 3 ⁇ 3 pixels in the image data to form first matrix data; obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator; and configuring a fourth threshold in advance And dividing, according to the fourth threshold, the luminance range into two intervals; wherein the fourth threshold is greater than 0 and less than 255; determining that the first gradient value of the central pixel is in the interval between the fourth threshold and 255 In the middle, the first matrix data is sharpened.
  • the second image enhancement unit 322 is configured to acquire a second gradient value of a central pixel point of the first matrix data acquired according to a preset first Laplacian operator; based on the second gradient Obtaining a sharpening value of the central pixel in a preset sharpening manner; wherein the presetting sharpening manner comprises: obtaining an absolute value of the second gradient value and averaging to obtain a first parameter; Obtaining a second parameter as a maximum value of the first parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point; when the second gradient value is greater than zero, a luminance value of the central pixel + a sharpening value of the central pixel as a sharpening result of the luminance pixel; and when the second gradient is less than zero, a luminance value of the central pixel
  • the sharpening value of the center pixel is used as the result of the sharpening of the brightness point.
  • the third image enhancement unit 323 is configured to sequentially acquire the image data from the start position of the image data. 3 ⁇ 3 pixel points in the image data are formed to constitute first matrix data; and a smoothing result of the first matrix data is obtained according to a pre-configured second Laplacian and a smoothing intensity parameter.
  • the first image enhancement unit 321 , the second image enhancement unit 322 or the third image enhancement unit 323 may be included, and may further include the first image enhancement unit 321 and the second image enhancement unit 322 .
  • the third image enhancement unit 323 may further include any two combinations of the first image enhancement unit 321, the second image enhancement unit 322, and the third image enhancement unit 323.
  • the first image enhancement unit 321 , the second image enhancement unit 322 , and the third image enhancement unit 323 in the acquisition unit 31 and the image enhancement unit may be used by the image processing apparatus in an actual application. Realized by a central processing unit (CPU), a digital signal processor (DSP), or a Field-Programmable Gate Array (FPGA).
  • CPU central processing unit
  • DSP digital signal processor
  • FPGA Field-Programmable Gate Array
  • FIG. 4 is a schematic structural diagram of an image processing system according to an embodiment of the present invention; as shown in FIG. 4, the image processing system includes: an enhancement module 41, a register configuration module 42 and a configuration synchronization module 43; wherein the enhancement module 41 An image processing apparatus according to an embodiment of the present invention shown in FIG. 3 is included;
  • the register configuration module 42 is configured to configure parameters required in the enhancement module 41;
  • the configuration synchronization module 43 is configured to synchronize parameters configured by the register configuration module 42 to the enhancement module 41.
  • the enhancement module 41 includes: an input module 411, a first row cache module 412, a second row cache module 413, a reg register, a read cache module 414, a logic enhancement module 415, and an output module 416;
  • the input module 411 is configured to receive image data, and input the Nth row and the N+1th row of the image data into the first row buffer module 412 and the second row cache module 413, respectively; After the input of the Nth row of the image data is completed, input the N+1th row of the image data;
  • the read cache module 414 is configured to complete when the Nth row of the image data is input to the first row buffer module 412 and the N+1th row data of the image data is input to the second row cache In the module 413, the image data of the preset size is read from the first line buffer module 412; when the N+1th line of the image data is input to the second line buffer module 413 and the image is completed When the N+2th row data of the data is input into the first row buffer module 412, the preset size image data is read from the second row buffer module 413; wherein, when the image data When the N+2th row data is input into the first row buffer module 412, a preset number of image data in the Nth row data of the image data is input into the reg register; Decoding the preset size image data read in the first line buffer module 412, reading the preset size image data from the second line buffer module 413, and the preset number in the reg register Image data generates matrix data; wherein N is an integer;
  • the logic enhancement module 415 is configured to perform enhancement processing on matrix data in the read cache module 414; the enhancement processing includes a sharpening process and a smoothing process;
  • the output module 416 is configured to output matrix data processed by the logic enhancement module.
  • the image data for the present embodiment is YUV data, YUV and RGB are different color spaces, and are configured to represent colors; the YUV data can optimize the transmission of image signals, requiring only a small amount of bandwidth (RGB requirement three) Independent video signals are transmitted simultaneously; where Y is the brightness (Luminance or Luma), which is the luminance value; and U and V are the chrominance (Chrominance or Chroma), describing the image color and saturation, configured as Specifies the color of the pixel.
  • the first line buffer module 412 and the second line buffer module 413 are configured to buffer the Y component in the YUV data, and the third line cache module and the fourth line shown in FIG.
  • the cache module is configured to buffer the U component and the V component in the YUV data.
  • the U component and the V component in the YUV data are not protected by the embodiment of the present invention, and are not specifically described herein.
  • the reg register described in the embodiment of the present invention is not shown in FIG. 4, and the reg register is only configured to buffer the Y component of two pixels, and the capacity is small.
  • the parameters configured by the register configuration module 42 include: a video resolution register (resolution_reg), a video format register (format_reg) (the video format register includes YUV444, YUV422, and YUV420, etc.), and a sharpening matrix selection register.
  • the edge detection threshold register (threshold_reg), the interrupt register (int_reg), the clear interrupt register (clear_int_reg), and the module enable register (enable); the configuration order of the above registers is: the last configuration enable register (enable), the configuration of other registers There are no special requirements for the order.
  • Data processing is performed according to the selected mode.
  • the module is turned on (ie, the enable register) Set to high level)
  • Y component input channel input Y component of YUV data U component input channel input U component of YUV data, V component input channel input V component of YUV data
  • Y component output channel output processed YUV data The Y component, the U component output channel outputs the U component of the processed YUV data, and the V component output channel outputs the V component of the processed YUV data.
  • the system When a frame of data processing is completed, the system will issue an int interrupt signal. If the system still needs to process data, you need to clear the interrupt register to high level, clear the int interrupt; reconfigure the corresponding register to process the next frame of data. If there is no data processing, turn off the system after clearing the int interrupt (configuring the enable register low).
  • FIG. 5(a) to 5(e) are diagrams showing the data flow of the image processing method according to the embodiment of the present invention.
  • an input video source having image data of 4 ⁇ 4 is taken as an example for describing the input.
  • the video source is the Y component in the YUV data.
  • the enhancement module starts to input the first row data of the 4 ⁇ 4 original video source into the first row cache module;
  • the first line of data input in the video source is completed, and after the first line of the second line is input to the second line buffer module, the first line is accompanied by the input of the subsequent video data.
  • the first row of data stored in the cache module is output one by one (the output data of the video is longer than the input delay line resolution hor plus 1 pixel period, ie hor+1 cycles); wherein the first row cache module stores The data of the first two pixels in the first row of data is input to the reg memory;
  • the first data of the first line and the second data are stored in the reg register from the first line buffer module, and the third line is A data and a second data are respectively input to the idle position in the first line cache module; at this time, based on the currently input of the first row and the second row of the four data and the third row of the two data, can be composed A 3 ⁇ 3 matrix block (one pixel of the missing edge may be empty), since the image processing method in the embodiment of the present invention performs data processing on the pixel located in the middle of the matrix block, At the same time, in the absence of the edge of the pixel, image enhancement can still be performed for the pixel located in the middle; finally, the 3 ⁇ 3 matrix block is output from the line buffer module to the read buffer module, and then the logic enhancement module is used to 3 ⁇ 3 matrix blocks perform enhanced logic operations and output calculation results;
  • the data of the fourth row is input to the second row cache module, and the first two pixels of the second row of data stored by the second row cache module are simultaneously
  • the data is input to the reg memory; an operation process similar to that shown in FIG. 5(c) is performed to calculate the result of the enhancement processing;
  • the enhancement module detects that the input of the last row of data has been completed. At this time, the data of the last row is read from the row buffer module, and since it cannot form a matrix of 3 ⁇ 3, it does not do Any processing.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the image data area is divided into the matrix image data of the preset size, thereby realizing the effective division of each area in the video to perform enhancement processing for the specific area, and facilitating the image processing method provided by the embodiment of the present invention.
  • Hardware pipeline implementation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

Disclosed in an embodiment of the present invention are an image processing method, device, system and computer storage medium, the image processing method comprising: obtaining image data, the image data being image data processed according to a preset zoom-processing; when it is determined that the image data satisfies a preset condition, obtaining pixel points of a preset size in the image data sequentially to constitute matrix image data and processing the matrix image data according to a first processing, the first processing being a detail sharpening processing, an edge sharpening processing and a smoothing processing.

Description

一种图像处理方法、装置、系统和计算机存储介质Image processing method, device, system and computer storage medium 技术领域Technical field
本发明涉及图像处理技术,具体涉及一种图像处理方法、装置、系统和计算机存储介质。The present invention relates to image processing technologies, and in particular, to an image processing method, apparatus, system, and computer storage medium.
背景技术Background technique
在图像处理过程中,由于对原图像进行缩放等操作,使得原图像丢失高频分量,从而导致输出图像模糊的现象。为此,就需要对的输出图像进行增强处理,使得输出图像更加清晰。其中,对图像的增强处理方式包括锐化处理和平滑处理。In the image processing process, the original image is lost due to operations such as scaling the original image, thereby causing the output image to be blurred. To this end, the output image needs to be enhanced to make the output image clearer. Among them, the enhancement processing method for the image includes sharpening processing and smoothing processing.
现有技术中,常用的锐化处理方法主要包括:微分法和高通滤波法;常用的平滑处理方法主要包括:插值方法、线性平滑方法以及卷积法等等。上述的锐化处理方法及平滑处理方法一般都有如下问题:1、只进行全局的处理,没有对视频中各区域进行有效划分从而针对特定区域进行增强处理;2、增强强度不能灵活地进行调整;3、不便于硬件的流水实现。In the prior art, the commonly used sharpening processing methods mainly include: a differential method and a high-pass filtering method; commonly used smoothing methods mainly include: an interpolation method, a linear smoothing method, a convolution method, and the like. The above sharpening processing method and smoothing processing method generally have the following problems: 1. Only global processing is performed, and each area in the video is not effectively divided to perform enhancement processing for a specific area; 2. The enhancement strength cannot be flexibly adjusted. 3, inconvenient to achieve hardware flow.
发明内容Summary of the invention
为解决现有存在的技术问题,本发明实施例提供一种图像处理方法、装置、系统和计算机存储介质,能够对视频中各区域进行有效划分从而针对特定区域进行增强处理,便于硬件的流水实现。In order to solve the existing technical problems, embodiments of the present invention provide an image processing method, apparatus, system, and computer storage medium, which can effectively divide each area in a video to perform enhancement processing for a specific area, thereby facilitating hardware implementation. .
为达到上述目的,本发明实施例的技术方案是这样实现的:To achieve the above objective, the technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供了一种图像处理方法,所述方法包括:An embodiment of the present invention provides an image processing method, where the method includes:
获取图像数据;所述图像数据为按预设缩放处理方式处理后的图像数据; Obtaining image data; the image data is image data processed according to a preset scaling processing manner;
确定所述图像数据满足预设条件时,依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据;所述第一处理方式为细节锐化处理方式、边缘锐化处理方式或平滑处理方式。Determining, when the image data meets the preset condition, sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to a first processing manner; Processing mode, edge sharpening processing or smooth processing.
作为一种实施方式,所述确定所述图像数据满足预设条件,包括:当所述图像数据为按三次差值放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据;As an embodiment, the determining that the image data meets a preset condition comprises: determining that the image data meets a preset condition when the image data is image data processed by three differential amplification processing methods; Correspondingly, the sequentially acquiring the pixel points of the preset size in the image data to form the matrix image data and processing the matrix image data according to the first processing manner comprises: sequentially acquiring the pixels of the preset size in the image data. Forming matrix image data and processing the matrix image data in a detail sharpening process;
和/或,所述确定所述图像数据满足预设条件,包括:当所述图像数据为按B样条放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据;And determining that the image data meets the preset condition, the method includes: determining that the image data meets a preset condition when the image data is image data processed by the B-spline amplification processing manner; And sequentially acquiring the pixel points of the preset size in the image data to form matrix image data and processing the matrix image data according to the first processing manner, including: sequentially acquiring a matrix of pixel points of a preset size in the image data. Image data and processing the matrix image data in an edge sharpening process;
和/或,所述确定所述图像数据满足预设条件,包括:当所述图像数据为按缩小处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵图像数据。And determining that the image data satisfies a preset condition, including: when the image data is image data processed in a reduction processing manner, determining that the image data meets a preset condition; correspondingly, the And sequentially acquiring the pixel data of the preset size in the image data to form the matrix image data, and processing the matrix image data according to the first processing manner, comprising: sequentially acquiring pixel points of the preset size in the image data to form matrix image data; The matrix image data is processed in a smoothing process.
作为一种实施方式,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据,包括:从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的 亮度值以组成第一矩阵数据;As an implementation manner, the sequentially acquiring pixels of a preset size in the image data to form matrix image data and processing the matrix image data according to a detail sharpening processing manner, including: starting position of the image data Starting to sequentially acquire 3×3 pixels in the image data Brightness values to form first matrix data;
根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;Obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator;
预先配置第一阈值、第二阈值和第三阈值,根据所述第一阈值、所述第二阈值和所述第三阈值将亮度范围划分为四个区间;其中,所述第一阈值、所述第二阈值和所述第三阈值均大于0小于255;Presetting a first threshold, a second threshold, and a third threshold, and dividing the luminance range into four intervals according to the first threshold, the second threshold, and the third threshold; wherein the first threshold, the The second threshold and the third threshold are both greater than 0 and less than 255;
确定所述中心像素点的第一梯度值在所述第一阈值和所述第二阈值组成的第二区间中时,对所述第一矩阵数据进行锐化处理。Determining, when the first gradient value of the central pixel point is in the second interval composed of the first threshold and the second threshold, performing sharpening processing on the first matrix data.
作为一种实施方式,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据,包括:从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;As an implementation manner, the sequentially acquiring pixel points of a preset size in the image data to form matrix image data and processing the matrix image data according to an edge sharpening processing manner, including: starting position of the image data Starting to sequentially acquire luminance values of 3×3 pixel points in the image data to form first matrix data;
根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;Obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator;
预先配置第四阈值,根据所述第四阈值将亮度范围划分为两个区间;其中,所述第四阈值大于0小于255;Pre-configuring a fourth threshold, and dividing the luminance range into two intervals according to the fourth threshold; wherein the fourth threshold is greater than 0 and less than 255;
确定所述中心像素点的第一梯度值在所述第四阈值与255组成的区间中时,对所述第一矩阵数据进行锐化处理。Determining, when the first gradient value of the central pixel point is in the interval formed by the fourth threshold and 255, performing sharpening processing on the first matrix data.
作为一种实施方式,所述对所述第一矩阵数据进行锐化处理,包括:根据预先配置的第一拉普拉斯算子获取的所述第一矩阵数据的中心像素点的第二梯度值;As an implementation manner, the sharpening the first matrix data includes: a second gradient of a central pixel point of the first matrix data acquired according to a preset first Laplacian operator value;
基于所述第二梯度值按预设锐化方式获得所述中心像素点的锐化值;其中,所述预设锐化方式包括:对所述第二梯度值取绝对值后求平均获得第一参数;限制所述的第一参数的最大值获得第二参数;将所述第二参数与预设增强系数相乘获得所述中心像素点的锐化值;And obtaining, according to the second gradient value, a sharpening value of the central pixel point according to a preset sharpening manner; wherein the preset sharpening manner comprises: obtaining an absolute value of the second gradient value, and obtaining an average value a parameter; limiting a maximum value of the first parameter to obtain a second parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point;
当所述第二梯度值大于零时,将所述中心像素点的亮度值+所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果; When the second gradient value is greater than zero, the luminance value of the central pixel point + the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point;
当所述第二梯度值小于零时,将所述中心像素点的亮度值-所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果。When the second gradient value is less than zero, the luminance value of the central pixel point - the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point.
作为一种实施方式,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵图像数据,包括:从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点以组成第一矩阵数据;As an implementation manner, the sequentially acquiring pixel points of a preset size in the image data to form matrix image data and processing the matrix image data in a smoothing manner includes: starting from a starting position of the image data Obtaining 3×3 pixel points in the image data to form first matrix data;
根据预先配置的第二拉普拉斯算子和平滑强度参数获得所述第一矩阵数据的平滑结果。A smoothing result of the first matrix data is obtained according to a pre-configured second Laplacian and a smoothing intensity parameter.
本发明实施例还提供了一种图像处理装置,所述装置包括:获取单元和图像增强单元;其中,An embodiment of the present invention further provides an image processing apparatus, where the apparatus includes: an acquiring unit and an image enhancing unit; wherein
所述获取单元,配置为获取图像数据;所述图像数据为按预设缩放处理方式处理后的图像数据;The acquiring unit is configured to acquire image data; the image data is image data processed according to a preset scaling processing manner;
所述图像增强单元,配置为确定所述获取单元获取的所述图像数据满足预设条件时,依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据;所述第一处理方式为细节锐化处理方式、边缘锐化处理方式或平滑处理方式。The image enhancement unit is configured to, when determining that the image data acquired by the acquiring unit meets a preset condition, sequentially acquire pixel image data of a preset size in the image data to form matrix image data, and process the processing according to the first processing manner. The matrix image data is described; the first processing mode is a detail sharpening processing mode, an edge sharpening processing mode, or a smoothing processing mode.
作为一种实施方式,所述图像增强单元包括第一图像增强单元,配置为当所述图像数据为按三次差值放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据;As an embodiment, the image enhancement unit includes a first image enhancement unit configured to determine that the image data meets a preset condition when the image data is image data processed in a three-time difference amplification processing manner; And configured to sequentially acquire pixel points of a preset size in the image data to form matrix image data, and process the matrix image data according to a detail sharpening processing manner;
和/或,所述图像增强单元还包括第二图像增强单元,配置为当所述图像数据为按B样条放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据; And/or, the image enhancement unit further includes a second image enhancement unit configured to determine that the image data meets a preset condition when the image data is image data processed in a B-spline enlargement processing manner; And configured to sequentially acquire pixel points of a preset size in the image data to form matrix image data, and process the matrix image data according to an edge sharpening processing manner;
和/或,所述图像增强单元还包括第三图像增强单元,配置为当所述图像数据为按缩小处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵图像数据。And/or the image enhancement unit further includes a third image enhancement unit configured to determine that the image data satisfies a preset condition when the image data is image data processed in a reduction processing manner; Obtaining pixel points of a preset size in the image data to form matrix image data and processing the matrix image data in a smoothing manner.
作为一种实施方式,所述第一图像增强单元,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;预先配置第一阈值、第二阈值和第三阈值,根据所述第一阈值、所述第二阈值和所述第三阈值将亮度范围划分为四个区间;其中,所述第一阈值、所述第二阈值和所述第三阈值均大于0小于255;确定所述中心像素点的第一梯度值在所述第一阈值和所述第二阈值组成的第二区间中时,对所述第一矩阵数据进行锐化处理。As an embodiment, the first image enhancement unit is configured to sequentially acquire luminance values of 3×3 pixel points in the image data to form first matrix data from a starting position of the image data; Obtaining, by a Sobel operator, a first gradient value of a central pixel point of the first matrix data; preconfiguring a first threshold, a second threshold, and a third threshold, according to the first threshold, the second threshold, and the The third threshold divides the luminance range into four intervals; wherein the first threshold, the second threshold, and the third threshold are both greater than 0 and less than 255; determining that the first gradient value of the central pixel is in the When the first threshold and the second threshold are in the second interval, the first matrix data is sharpened.
作为一种实施方式,所述第二图像增强单元,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;预先配置第四阈值,根据所述第四阈值将亮度范围划分为两个区间;其中,所述第四阈值大于0小于255;确定所述中心像素点的第一梯度值在所述第四阈值与255组成的区间中时,对所述第一矩阵数据进行锐化处理。As an embodiment, the second image enhancement unit is configured to sequentially acquire luminance values of 3×3 pixel points in the image data to form first matrix data from a starting position of the image data; a Sobel operator obtains a first gradient value of a central pixel point of the first matrix data; a fourth threshold is pre-configured, and the luminance range is divided into two intervals according to the fourth threshold; wherein the fourth threshold is greater than 0 is less than 255; determining that the first gradient value of the central pixel point is sharpened in the interval formed by the fourth threshold and 255.
作为一种实施方式,所述第一图像增强单元和所述第二图像增强单元,均配置为根据预先配置的第一拉普拉斯算子获取的所述第一矩阵数据的中心像素点的第二梯度值;基于所述第二梯度值按预设锐化方式获得所述中心像素点的锐化值;其中,所述预设锐化方式包括:对所述第二梯度值取绝对值后求平均获得第一参数;限制所述的第一参数的最大值获得第二参数;将所述第二参数与预设增强系数相乘获得所述中心像素点的锐化值; 当所述第二梯度值大于零时,将所述中心像素点的亮度值+所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果;当所述第二梯度值小于零时,将所述中心像素点的亮度值-所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果。In an embodiment, the first image enhancement unit and the second image enhancement unit are both configured to acquire a central pixel point of the first matrix data according to a pre-configured first Laplacian operator. a second gradient value; obtaining, according to the second gradient value, a sharpening value of the central pixel point according to a preset sharpening manner; wherein the preset sharpening manner comprises: taking an absolute value of the second gradient value And averaging to obtain a first parameter; limiting a maximum value of the first parameter to obtain a second parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point; When the second gradient value is greater than zero, the luminance value of the central pixel point + the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point; when the second gradient When the value is less than zero, the luminance value of the central pixel point - the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point.
作为一种实施方式,所述第三图像增强单元,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点以组成第一矩阵数据;根据预先配置的第二拉普拉斯算子和平滑强度参数获得所述第一矩阵数据的平滑结果。As an embodiment, the third image enhancement unit is configured to sequentially acquire 3×3 pixel points in the image data to form first matrix data from a starting position of the image data; according to a pre-configured The second Laplacian and the smoothing intensity parameter obtain a smoothed result of the first matrix data.
本发明实施例还提供了一种图像处理系统,所述图像处理系统包括:增强模块、寄存器配置模块和配置同步模块;其中,所述增强模块包括本发明实施例所述的图像处理装置;The embodiment of the present invention further provides an image processing system, where the image processing system includes: an enhancement module, a register configuration module, and a configuration synchronization module; wherein the enhancement module includes the image processing device according to the embodiment of the present invention;
所述寄存器配置模块,配置为配置所述增强模块中需要的参数;The register configuration module is configured to configure parameters required in the enhancement module;
所述配置同步模块,配置为将所述寄存器配置模块配置的参数同步至所述增强模块。The configuration synchronization module is configured to synchronize parameters of the register configuration module configuration to the enhancement module.
作为一种实施方式,所述增强模块包括:输入模块、第一行缓存模块、第二行缓存模块、reg寄存器、读缓存模块、逻辑增强模块和输出模块;其中,As an implementation manner, the enhancement module includes: an input module, a first line cache module, a second line cache module, a reg register, a read cache module, a logic enhancement module, and an output module;
所述输入模块,配置为接收图像数据,分别将所述图像数据的第N行和第N+1行输入至所述第一行缓存模块和所述第二行缓存模块中;其中,在所述图像数据的第N行输入完成后,再对所述图像数据的第N+1行进行输入;The input module is configured to receive image data, and input an Nth row and an N+1th row of the image data into the first row cache module and the second row cache module, respectively; After the input of the Nth line of the image data is completed, input the N+1th line of the image data;
所述读缓存模块,配置为当所述图像数据的第N行输入至所述第一行缓存模块完成且所述图像数据的第N+1行数据开始输入至所述第二行缓存模块中时,从所述第一行缓存模块中读取预设大小的图像数据;当所述图像数据的第N+1行输入至所述第二行缓存模块完成且所述图像数据的第 N+2行数据开始输入至所述第一行缓存模块中时,从所述第二行缓存模块中读取所述预设大小的图像数据;其中,当所述图像数据的第N+2行数据开始输入至所述第一行缓存模块中时,所述图像数据的第N行数据中预设数量的图像数据输入至所述reg寄存器中;还配置为根据所述第一行缓存模块中读取的预设大小的图像数据、从所述第二行缓存模块中读取所述预设大小的图像数据以及所述reg寄存器中的所述预设数量的图像数据生成矩阵数据;其中,N为整数;The read cache module is configured to be configured when the Nth row of the image data is input to the first row cache module and the N+1th row data of the image data is input into the second row cache module Reading the image data of the preset size from the first line buffer module; when the N+1th line of the image data is input to the second line buffer module and the image data is When the N+2 line data is input into the first line buffer module, the preset size image data is read from the second line buffer module; wherein, when the image data is N+2 When the row data is initially input into the first line buffer module, a preset amount of image data in the Nth row of data of the image data is input into the reg register; and is further configured to be according to the first line cache module Reading image data of a preset size read from the second line buffer module, reading the image data of the preset size, and the preset number of image data in the reg register to generate matrix data; , N is an integer;
所述逻辑增强模块,配置为对所述度缓存模块中的矩阵数据进行增强处理;所述增强处理包括锐化处理和平滑处理;The logic enhancement module is configured to perform enhancement processing on matrix data in the degree cache module; the enhancement processing includes a sharpening process and a smoothing process;
所述输出模块,配置为输出所述逻辑增强模块处理后的矩阵数据。The output module is configured to output matrix data processed by the logic enhancement module.
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行本发明实施例所述的图像处理方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the image processing method according to the embodiment of the invention.
本发明实施例提供的图像处理方法、装置、系统和计算机存储介质,通过获取图像数据;所述图像数据为按预设缩放处理方式处理后的图像数据;确定所述图像数据满足预设条件时,依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据;所述第一处理方式为细节锐化处理方式、边缘锐化处理方式或平滑处理方式。如此,采用本发明实施例的技术方案,通过对图像数据区域划分为预设大小的矩阵图像数据,从而实现了对视频中各区域进行有效划分从而针对特定区域进行增强处理,并且便于本发明实施例提供的图像处理方法的硬件流水实现。The image processing method, device, system and computer storage medium provided by the embodiments of the present invention acquire image data; the image data is image data processed according to a preset scaling processing manner; and when the image data is determined to meet a preset condition And sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to a first processing manner; the first processing manner is a detail sharpening processing manner, an edge sharpening processing manner, or Smooth processing. In this manner, by adopting the technical solution of the embodiment of the present invention, the image data area is divided into matrix image data of a preset size, thereby effectively dividing each area in the video to perform enhancement processing for a specific area, and facilitating implementation of the present invention. The hardware flow implementation of the image processing method provided by the example.
附图说明DRAWINGS
图1为本发明实施例的图像处理方法的流程示意图;FIG. 1 is a schematic flowchart diagram of an image processing method according to an embodiment of the present invention;
图2为本发明实施例的第一矩阵数据的示意图; 2 is a schematic diagram of first matrix data according to an embodiment of the present invention;
图3为本发明实施例的图像处理装置的组成结构示意图;FIG. 3 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention; FIG.
图4为本发明实施例的图像处理系统的组成结构示意图;4 is a schematic structural diagram of an image processing system according to an embodiment of the present invention;
图5(a)至图5(e)为本发明实施例的图像处理方法的数据流示意图。5(a) to 5(e) are diagrams showing the data flow of an image processing method according to an embodiment of the present invention.
具体实施方式detailed description
下面结合附图及具体实施例对本发明作进一步详细的说明。The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
本发明实施例提供了一种图像处理方法。图1为本发明实施例的图像处理方法的流程示意图;如图1所示,所述图像处理方法包括:Embodiments of the present invention provide an image processing method. 1 is a schematic flowchart of an image processing method according to an embodiment of the present invention; as shown in FIG. 1, the image processing method includes:
步骤101:获取图像数据;所述图像数据为按预设缩放处理方式处理后的图像数据。Step 101: Acquire image data; the image data is image data processed according to a preset scaling processing manner.
本实施例所述的图像处理方法应用于原图像数据进行预设缩放处理方式处理后,即原图像数据进行预设缩放处理方式处理后获得本实施例所述的图像数据;其中,所述预设缩放处理方式包括放大处理方式和缩小处理方式;所述放大处理方式还包括:三次差值放大处理方式和B样条放大处理方式。The image processing method of the embodiment is applied to the original image data after the preset scaling processing mode is processed, that is, the original image data is processed by the preset scaling processing manner to obtain the image data described in this embodiment; The zoom processing method includes an enlargement processing manner and a reduction processing manner; the amplification processing manner further includes: a three-time difference amplification processing method and a B-spline amplification processing manner.
步骤102:确定所述图像数据满足预设条件时,依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据;所述第一处理方式为细节锐化处理方式、边缘锐化处理方式或平滑处理方式。Step 102: When it is determined that the image data meets a preset condition, sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to a first processing manner; the first processing manner Sharpen the processing, edge sharpening, or smoothing.
这里,所述确定所述图像数据满足预设条件,包括:当所述图像数据为按三次差值放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据;Here, the determining that the image data satisfies a preset condition comprises: determining that the image data meets a preset condition when the image data is image data processed in a three-time difference amplification processing manner; correspondingly, Obtaining the matrix image data of the preset size in the image data to form the matrix image data and processing the matrix image data according to the first processing manner, comprising: sequentially acquiring pixel points of the preset size in the image data to form matrix image data. And processing the matrix image data according to a detail sharpening processing manner;
和/或,所述确定所述图像数据满足预设条件,包括:当所述图像数据 为按B样条放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据;And/or, determining that the image data meets a preset condition, including: when the image data When the image data processed by the B-spline processing method is used, it is determined that the image data meets a preset condition; correspondingly, the pixel points of the preset size in the image data are sequentially acquired to form matrix image data, and Processing the matrix image data in a processing manner, comprising: sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to an edge sharpening processing manner;
和/或,所述确定所述图像数据满足预设条件,包括:当所述图像数据为按缩小处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵图像数据。And determining that the image data satisfies a preset condition, including: when the image data is image data processed in a reduction processing manner, determining that the image data meets a preset condition; correspondingly, the And sequentially acquiring the pixel data of the preset size in the image data to form the matrix image data, and processing the matrix image data according to the first processing manner, comprising: sequentially acquiring pixel points of the preset size in the image data to form matrix image data; The matrix image data is processed in a smoothing process.
本实施例中,所述锐化处理方式包括细节锐化处理方式和边缘锐化处理方式;可根据所述图像数据之前进行的不同的放大处理方式执行对应的锐化处理方式。具体的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据,包括:从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点以组成第一矩阵数据;In this embodiment, the sharpening processing manner includes a detail sharpening processing manner and an edge sharpening processing manner; and the corresponding sharpening processing manner may be performed according to different zoom processing manners performed before the image data. Specifically, the sequentially acquiring the pixel points of the preset size in the image data to form the matrix image data and processing the matrix image data according to the detail sharpening processing manner includes: sequentially acquiring from the starting position of the image data 3×3 pixel points in the image data to form first matrix data;
根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;Obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator;
预先配置第一阈值、第二阈值和第三阈值,根据所述第一阈值、所述第二阈值和所述第三阈值将亮度范围划分为四个区间;其中,所述第一阈值、所述第二阈值和所述第三阈值均大于0小于255;Presetting a first threshold, a second threshold, and a third threshold, and dividing the luminance range into four intervals according to the first threshold, the second threshold, and the third threshold; wherein the first threshold, the The second threshold and the third threshold are both greater than 0 and less than 255;
确定所述中心像素点的第一梯度值在所述第一阈值和所述第二阈值组成的第二区间中时,对所述第一矩阵数据进行锐化处理。Determining, when the first gradient value of the central pixel point is in the second interval composed of the first threshold and the second threshold, performing sharpening processing on the first matrix data.
所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据,包括:从所述图像数据的起 始位置开始依次获取所述图像数据中3×3的像素点以组成第一矩阵数据;And sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to an edge sharpening processing manner, including: starting from the image data Starting from the start position, sequentially acquiring 3×3 pixel points in the image data to form first matrix data;
根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;Obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator;
预先配置第四阈值,根据所述第四阈值将亮度范围划分为两个区间;其中,所述第四阈值大于0小于255;Pre-configuring a fourth threshold, and dividing the luminance range into two intervals according to the fourth threshold; wherein the fourth threshold is greater than 0 and less than 255;
确定所述中心像素点的第一梯度值在所述第四阈值与255组成的区间中时,对所述第一矩阵数据进行锐化处理。Determining, when the first gradient value of the central pixel point is in the interval formed by the fourth threshold and 255, performing sharpening processing on the first matrix data.
具体的,图2为本发明实施例的第一矩阵数据的示意图;如图2所示,其中Z1、Z2至Z9表示其中各像素点的亮度值。所述Z1、Z2至Z9所对应的像素点可以是所述图像数据中任一3×3的像素矩阵,如所述第一矩阵数据为所述图像数据中第一行第一列至第三行第三列像素点组成的矩阵数据。Specifically, FIG. 2 is a schematic diagram of first matrix data according to an embodiment of the present invention; as shown in FIG. 2, wherein Z1, Z2 to Z9 represent luminance values of respective pixel points. The pixel points corresponding to the Z1, Z2 to Z9 may be any 3×3 pixel matrix in the image data, and the first matrix data is the first row to the third row in the image data. The matrix data consisting of the third column of pixels.
其中,索贝尔(Sobel)算子是对当前行或列对应的值加权后,再进行平均和差分,具体的,所述索贝尔(Sobel)算子表达式如下所示:Wherein, the Sobel operator weights the values corresponding to the current row or column, and then averages and differentiates. Specifically, the Sobel operator expression is as follows:
G(i,j)=|Sx|+|Sy|     (1)G(i,j)=|S x |+|S y | (1)
Figure PCTCN2015086910-appb-000001
Figure PCTCN2015086910-appb-000001
Figure PCTCN2015086910-appb-000002
Figure PCTCN2015086910-appb-000002
其中,表达式(2)和表达式(3)所示的Sx和Sy分别表示索贝尔(Sobel)算子的水平梯度和垂直梯度。Among them, S x and S y represented by the expression (2) and the expression (3) respectively represent the horizontal gradient and the vertical gradient of the Sobel operator.
分别根据表达式(2)和表达式(3),获得所述第一矩阵数据的中心像素点的亮度值Z5的水平梯度值gx和垂直梯度值gy;所述水平梯度值gx和垂直梯度值gy分别满足如下表达式(4)和表达式(5):Obtaining a horizontal gradient value gx and a vertical gradient value gy of the luminance value Z5 of the central pixel point of the first matrix data according to the expression (2) and the expression (3), respectively; the horizontal gradient value gx and the vertical gradient value Gy satisfies the following expression (4) and expression (5), respectively:
gx=(Z7+2×Z8+Z9)-(Z1+2×Z2+Z3)     (4) Gx=(Z7+2×Z8+Z9)-(Z1+2×Z2+Z3) (4)
gy=(Z3+2×Z6+Z9)-(Z1+2×Z4+Z7)     (5)Gy=(Z3+2×Z6+Z9)-(Z1+2×Z4+Z7) (5)
获得所述水平梯度值gx和垂直梯度值gy后,当所述水平梯度值gx的绝对值大于所述垂直梯度值gy的绝对值时,则将所述水平梯度值gx的绝对值作为所述中心像素点的第一梯度值g,即g=abs(gx);反之,当所述水平梯度值gx的绝对值小于所述垂直梯度值gy的绝对值时,将所述垂直梯度值gy的绝对值作为所述中心像素点的第一梯度值g,即g=abs(gy)。After obtaining the horizontal gradient value gx and the vertical gradient value gy, when the absolute value of the horizontal gradient value gx is greater than the absolute value of the vertical gradient value gy, the absolute value of the horizontal gradient value gx is taken as a first gradient value g of the central pixel, ie g=abs(gx); conversely, when the absolute value of the horizontal gradient value gx is smaller than the absolute value of the vertical gradient value gy, the vertical gradient value gy The absolute value is taken as the first gradient value g of the central pixel point, i.e., g = abs (gy).
在所述细节锐化处理方式中,由于亮度值的范围为(0~255),基于所述亮度值范围预先配置第一阈值T1、第二阈值T2和第三阈值T3,所述第一阈值T1、第二阈值T2和第三阈值T3均在所述亮度值范围(0~255)中;根据所述第一阈值T1、所述第二阈值T2和所述第三阈值T3将亮度范围划分为四个区间,分别为第一区间(0~T1)、第二区间(T1~T2)、第三区间(T2~T3)和第四区间(T3~255)。在本实施例中,仅针对所述第一梯度值g落入所述第二区间(T1~T2)的第一矩阵数据进行锐化处理;而当所述第一梯度值g落入所述第一区间(0~T1)和落入所述第三区间(T2~T3)的第一矩阵数据不进行图像处理;当所述第一梯度值g落入所述第四区间(T3~255)的第一矩阵数据做抗锯齿处理;所述抗锯齿处理与现有技术相同,这里不再赘述。其中,所述第一阈值T1、第二阈值T2和第三阈值T3的取值可根据具体情况或经验值预先配置;例如,所述第一阈值T1为32,所述第二阈值T2为96,所述第三阈值T3为128;相应的,当所述第一梯度值g落入(32~96)区间时,针对所述第一梯度值g所对应的第一矩阵数据进行锐化处理。In the detail sharpening processing mode, since the range of the luminance value is (0 to 255), the first threshold T1, the second threshold T2, and the third threshold T3 are pre-configured based on the luminance value range, the first threshold T1, the second threshold T2 and the third threshold T3 are all in the brightness value range (0-255); the brightness range is divided according to the first threshold T1, the second threshold T2 and the third threshold T3 The four sections are the first section (0 to T1), the second section (T1 to T2), the third section (T2 to T3), and the fourth section (T3 to 255). In this embodiment, the first matrix data falling into the second interval (T1 to T2) is sharpened only for the first gradient value g; and when the first gradient value g falls into the The first interval (0 to T1) and the first matrix data falling in the third interval (T2 to T3) are not subjected to image processing; when the first gradient value g falls within the fourth interval (T3 to 255) The first matrix data is subjected to anti-aliasing processing; the anti-aliasing processing is the same as the prior art, and details are not described herein again. The value of the first threshold T1, the second threshold T2, and the third threshold T3 may be pre-configured according to a specific situation or an empirical value; for example, the first threshold T1 is 32, and the second threshold T2 is 96. The third threshold T3 is 128. Correspondingly, when the first gradient value g falls within the interval (32-96), the first matrix data corresponding to the first gradient value g is sharpened. .
在所述边缘锐化处理方式中,同样基于亮度值的范围为(0~255)预先配置第四阈值T,所述第四阈值T在所述亮度值范围(0~255)中;根据所述第四阈值T将亮度范围划分为两个区间,分别为第五区间(0~T)和第六区间(T~255).本实施例中,仅针对所述第一梯度值g落入所述第六区间 (T~255)的第一矩阵数据进行锐化处理;而当所述第一梯度值g落入所述第五区间(0~T)的第一矩阵数据不进行图像处理;其中,所述第四阈值T的取值可根据具体情况或经验值预先配置;例如,所述第四阈值T为64,;相应的,当所述第一梯度值g落入(64~255)区间时,针对所述第一梯度值g所对应的第一矩阵数据进行锐化处理。In the edge sharpening processing mode, the fourth threshold T is also pre-configured based on the range of the luminance value (0 to 255), and the fourth threshold T is in the luminance value range (0 to 255); The fourth threshold T divides the luminance range into two intervals, which are a fifth interval (0 to T) and a sixth interval (T to 255). In this embodiment, only the first gradient value g falls. The sixth interval The first matrix data of (T ~ 255) is subjected to sharpening processing; and when the first gradient value g falls into the first matrix data of the fifth interval (0 to T), image processing is not performed; wherein The value of the fourth threshold T may be pre-configured according to a specific situation or an empirical value; for example, the fourth threshold T is 64, and correspondingly, when the first gradient value g falls within the interval of (64-255), Sharpening processing is performed on the first matrix data corresponding to the first gradient value g.
本实施例中,无论是所述细节锐化处理方式中对所述第一梯度值g落入所述第二区间(T1~T2)的第一矩阵数据进行锐化处理,还是所述边缘锐化处理方式中对所述第一梯度值g落入所述第六区间(T~255)的第一矩阵数据进行锐化处理,所进行的锐化处理方式均相同。其中,所述对所述第一矩阵数据进行锐化处理,包括:根据预先配置的第一拉普拉斯算子获取的所述第一矩阵数据的中心像素点的第二梯度值;In this embodiment, whether the first matrix value of the first gradient value g falls within the second interval (T1 to T2) is sharpened in the detail sharpening processing manner, or is the edge sharp In the processing method, the first matrix data in which the first gradient value g falls within the sixth interval (T to 255) is sharpened, and the sharpening processing performed is the same. The sharpening process of the first matrix data includes: a second gradient value of a central pixel point of the first matrix data acquired according to a preset first Laplacian operator;
基于所述第二梯度值按预设锐化方式获得所述中心像素点的锐化值;其中,所述预设锐化方式包括:对所述第二梯度值取绝对值后求平均获得第一参数;限制所述的第一参数的最大值获得第二参数;将所述第二参数与预设增强系数相乘获得所述中心像素点的锐化值;And obtaining, according to the second gradient value, a sharpening value of the central pixel point according to a preset sharpening manner; wherein the preset sharpening manner comprises: obtaining an absolute value of the second gradient value, and obtaining an average value a parameter; limiting a maximum value of the first parameter to obtain a second parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point;
当所述第二梯度值大于零时,将所述中心像素点的亮度值+所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果;When the second gradient value is greater than zero, the luminance value of the central pixel point + the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point;
当所述第二梯度值小于零时,将所述中心像素点的亮度值-所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果。When the second gradient value is less than zero, the luminance value of the central pixel point - the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point.
具体的,本实施例中所述拉普拉斯(Laplacian)算子可以预先配置多种;所述拉普拉斯(Laplacian)算子的表达式可如下所示:Specifically, the Laplacian operator in the embodiment may be pre-configured in plurality; the expression of the Laplacian operator may be as follows:
Figure PCTCN2015086910-appb-000003
Figure PCTCN2015086910-appb-000003
Figure PCTCN2015086910-appb-000004
Figure PCTCN2015086910-appb-000004
Figure PCTCN2015086910-appb-000005
Figure PCTCN2015086910-appb-000005
其中,表达式(6)所示的拉普拉斯(Laplacian)算子H1为传统的拉普拉斯(Laplacian)算子;表达式(7)和表达式(8)所示的拉普拉斯(Laplacian)算子为根据经验值变形后的拉普拉斯(Laplacian)算子。本实施例中,可根据所述图像数据的类型(如人脸或风景类型)或所述图像数据的属性参数预先选择合适的拉普拉斯(Laplacian)算子作为所述第一拉普拉斯算子。Wherein, the Laplacian operator H1 represented by the expression (6) is a conventional Laplacian operator; the Laplacian represented by the expression (7) and the expression (8) The Laplacian operator is a Laplacian operator transformed according to empirical values. In this embodiment, a suitable Laplacian operator may be pre-selected as the first Laplacian according to the type of the image data (such as a face or a landscape type) or an attribute parameter of the image data. Si operator.
以所述第一拉普拉斯算子为表达是(7)所示的H2为例,则根据所述第一拉普拉斯算子H2获取的所述第一矩阵数据的中心像素点的第二梯度值f0满足如下表达式:Taking the first Laplacian operator as an example of H2 represented by (7), the central pixel point of the first matrix data acquired according to the first Laplacian operator H2 The second gradient value f0 satisfies the following expression:
f0=-1×Z1-1×Z2-1×Z3-1×Z4+8×Z5-1×Z6-1×Z7-1×Z8-1×Z9 (9)F0=-1×Z1-1×Z2-1×Z3-1×Z4+8×Z5-1×Z6-1×Z7-1×Z8-1×Z9 (9)
根据所述第二梯度值f0按以下锐化方式获得所述中心像素点的锐化值f3:Obtaining a sharpening value f3 of the central pixel point according to the second gradient value f0 in the following sharpening manner:
步骤一:f1(Z5)=abs(f0(Z5))/8;Step 1: f1 (Z5) = abs (f0 (Z5)) / 8;
步骤二:f2(Z5)为限制f1(Z5)的值最大为32;Step 2: f2 (Z5) is the limit f1 (Z5) has a maximum value of 32;
步骤三:f3(Z5)=f2(Z5)×enhance_ratio/8;Step three: f3 (Z5) = f2 (Z5) × enhance_ratio / 8;
其中,步骤一为所述第二梯度值f0求取绝对值和平均后获得第一参数f1(Z5)。步骤二为对所述第一参数f1(Z5)进行限制最大值获得第二参数f2(Z5),以减少噪声对视频锐化结果的影响;其中,所述最大值可以为32,即对所述第一参数f1(Z5)进行限制的值最大为32。步骤三为对所述第二参数f2(Z5)进行修正获得锐化值f3(Z5);其中,所述enhance_ratio为增强系数,可预先对所述enhance_ratio进行配置,以达到自适应调整锐化强度的目的。Wherein, in step one, the absolute value and the average are obtained for the second gradient value f0 to obtain the first parameter f1 (Z5). Step 2 is to limit the maximum value of the first parameter f1 (Z5) to obtain a second parameter f2 (Z5) to reduce the influence of noise on the video sharpening result; wherein the maximum value may be 32, that is, The value of the first parameter f1 (Z5) is limited to a maximum of 32. Step 3 is to modify the second parameter f2 (Z5) to obtain a sharpening value f3 (Z5); wherein the enhancement_ratio is an enhancement coefficient, and the enhancement_ratio may be configured in advance to achieve adaptive adjustment sharpening strength the goal of.
进一步地,根据所述第二梯度值f0的属性,对所述中心像素点的亮度值进行锐化处理。当所述第二梯度值f0为正数时,所述中心像素点的亮度值Z5的锐化结果为f4(Z5)=Z5+f3(Z5);相应的,当所述第二梯度值f0为 非正数时,所述中心像素点的亮度值Z5的锐化结果为f4(Z5)=Z5-f3(Z5)。Further, the brightness value of the central pixel point is sharpened according to the attribute of the second gradient value f0. When the second gradient value f0 is a positive number, the sharpening result of the luminance value Z5 of the central pixel point is f4(Z5)=Z5+f3(Z5); correspondingly, when the second gradient value f0 For In the case of a non-positive number, the sharpening result of the luminance value Z5 of the central pixel point is f4 (Z5) = Z5 - f3 (Z5).
最后,获得所述中心像素点的亮度值的锐化结果后,所述方法还包括:限制所述中心像素点的亮度值的锐化结果的输出位宽。即采用(0~255)作为门限对所述中心像素点的亮度值的锐化结果f4(Z5)进行控制,得到最终的输出结果。Finally, after obtaining a sharpening result of the brightness value of the central pixel point, the method further comprises: limiting an output bit width of the sharpening result of the brightness value of the central pixel point. That is, (0 to 255) is used as a threshold to control the sharpening result f4 (Z5) of the luminance value of the central pixel point, and the final output result is obtained.
本实施例中,当所述图像数据为按缩小处理方式处理后的图像数据时,按平滑处理方式处理所述图像数据。其中,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵图像数据,包括:从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点以组成第一矩阵数据;In this embodiment, when the image data is image data processed in a reduction processing manner, the image data is processed in a smoothing processing manner. The sequentially acquiring pixel points of a preset size in the image data to form matrix image data and processing the matrix image data in a smoothing manner includes: sequentially acquiring the image from a starting position of the image data. 3 × 3 pixels in the data to form the first matrix data;
根据预先配置的第二拉普拉斯算子和平滑强度参数获得所述第一矩阵数据的平滑结果。A smoothing result of the first matrix data is obtained according to a pre-configured second Laplacian and a smoothing intensity parameter.
具体的,依然以图2所示的第一矩阵数据为例,如图2所示,其中Z1、Z2至Z9表示其中各像素点的亮度值。所述Z1、Z2至Z9所对应的像素点可以是所述图像数据中任一3×3的像素矩阵,如所述第一矩阵数据为所述图像数据中第一行第一列至第三行第三列像素点组成的矩阵数据。Specifically, the first matrix data shown in FIG. 2 is still taken as an example, as shown in FIG. 2, wherein Z1, Z2 to Z9 represent luminance values of respective pixel points. The pixel points corresponding to the Z1, Z2 to Z9 may be any 3×3 pixel matrix in the image data, and the first matrix data is the first row to the third row in the image data. The matrix data consisting of the third column of pixels.
本发明实施例所述的平滑处理方式是针对全局进行平滑处理。所采用的拉普拉斯(Laplacian)算子可以预先配置多种;所述拉普拉斯(Laplacian)算子的表达式可如下所示:The smoothing processing method described in the embodiment of the present invention is to perform smoothing processing globally. The Laplacian operator employed can be pre-configured in plurality; the expression of the Laplacian operator can be as follows:
Figure PCTCN2015086910-appb-000006
Figure PCTCN2015086910-appb-000006
Figure PCTCN2015086910-appb-000007
Figure PCTCN2015086910-appb-000007
Figure PCTCN2015086910-appb-000008
Figure PCTCN2015086910-appb-000008
本实施例中,可根据所述图像数据的类型(如人脸或风景类型)或所述图像数据的属性参数预先选择合适的拉普拉斯(Laplacian)算子作为所述第二拉普拉斯算子。In this embodiment, a suitable Laplacian operator may be pre-selected as the second Laplacian according to the type of the image data (such as a face or a landscape type) or an attribute parameter of the image data. Si operator.
确定好所述第二拉普拉斯算子后,基于所述第二拉普拉斯算子获得所述第一矩阵数据的平滑结果S;当所述第二拉普拉斯算子为表达式(10)所示时,所述平滑结果S1为:After determining the second Laplacian, obtaining a smoothing result S of the first matrix data based on the second Laplacian; when the second Laplacian is an expression When the equation (10) is shown, the smoothing result S1 is:
S1=(Z5×(256-h)×2+Z2×h+Z8×h)/512     (13)S1=(Z5×(256-h)×2+Z2×h+Z8×h)/512 (13)
当所述第二拉普拉斯算子为表达式(11)所示时,所述平滑结果S2为:When the second Laplacian is represented by the expression (11), the smoothing result S2 is:
S2=(Z5×(256-h)×4+Z2×h+Z4×h+Z6×h+Z8×h)/1024     (14)S2=(Z5×(256-h)×4+Z2×h+Z4×h+Z6×h+Z8×h)/1024 (14)
当所述第二拉普拉斯算子为表达式(11)所示时,所述平滑结果S3为:When the second Laplacian is represented by the expression (11), the smoothing result S3 is:
S3=(Z5×(256-h)×8+Z1×h+Z2×h+Z3×h+Z4×h+Z6×h+Z7×h+Z8×h+Z9×h)/2048     (15)S3=(Z5×(256-h)×8+Z1×h+Z2×h+Z3×h+Z4×h+Z6×h+Z7×h+Z8×h+Z9×h)/2048 (15)
其中,h为平滑强度,所述平滑强度h的范围为(0~127)中的任一整数,可预先配置所述平滑强度h的数值。Here, h is a smoothing intensity, and the range of the smoothing intensity h is any one of (0 to 127), and the value of the smoothing intensity h can be pre-configured.
最后,获得所述中心像素点的亮度值的平滑结果后,所述方法还包括:限制所述中心像素点的亮度值的平滑结果的输出位宽。即采用(0~255)作为门限对所述中心像素点的亮度值的平滑结果S进行控制,得到最终的输出结果。Finally, after obtaining a smoothing result of the brightness value of the central pixel point, the method further comprises: limiting an output bit width of the smoothing result of the brightness value of the central pixel point. That is, the smoothing result S of the luminance value of the central pixel point is controlled by using (0 to 255) as a threshold to obtain a final output result.
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行本发明实施例所述的图像处理方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the image processing method according to the embodiment of the invention.
本发明实施例还提供了一种图像处理装置。图3为本发明实施例的图像处理装置的组成结构示意图;如图3所示,所述装置包括:获取单元31 和图像增强单元32;其中,An embodiment of the present invention further provides an image processing apparatus. FIG. 3 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention; as shown in FIG. 3, the apparatus includes: an acquiring unit 31 And an image enhancement unit 32; wherein
所述获取单元31,配置为获取图像数据;所述图像数据为按预设缩放处理方式处理后的图像数据;The acquiring unit 31 is configured to acquire image data; the image data is image data processed according to a preset scaling processing manner;
所述图像增强单元32,配置为确定所述获取单元31获取的所述图像数据满足预设条件时,依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据;所述第一处理方式为细节锐化处理方式、边缘锐化处理方式或平滑处理方式。The image enhancement unit 32 is configured to, when determining that the image data acquired by the acquiring unit 31 meets a preset condition, sequentially acquire pixel image data of a preset size in the image data to form matrix image data, and according to the first processing manner Processing the matrix image data; the first processing mode is a detail sharpening processing manner, an edge sharpening processing manner, or a smooth processing manner.
这里,所述图像增强单元32包括第一图像增强单元321,配置为当所述图像数据为按三次差值放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据;Here, the image enhancement unit 32 includes a first image enhancement unit 321 configured to determine that the image data satisfies a preset condition when the image data is image data processed in a three-time difference amplification processing manner; Forming matrix image data by sequentially acquiring pixels of a preset size in the image data and processing the matrix image data according to a detail sharpening processing manner;
和/或,所述图像增强单元32还包括第二图像增强单元322,配置为当所述图像数据为按B样条放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据;And/or, the image enhancement unit 32 further includes a second image enhancement unit 322 configured to determine that the image data meets a preset condition when the image data is image data processed in a B-spline enlargement processing manner. And configured to sequentially acquire pixel points of a preset size in the image data to form matrix image data, and process the matrix image data according to an edge sharpening processing manner;
和/或,所述图像增强单元32还包括第三图像增强单元323,配置为当所述图像数据为按缩小处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵图像数据。And/or, the image enhancement unit 32 further includes a third image enhancement unit 323 configured to determine that the image data meets a preset condition when the image data is image data processed in a reduction processing manner; The matrix image data is composed of pixel pixels of a preset size in the image data, and the matrix image data is processed in a smoothing manner.
在第一种实施方式中,即当所述图像数据为按三次差值放大处理方式处理后的图像数据时,所述第一图像增强单元321,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;预先配置第一阈值、第二阈值和第三阈值,根据所述第一阈值、所述第二阈值和所述第三阈值将亮度范围划分为四个区间;其中,所述第 一阈值、所述第二阈值和所述第三阈值均大于0小于255;确定所述中心像素点的第一梯度值在所述第一阈值和所述第二阈值组成的第二区间中时,对所述第一矩阵数据进行锐化处理。In the first embodiment, that is, when the image data is image data processed in a three-time difference amplification processing manner, the first image enhancement unit 321 is configured to start from the start position of the image data. And sequentially acquiring the luminance values of the 3×3 pixel points in the image data to form the first matrix data; obtaining the first gradient value of the central pixel point of the first matrix data according to the Sobel operator; preconfiguring the first threshold value a second threshold and a third threshold, dividing the luminance range into four intervals according to the first threshold, the second threshold, and the third threshold; wherein, the a threshold, the second threshold, and the third threshold are both greater than 0 and less than 255; determining that the first gradient value of the central pixel is in the second interval of the first threshold and the second threshold And sharpening the first matrix data.
具体的,所述第一图像增强单元321,配置为根据预先配置的第一拉普拉斯算子获取的所述第一矩阵数据的中心像素点的第二梯度值;基于所述第二梯度值按预设锐化方式获得所述中心像素点的锐化值;其中,所述预设锐化方式包括:对所述第二梯度值取绝对值后求平均获得第一参数;限制所述的第一参数的最大值获得第二参数;将所述第二参数与预设增强系数相乘获得所述中心像素点的锐化值;当所述第二梯度值大于零时,将所述中心像素点的亮度值+所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果;当所述第二梯度值小于零时,将所述中心像素点的亮度值-所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果。Specifically, the first image enhancement unit 321 is configured to generate a second gradient value of a central pixel point of the first matrix data acquired according to a preset first Laplacian operator; based on the second gradient Obtaining a sharpening value of the central pixel in a preset sharpening manner; wherein the presetting sharpening manner comprises: obtaining an absolute value of the second gradient value and averaging to obtain a first parameter; Obtaining a maximum value of the first parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point; when the second gradient value is greater than zero, a luminance value of a central pixel point + a sharpening value of the central pixel point as a sharpening result of a luminance value of the central pixel point; and when the second gradient value is less than zero, a luminance value of the central pixel point The sharpening value of the central pixel point is a sharpening result of the luminance value of the central pixel point.
在第二种实施方式中,即当所述图像数据为按B样条放大处理方式处理后的图像数据时,所述第二图像增强单元322,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;预先配置第四阈值,根据所述第四阈值将亮度范围划分为两个区间;其中,所述第四阈值大于0小于255;确定所述中心像素点的第一梯度值在所述第四阈值与255组成的区间中时,对所述第一矩阵数据进行锐化处理。In the second embodiment, that is, when the image data is image data processed by the B-spline enlargement processing, the second image enhancement unit 322 is configured to start from the start position of the image data. And sequentially acquiring luminance values of 3×3 pixels in the image data to form first matrix data; obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator; and configuring a fourth threshold in advance And dividing, according to the fourth threshold, the luminance range into two intervals; wherein the fourth threshold is greater than 0 and less than 255; determining that the first gradient value of the central pixel is in the interval between the fourth threshold and 255 In the middle, the first matrix data is sharpened.
具体的,所述第二图像增强单元322,配置为根据预先配置的第一拉普拉斯算子获取的所述第一矩阵数据的中心像素点的第二梯度值;基于所述第二梯度值按预设锐化方式获得所述中心像素点的锐化值;其中,所述预设锐化方式包括:对所述第二梯度值取绝对值后求平均获得第一参数;限制所述的第一参数的最大值获得第二参数;将所述第二参数与预设增强系数相乘获得所述中心像素点的锐化值;当所述第二梯度值大于零时,将所 述中心像素点的亮度值+所述中心像素点的锐化值作为所述亮度像素点的锐化结果;当所述第二梯度值小于零时,将所述中心像素点的亮度值-所述中心像素点的锐化值作为所述当亮度素点的锐化结果。Specifically, the second image enhancement unit 322 is configured to acquire a second gradient value of a central pixel point of the first matrix data acquired according to a preset first Laplacian operator; based on the second gradient Obtaining a sharpening value of the central pixel in a preset sharpening manner; wherein the presetting sharpening manner comprises: obtaining an absolute value of the second gradient value and averaging to obtain a first parameter; Obtaining a second parameter as a maximum value of the first parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point; when the second gradient value is greater than zero, a luminance value of the central pixel + a sharpening value of the central pixel as a sharpening result of the luminance pixel; and when the second gradient is less than zero, a luminance value of the central pixel The sharpening value of the center pixel is used as the result of the sharpening of the brightness point.
在第三种实施方式中,即当所述图像数据为按缩小处理方式处理后的图像数据时,所述第三图像增强单元323,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点以组成第一矩阵数据;根据预先配置的第二拉普拉斯算子和平滑强度参数获得所述第一矩阵数据的平滑结果。In a third embodiment, that is, when the image data is image data processed in a reduction processing manner, the third image enhancement unit 323 is configured to sequentially acquire the image data from the start position of the image data. 3×3 pixel points in the image data are formed to constitute first matrix data; and a smoothing result of the first matrix data is obtained according to a pre-configured second Laplacian and a smoothing intensity parameter.
在本实施例所述的图像处理装置中,包括所述第一图像增强单元321、所述第二图像增强单元322以及所述第三图像增强单元323中的至少一个,即所述图像处理装置中可包括所述第一图像增强单元321、所述第二图像增强单元322或所述第三图像增强单元323,也可以包括所述第一图像增强单元321、所述第二图像增强单元322以及所述第三图像增强单元323,还可以包括所述第一图像增强单元321、所述第二图像增强单元322以及所述第三图像增强单元323中任意两个组合。In the image processing apparatus according to the embodiment, at least one of the first image enhancement unit 321, the second image enhancement unit 322, and the third image enhancement unit 323, that is, the image processing device The first image enhancement unit 321 , the second image enhancement unit 322 or the third image enhancement unit 323 may be included, and may further include the first image enhancement unit 321 and the second image enhancement unit 322 . And the third image enhancement unit 323 may further include any two combinations of the first image enhancement unit 321, the second image enhancement unit 322, and the third image enhancement unit 323.
本领域技术人员应当理解,本发明实施例的图像处理装置中各处理单元的功能,可参照前述图像处理方法的相关描述而理解,本发明实施例的图像处理装置中各处理单元,可通过实现本发明实施例所述的功能的模拟电路而实现,也可以通过执行本发明实施例所述的功能的软件在智能终端上的运行而实现。It should be understood by those skilled in the art that the functions of the processing units in the image processing apparatus of the embodiments of the present invention can be understood by referring to the related description of the image processing method, and the processing units in the image processing apparatus according to the embodiments of the present invention can be implemented. The function of the analog circuit of the embodiment of the present invention can be implemented by using the software of the function described in the embodiment of the present invention on the smart terminal.
本实施例中,所述获取单元31和图像增强单元中的第一图像增强单元321、第二图像增强单元322以及第三图像增强单元323在实际应用中,均可由所述图像处理装置中的中央处理器(CPU,Central Processing Unit)、数字信号处理器(DSP,Digital Signal Processor)或可编程门阵列(FPGA,Field-Programmable Gate Array)实现。 In this embodiment, the first image enhancement unit 321 , the second image enhancement unit 322 , and the third image enhancement unit 323 in the acquisition unit 31 and the image enhancement unit may be used by the image processing apparatus in an actual application. Realized by a central processing unit (CPU), a digital signal processor (DSP), or a Field-Programmable Gate Array (FPGA).
图4为本发明实施例的图像处理系统的组成结构示意图;如图4所示,所述图像处理系统包括:增强模块41、寄存器配置模块42和配置同步模块43;其中,所述增强模块41包括图3所示的本发明实施例所述的图像处理装置;4 is a schematic structural diagram of an image processing system according to an embodiment of the present invention; as shown in FIG. 4, the image processing system includes: an enhancement module 41, a register configuration module 42 and a configuration synchronization module 43; wherein the enhancement module 41 An image processing apparatus according to an embodiment of the present invention shown in FIG. 3 is included;
所述寄存器配置模块42,配置为配置所述增强模块41中需要的参数;The register configuration module 42 is configured to configure parameters required in the enhancement module 41;
所述配置同步模块43,配置为将所述寄存器配置模块42配置的参数同步至所述增强模块41。The configuration synchronization module 43 is configured to synchronize parameters configured by the register configuration module 42 to the enhancement module 41.
具体的,所述增强模块41包括:输入模块411、第一行缓存模块412、第二行缓存模块413、reg寄存器、读缓存模块414、逻辑增强模块415和输出模块416;其中,Specifically, the enhancement module 41 includes: an input module 411, a first row cache module 412, a second row cache module 413, a reg register, a read cache module 414, a logic enhancement module 415, and an output module 416;
所述输入模块411,配置为接收图像数据,分别将所述图像数据的第N行和第N+1行输入至所述第一行缓存模块412和所述第二行缓存模块413中;其中,在所述图像数据的第N行输入完成后,再对所述图像数据的第N+1行进行输入;The input module 411 is configured to receive image data, and input the Nth row and the N+1th row of the image data into the first row buffer module 412 and the second row cache module 413, respectively; After the input of the Nth row of the image data is completed, input the N+1th row of the image data;
所述读缓存模块414,配置为当所述图像数据的第N行输入至所述第一行缓存模块412完成且所述图像数据的第N+1行数据开始输入至所述第二行缓存模块413中时,从所述第一行缓存模块412中读取预设大小的图像数据;当所述图像数据的第N+1行输入至所述第二行缓存模块413完成且所述图像数据的第N+2行数据开始输入至所述第一行缓存模块412中时,从所述第二行缓存模块413中读取所述预设大小的图像数据;其中,当所述图像数据的第N+2行数据开始输入至所述第一行缓存模块412中时,所述图像数据的第N行数据中预设数量的图像数据输入至所述reg寄存器中;还配置为根据所述第一行缓存模块412中读取的预设大小的图像数据、从所述第二行缓存模块413中读取所述预设大小的图像数据以及所述reg寄存器中的所述预设数量的图像数据生成矩阵数据;其中,N为整数; The read cache module 414 is configured to complete when the Nth row of the image data is input to the first row buffer module 412 and the N+1th row data of the image data is input to the second row cache In the module 413, the image data of the preset size is read from the first line buffer module 412; when the N+1th line of the image data is input to the second line buffer module 413 and the image is completed When the N+2th row data of the data is input into the first row buffer module 412, the preset size image data is read from the second row buffer module 413; wherein, when the image data When the N+2th row data is input into the first row buffer module 412, a preset number of image data in the Nth row data of the image data is input into the reg register; Decoding the preset size image data read in the first line buffer module 412, reading the preset size image data from the second line buffer module 413, and the preset number in the reg register Image data generates matrix data; wherein N is an integer;
所述逻辑增强模块415,配置为对所述读缓存模块414中的矩阵数据进行增强处理;所述增强处理包括锐化处理和平滑处理;The logic enhancement module 415 is configured to perform enhancement processing on matrix data in the read cache module 414; the enhancement processing includes a sharpening process and a smoothing process;
所述输出模块416,配置为输出所述逻辑增强模块处理后的矩阵数据。The output module 416 is configured to output matrix data processed by the logic enhancement module.
在本实施例中针对的图像数据为YUV数据,YUV和RGB是不同的色彩空间,配置为表示颜色;所述YUV数据可以于优化图像信号的传输,只需占用极少的带宽(RGB要求三个独立的视频信号同时传输);其中,Y表示明亮度(Luminance或Luma),也就是亮度值;而U和V表示的是色度(Chrominance或Chroma),描述影像色彩及饱和度,配置为指定像素的颜色。在本实施例中,所述第一行缓存模块412和所述第二行缓存模块413配置为缓存所述YUV数据中的Y分量,而图4所示的第三行缓存模块和第四行缓存模块分别配置为缓存所述YUV数据中的U分量和V分量;由于所述YUV数据中的U分量和V分量不是本发明实施例要保护的内容,这里不做具体说明。The image data for the present embodiment is YUV data, YUV and RGB are different color spaces, and are configured to represent colors; the YUV data can optimize the transmission of image signals, requiring only a small amount of bandwidth (RGB requirement three) Independent video signals are transmitted simultaneously; where Y is the brightness (Luminance or Luma), which is the luminance value; and U and V are the chrominance (Chrominance or Chroma), describing the image color and saturation, configured as Specifies the color of the pixel. In this embodiment, the first line buffer module 412 and the second line buffer module 413 are configured to buffer the Y component in the YUV data, and the third line cache module and the fourth line shown in FIG. The cache module is configured to buffer the U component and the V component in the YUV data. The U component and the V component in the YUV data are not protected by the embodiment of the present invention, and are not specifically described herein.
其中,本发明实施例中所述的reg寄存器在图4中并未体现,所述reg寄存器仅配置为缓存两个像素的Y分量,容量较小。The reg register described in the embodiment of the present invention is not shown in FIG. 4, and the reg register is only configured to buffer the Y component of two pixels, and the capacity is small.
具体的,所述寄存器配置模块42所配置的参数包括:视频分辨率寄存器(resolution_reg)、视频格式寄存器(format_reg)(所述视频格式寄存器包括YUV444、YUV422以及YUV420等等)、锐化矩阵选择寄存器(sharp_matrix),平滑矩阵选择寄存器(smooth_matrix),增强强度系数寄存器(enhance_ratio)(enhance_ratio寄存器最高位为符号位,当符号位配置为0表征进行锐化处理操作,配置为1表征进行平滑处理操作)、边缘检测阈值寄存器(threshold_reg)、中断寄存器(int_reg)、清中断寄存器(clear_int_reg)以及模块使能寄存器(enable);上述寄存器的配置顺序为:最后配置使能寄存器(enable),其他寄存器的配置顺序没有特殊要求。Specifically, the parameters configured by the register configuration module 42 include: a video resolution register (resolution_reg), a video format register (format_reg) (the video format register includes YUV444, YUV422, and YUV420, etc.), and a sharpening matrix selection register. (sharp_matrix), smoothing matrix selection register (smooth_matrix), enhanced intensity coefficient register (enhance_ratio) (the highest bit of the enumeration_ratio register is the sign bit, when the sign bit is configured to 0 for the sharpening operation, and the configuration is 1 for the smoothing operation) The edge detection threshold register (threshold_reg), the interrupt register (int_reg), the clear interrupt register (clear_int_reg), and the module enable register (enable); the configuration order of the above registers is: the last configuration enable register (enable), the configuration of other registers There are no special requirements for the order.
根据选择的模式进行数据处理。在模块开启之后(即将enable寄存器 置为高电平),Y分量输入通道输入YUV数据的Y分量,U分量输入通道输入YUV数据的U分量,V分量输入通道输入YUV数据的V分量;Y分量输出通道输出处理后的YUV数据的Y分量,U分量输出通道输出处理后的YUV数据的U分量,V分量输出通道输出处理后的YUV数据的V分量。Data processing is performed according to the selected mode. After the module is turned on (ie, the enable register) Set to high level), Y component input channel input Y component of YUV data, U component input channel input U component of YUV data, V component input channel input V component of YUV data; Y component output channel output processed YUV data The Y component, the U component output channel outputs the U component of the processed YUV data, and the V component output channel outputs the V component of the processed YUV data.
当一帧数据处理完成之后,系统会发出int中断信号。如果系统仍需要处理数据,则需要将清中断寄存器置为高电平,清除int中断;重新配置相应的寄存器,进行下一帧数据的处理。如果无数据处理时,将int中断清除之后关闭系统(将enable寄存器配置为低电平)即可。When a frame of data processing is completed, the system will issue an int interrupt signal. If the system still needs to process data, you need to clear the interrupt register to high level, clear the int interrupt; reconfigure the corresponding register to process the next frame of data. If there is no data processing, turn off the system after clearing the int interrupt (configuring the enable register low).
结合图4所示的图像处理系统对本发明实施例的图像处理方法的数据流进行详细说明。图5(a)至图5(e)为本发明实施例的图像处理方法的数据流示意图,在本实施例中,以图像数据为4×4的输入视频源为例进行说明,所述输入视频源为YUV数据中的Y分量。The data flow of the image processing method of the embodiment of the present invention will be described in detail in conjunction with the image processing system shown in FIG. 5(a) to 5(e) are diagrams showing the data flow of the image processing method according to the embodiment of the present invention. In the embodiment, an input video source having image data of 4×4 is taken as an example for describing the input. The video source is the Y component in the YUV data.
图5(a)所示,增强模块开始将4×4的原始视频源中的第一行数据,输入到第一行缓存模块中;As shown in FIG. 5(a), the enhancement module starts to input the first row data of the 4×4 original video source into the first row cache module;
图5(b)所示,所述视频源中的第一行数据输入完成,且第二行第一个数据输入到第二行缓存模块中之后,伴随着后续视频数据的输入,第一行缓存模块中存储的第一行数据逐一输出(视频的输出数据要比输入延后行分辨率hor加1个像素的周期,即hor+1个周期);其中,第一行缓存模块中存储的第一行数据中的前两个像素的数据输入至reg存储器中;As shown in FIG. 5(b), the first line of data input in the video source is completed, and after the first line of the second line is input to the second line buffer module, the first line is accompanied by the input of the subsequent video data. The first row of data stored in the cache module is output one by one (the output data of the video is longer than the input delay line resolution hor plus 1 pixel period, ie hor+1 cycles); wherein the first row cache module stores The data of the first two pixels in the first row of data is input to the reg memory;
图5(c)所示,待第二行数据输入完成,从第一行缓存模块中输出第一行的第一个数据和第二个数据存入reg寄存器中,此时将第三行第一个数据和第二个数据分别输入到第一行缓存模块中的闲置位置;此时,基于目前输入的第一行和第二行的4个数据以及第三行的两个数据,能够组成一个3×3的矩阵块(缺边缘的一个像素点,可以为空),由于本发明实施例的图像处理方法是针对矩阵块中位于中间的像素点进行数据处理,因此即 时在缺少边缘的像素点的情况下依然能够针对位于中间的像素点进行图像强化;最后从行缓存模块中输出所述3×3的矩阵块至读缓存模块,再通过逻辑增强模块对所述3×3的矩阵块进行增强逻辑运算,输出计算结果;As shown in FIG. 5(c), after the second line of data input is completed, the first data of the first line and the second data are stored in the reg register from the first line buffer module, and the third line is A data and a second data are respectively input to the idle position in the first line cache module; at this time, based on the currently input of the first row and the second row of the four data and the third row of the two data, can be composed A 3×3 matrix block (one pixel of the missing edge may be empty), since the image processing method in the embodiment of the present invention performs data processing on the pixel located in the middle of the matrix block, At the same time, in the absence of the edge of the pixel, image enhancement can still be performed for the pixel located in the middle; finally, the 3×3 matrix block is output from the line buffer module to the read buffer module, and then the logic enhancement module is used to 3×3 matrix blocks perform enhanced logic operations and output calculation results;
图5(d)所示,待第三行数据输入完成,将第四行的数据输入到第二行缓存模块中,同时将第二行缓存模块存储的第二行数据中的前两个像素的数据输入至reg存储器中;进行类似于图5(c)所示的运算过程,计算出增强处理后的结果;As shown in FIG. 5(d), after the data input of the third row is completed, the data of the fourth row is input to the second row cache module, and the first two pixels of the second row of data stored by the second row cache module are simultaneously The data is input to the reg memory; an operation process similar to that shown in FIG. 5(c) is performed to calculate the result of the enhancement processing;
图5(e)所示,此时增强模块检测到已完成最后一行数据的输入,此时从行缓存模块中读出最后一行的数据,由于不能够组成3×3的矩阵块,因此不做任何处理过程。As shown in FIG. 5(e), at this time, the enhancement module detects that the input of the last row of data has been completed. At this time, the data of the last row is read from the row buffer module, and since it cannot form a matrix of 3×3, it does not do Any processing.
最后,在YUV数据中的Y分量计算完成之后,将与之对应的UV分量一起同步输出。Finally, after the Y component calculation in the YUV data is completed, the corresponding UV components are output together in synchronization.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。 The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
工业实用性Industrial applicability
本发明实施例通过对图像数据区域划分为预设大小的矩阵图像数据,从而实现了对视频中各区域进行有效划分从而针对特定区域进行增强处理,并且便于本发明实施例提供的图像处理方法的硬件流水实现。 In the embodiment of the present invention, the image data area is divided into the matrix image data of the preset size, thereby realizing the effective division of each area in the video to perform enhancement processing for the specific area, and facilitating the image processing method provided by the embodiment of the present invention. Hardware pipeline implementation.

Claims (15)

  1. 一种图像处理方法,所述方法包括:An image processing method, the method comprising:
    获取图像数据;所述图像数据为按预设缩放处理方式处理后的图像数据;Obtaining image data; the image data is image data processed according to a preset scaling processing manner;
    确定所述图像数据满足预设条件时,依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据;所述第一处理方式为细节锐化处理方式、边缘锐化处理方式或平滑处理方式。Determining, when the image data meets the preset condition, sequentially acquiring pixel points of a preset size in the image data to form matrix image data, and processing the matrix image data according to a first processing manner; Processing mode, edge sharpening processing or smooth processing.
  2. 根据权利要求1所述的方法,其中,所述确定所述图像数据满足预设条件,包括:当所述图像数据为按三次差值放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据;The method according to claim 1, wherein said determining said image data satisfies a preset condition comprises: determining said image data when said image data is image data processed in a three-time difference amplification processing manner The preset condition is met; correspondingly, the sequentially acquiring the pixel points of the preset size in the image data to form the matrix image data and processing the matrix image data according to the first processing manner includes: sequentially acquiring the image data in advance Setting pixel points of a size to form matrix image data and processing the matrix image data according to a detail sharpening processing manner;
    和/或,所述确定所述图像数据满足预设条件,包括:当所述图像数据为按B样条放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据;And determining that the image data meets the preset condition, the method includes: determining that the image data meets a preset condition when the image data is image data processed by the B-spline amplification processing manner; And sequentially acquiring the pixel points of the preset size in the image data to form matrix image data and processing the matrix image data according to the first processing manner, including: sequentially acquiring a matrix of pixel points of a preset size in the image data. Image data and processing the matrix image data in an edge sharpening process;
    和/或,所述确定所述图像数据满足预设条件,包括:当所述图像数据为按缩小处理方式处理后的图像数据时,确定所述图像数据满足预设条件;相应的,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据,包括:依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵 图像数据。And determining that the image data satisfies a preset condition, including: when the image data is image data processed in a reduction processing manner, determining that the image data meets a preset condition; correspondingly, the And sequentially acquiring the pixel data of the preset size in the image data to form the matrix image data, and processing the matrix image data according to the first processing manner, comprising: sequentially acquiring pixel points of the preset size in the image data to form matrix image data; Processing the matrix in a smoothing manner Image data.
  3. 根据权利要求2所述的方法,其中,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据,包括:从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;The method according to claim 2, wherein the sequentially acquiring pixel points of a preset size in the image data constitutes matrix image data and processing the matrix image data in a detail sharpening processing manner, including: from the image The starting position of the data starts to sequentially acquire the luminance values of the 3×3 pixel points in the image data to form the first matrix data;
    根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;Obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator;
    预先配置第一阈值、第二阈值和第三阈值,根据所述第一阈值、所述第二阈值和所述第三阈值将亮度范围划分为四个区间;其中,所述第一阈值、所述第二阈值和所述第三阈值均大于0小于255;Presetting a first threshold, a second threshold, and a third threshold, and dividing the luminance range into four intervals according to the first threshold, the second threshold, and the third threshold; wherein the first threshold, the The second threshold and the third threshold are both greater than 0 and less than 255;
    确定所述中心像素点的第一梯度值在所述第一阈值和所述第二阈值组成的第二区间中时,对所述第一矩阵数据进行锐化处理。Determining, when the first gradient value of the central pixel point is in the second interval composed of the first threshold and the second threshold, performing sharpening processing on the first matrix data.
  4. 根据权利要求2所述的方法,其中,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据,包括:从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;The method according to claim 2, wherein the sequentially acquiring pixels of a preset size in the image data to form matrix image data and processing the matrix image data in an edge sharpening processing manner comprises: The starting position of the data starts to sequentially acquire the luminance values of the 3×3 pixel points in the image data to form the first matrix data;
    根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;Obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator;
    预先配置第四阈值,根据所述第四阈值将亮度范围划分为两个区间;其中,所述第四阈值大于0小于255;Pre-configuring a fourth threshold, and dividing the luminance range into two intervals according to the fourth threshold; wherein the fourth threshold is greater than 0 and less than 255;
    确定所述中心像素点的第一梯度值在所述第四阈值与255组成的区间中时,对所述第一矩阵数据进行锐化处理。Determining, when the first gradient value of the central pixel point is in the interval formed by the fourth threshold and 255, performing sharpening processing on the first matrix data.
  5. 根据权利要求3或4所述的方法,其中,所述对所述第一矩阵数据进行锐化处理,包括:根据预先配置的第一拉普拉斯算子获取的所述第一矩阵数据的中心像素点的第二梯度值;The method according to claim 3 or 4, wherein the sharpening the first matrix data comprises: acquiring the first matrix data according to a pre-configured first Laplacian a second gradient value of the center pixel;
    基于所述第二梯度值按预设锐化方式获得所述中心像素点的锐化值;其中,所述预设锐化方式包括:对所述第二梯度值取绝对值后求平均获得 第一参数;限制所述的第一参数的最大值获得第二参数;将所述第二参数与预设增强系数相乘获得所述中心像素点的锐化值;Obtaining a sharpening value of the central pixel point according to the second gradient value in a preset sharpening manner; wherein the preset sharpening manner comprises: obtaining an absolute value of the second gradient value and obtaining an average value a first parameter; limiting a maximum value of the first parameter to obtain a second parameter; multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point;
    当所述第二梯度值大于零时,将所述中心像素点的亮度值+所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果;When the second gradient value is greater than zero, the luminance value of the central pixel point + the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point;
    当所述第二梯度值小于零时,将所述中心像素点的亮度值-所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果。When the second gradient value is less than zero, the luminance value of the central pixel point - the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point.
  6. 根据权利要求2所述的方法,其中,所述依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵图像数据,包括:从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点以组成第一矩阵数据;The method according to claim 2, wherein the sequentially acquiring pixel points of a preset size in the image data constitutes matrix image data and processing the matrix image data in a smoothing manner, including: from the image data Starting from the starting position, sequentially acquiring 3×3 pixel points in the image data to form first matrix data;
    根据预先配置的第二拉普拉斯算子和平滑强度参数获得所述第一矩阵数据的平滑结果。A smoothing result of the first matrix data is obtained according to a pre-configured second Laplacian and a smoothing intensity parameter.
  7. 一种图像处理装置,所述装置包括:获取单元和图像增强单元;其中,An image processing apparatus, the apparatus comprising: an acquisition unit and an image enhancement unit; wherein
    所述获取单元,配置为获取图像数据;所述图像数据为按预设缩放处理方式处理后的图像数据;The acquiring unit is configured to acquire image data; the image data is image data processed according to a preset scaling processing manner;
    所述图像增强单元,配置为确定所述获取单元获取的所述图像数据满足预设条件时,依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按第一处理方式处理所述矩阵图像数据;所述第一处理方式为细节锐化处理方式、边缘锐化处理方式或平滑处理方式。The image enhancement unit is configured to, when determining that the image data acquired by the acquiring unit meets a preset condition, sequentially acquire pixel image data of a preset size in the image data to form matrix image data, and process the processing according to the first processing manner. The matrix image data is described; the first processing mode is a detail sharpening processing mode, an edge sharpening processing mode, or a smoothing processing mode.
  8. 根据权利要求7所述的装置,其中,所述图像增强单元包括第一图像增强单元,配置为当所述图像数据为按三次差值放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按细节锐化处理方式处理所述矩阵图像数据; The apparatus according to claim 7, wherein said image enhancement unit comprises a first image enhancement unit configured to determine said image data when said image data is image data processed in a three-time difference amplification processing manner And satisfying a preset condition; further configured to sequentially acquire pixel points of a preset size in the image data to form matrix image data, and process the matrix image data according to a detail sharpening processing manner;
    和/或,所述图像增强单元还包括第二图像增强单元,配置为当所述图像数据为按B样条放大处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按边缘锐化处理方式处理所述矩阵图像数据;And/or, the image enhancement unit further includes a second image enhancement unit configured to determine that the image data meets a preset condition when the image data is image data processed in a B-spline enlargement processing manner; And configured to sequentially acquire pixel points of a preset size in the image data to form matrix image data, and process the matrix image data according to an edge sharpening processing manner;
    和/或,所述图像增强单元还包括第三图像增强单元,配置为当所述图像数据为按缩小处理方式处理后的图像数据时,确定所述图像数据满足预设条件;还配置为依次获取所述图像数据中预设大小的像素点组成矩阵图像数据并按平滑处理方式处理所述矩阵图像数据。And/or the image enhancement unit further includes a third image enhancement unit configured to determine that the image data satisfies a preset condition when the image data is image data processed in a reduction processing manner; Obtaining pixel points of a preset size in the image data to form matrix image data and processing the matrix image data in a smoothing manner.
  9. 根据权利要求8所述的装置,其中,所述第一图像增强单元,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;预先配置第一阈值、第二阈值和第三阈值,根据所述第一阈值、所述第二阈值和所述第三阈值将亮度范围划分为四个区间;其中,所述第一阈值、所述第二阈值和所述第三阈值均大于0小于255;确定所述中心像素点的第一梯度值在所述第一阈值和所述第二阈值组成的第二区间中时,对所述第一矩阵数据进行锐化处理。The apparatus according to claim 8, wherein the first image enhancement unit is configured to sequentially acquire luminance values of 3 × 3 pixel points in the image data from a starting position of the image data to constitute a first a matrix data; obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator; preconfiguring a first threshold, a second threshold, and a third threshold, according to the first threshold, the first The second threshold and the third threshold divide the luminance range into four intervals; wherein the first threshold, the second threshold, and the third threshold are both greater than 0 and less than 255; determining the number of the central pixel A gradient value is sharpened by the first matrix data in a second interval composed of the first threshold and the second threshold.
  10. 根据权利要求9所述的装置,其中,所述第二图像增强单元,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点的亮度值以组成第一矩阵数据;根据索贝尔算子获得所述第一矩阵数据的中心像素点的第一梯度值;预先配置第四阈值,根据所述第四阈值将亮度范围划分为两个区间;其中,所述第四阈值大于0小于255;确定所述中心像素点的第一梯度值在所述第四阈值与255组成的区间中时,对所述第一矩阵数据进行锐化处理。The apparatus according to claim 9, wherein the second image enhancement unit is configured to sequentially acquire luminance values of 3 × 3 pixel points in the image data from a starting position of the image data to constitute a first a matrix data; obtaining a first gradient value of a central pixel point of the first matrix data according to a Sobel operator; preconfiging a fourth threshold, and dividing the luminance range into two intervals according to the fourth threshold; The fourth threshold is greater than 0 and less than 255; and the first gradient value of the central pixel is determined to be sharpened in the interval formed by the fourth threshold and 255.
  11. 根据权利要求9或10所述的装置,其中,所述第一图像增强单元和所述第二图像增强单元,均配置为根据预先配置的第一拉普拉斯算子获 取的所述第一矩阵数据的中心像素点的第二梯度值;基于所述第二梯度值按预设锐化方式获得所述中心像素点的锐化值;其中,所述预设锐化方式包括:对所述第二梯度值取绝对值后求平均获得第一参数;限制所述的第一参数的最大值获得第二参数;将所述第二参数与预设增强系数相乘获得所述中心像素点的锐化值;当所述第二梯度值大于零时,将所述中心像素点的亮度值+所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果;当所述第二梯度值小于零时,将所述中心像素点的亮度值-所述中心像素点的锐化值作为所述中心像素点的亮度值的锐化结果。The apparatus according to claim 9 or 10, wherein the first image enhancement unit and the second image enhancement unit are each configured to be obtained according to a pre-configured first Laplacian And taking a second gradient value of the central pixel point of the first matrix data; obtaining a sharpening value of the central pixel point according to the second gradient value according to a preset sharpening manner; wherein the preset sharpening The method includes: averaging the second gradient value to obtain a first parameter; limiting a maximum value of the first parameter to obtain a second parameter; and multiplying the second parameter by a preset enhancement coefficient to obtain a sharpening value of the central pixel point; when the second gradient value is greater than zero, a luminance value of the central pixel point + a sharpening value of the central pixel point is used as a luminance value of the central pixel point Sharpening the result; when the second gradient value is less than zero, the luminance value of the central pixel point - the sharpening value of the central pixel point is used as a sharpening result of the luminance value of the central pixel point.
  12. 根据权利要求8所述的装置,其中,所述第三图像增强单元,配置为从所述图像数据的起始位置开始依次获取所述图像数据中3×3的像素点以组成第一矩阵数据;根据预先配置的第二拉普拉斯算子和平滑强度参数获得所述第一矩阵数据的平滑结果。The apparatus according to claim 8, wherein said third image enhancement unit is configured to sequentially acquire 3 × 3 pixel points in said image data from said start position of said image data to constitute first matrix data And obtaining a smoothed result of the first matrix data according to a pre-configured second Laplacian and a smoothing intensity parameter.
  13. 一种图像处理系统,所述图像处理系统包括:增强模块、寄存器配置模块和配置同步模块;其中,所述增强模块包括权利要求7至12任一项所述的图像处理装置;An image processing system, comprising: an enhancement module, a register configuration module, and a configuration synchronization module; wherein the enhancement module comprises the image processing device according to any one of claims 7 to 12;
    所述寄存器配置模块,配置为配置所述增强模块中需要的参数;The register configuration module is configured to configure parameters required in the enhancement module;
    所述配置同步模块,配置为将所述寄存器配置模块配置的参数同步至所述增强模块。The configuration synchronization module is configured to synchronize parameters of the register configuration module configuration to the enhancement module.
  14. 根据权利要求13所述的图像处理系统,其中,所述增强模块包括:输入模块、第一行缓存模块、第二行缓存模块、reg寄存器、读缓存模块、逻辑增强模块和输出模块;其中,The image processing system according to claim 13, wherein the enhancement module comprises: an input module, a first line buffer module, a second line buffer module, a reg register, a read cache module, a logic enhancement module, and an output module;
    所述输入模块,配置为接收图像数据,分别将所述图像数据的第N行和第N+1行输入至所述第一行缓存模块和所述第二行缓存模块中;其中,在所述图像数据的第N行输入完成后,再对所述图像数据的第N+1行进行输入; The input module is configured to receive image data, and input an Nth row and an N+1th row of the image data into the first row cache module and the second row cache module, respectively; After the input of the Nth line of the image data is completed, input the N+1th line of the image data;
    所述读缓存模块,配置为当所述图像数据的第N行输入至所述第一行缓存模块完成且所述图像数据的第N+1行数据开始输入至所述第二行缓存模块中时,从所述第一行缓存模块中读取预设大小的图像数据;当所述图像数据的第N+1行输入至所述第二行缓存模块完成且所述图像数据的第N+2行数据开始输入至所述第一行缓存模块中时,从所述第二行缓存模块中读取所述预设大小的图像数据;其中,当所述图像数据的第N+2行数据开始输入至所述第一行缓存模块中时,所述图像数据的第N行数据中预设数量的图像数据输入至所述reg寄存器中;还配置为根据所述第一行缓存模块中读取的预设大小的图像数据、从所述第二行缓存模块中读取所述预设大小的图像数据以及所述reg寄存器中的所述预设数量的图像数据生成矩阵数据;其中,N为整数;The read cache module is configured to be configured when the Nth row of the image data is input to the first row cache module and the N+1th row data of the image data is input into the second row cache module Reading the image data of the preset size from the first line buffer module; when the N+1th line of the image data is input to the second line buffer module and the N+ of the image data When the two lines of data are input into the first line buffer module, the preset size image data is read from the second line buffer module; wherein, when the N+2 line data of the image data is When inputting into the first line buffer module, a preset amount of image data in the Nth row of data of the image data is input into the reg register; and is further configured to read according to the first line cache module And taking the preset size image data, reading the preset size image data from the second line buffer module, and the preset number of image data in the reg register to generate matrix data; wherein, N Is an integer;
    所述逻辑增强模块,配置为对所述度缓存模块中的矩阵数据进行增强处理;所述增强处理包括锐化处理和平滑处理;The logic enhancement module is configured to perform enhancement processing on matrix data in the degree cache module; the enhancement processing includes a sharpening process and a smoothing process;
    所述输出模块,配置为输出所述逻辑增强模块处理后的矩阵数据。The output module is configured to output matrix data processed by the logic enhancement module.
  15. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至6任一项所述的图像处理方法。 A computer storage medium having stored therein computer executable instructions for performing the image processing method of any one of claims 1 to 6.
PCT/CN2015/086910 2014-12-15 2015-08-14 Image processing method, device, system and computer storage medium WO2016095541A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410778033.9 2014-12-15
CN201410778033.9A CN105763768B (en) 2014-12-15 2014-12-15 Image processing method, device and system

Publications (1)

Publication Number Publication Date
WO2016095541A1 true WO2016095541A1 (en) 2016-06-23

Family

ID=56125835

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/086910 WO2016095541A1 (en) 2014-12-15 2015-08-14 Image processing method, device, system and computer storage medium

Country Status (2)

Country Link
CN (1) CN105763768B (en)
WO (1) WO2016095541A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108475416A (en) * 2017-06-30 2018-08-31 深圳市大疆创新科技有限公司 The method and apparatus for handling image
CN111145114A (en) * 2019-12-19 2020-05-12 腾讯科技(深圳)有限公司 Image enhancement method and device and computer readable storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106851147B (en) * 2017-02-15 2019-09-20 上海顺久电子科技有限公司 The method and device in OSD menu region is determined in the terminal for playing external video
TWI638336B (en) * 2017-11-22 2018-10-11 瑞昱半導體股份有限公司 Image enhancement method and image enhancement apparatus
CN109447090B (en) * 2018-10-17 2021-12-03 宁波中车时代传感技术有限公司 Shield door obstacle detection method and system
CN113256534B (en) * 2021-06-16 2022-01-07 湖南兴芯微电子科技有限公司 Image enhancement method, device and medium
CN114627030B (en) * 2022-05-13 2022-09-20 深圳深知未来智能有限公司 Self-adaptive image sharpening method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020140854A1 (en) * 2001-03-30 2002-10-03 Koninklijke Philips Electronics N.V. Scalable resolution enhancement of a video image
CN1735135A (en) * 2004-08-12 2006-02-15 三星电子株式会社 Resolution-converting apparatus and method
CN1940994A (en) * 2005-09-27 2007-04-04 夏普株式会社 Defect detecting device, image sensor device, and image sensor module
CN102547067A (en) * 2011-12-31 2012-07-04 中山大学 Improved bicubic interpolation video scaling method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8442344B2 (en) * 2006-08-07 2013-05-14 Qualcomm Incorporated Adaptive spatial image filter for filtering image information
CN101576996B (en) * 2009-06-05 2012-04-25 腾讯科技(深圳)有限公司 Processing method and device for realizing image zooming

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020140854A1 (en) * 2001-03-30 2002-10-03 Koninklijke Philips Electronics N.V. Scalable resolution enhancement of a video image
CN1735135A (en) * 2004-08-12 2006-02-15 三星电子株式会社 Resolution-converting apparatus and method
CN1940994A (en) * 2005-09-27 2007-04-04 夏普株式会社 Defect detecting device, image sensor device, and image sensor module
CN102547067A (en) * 2011-12-31 2012-07-04 中山大学 Improved bicubic interpolation video scaling method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HAO, BINBIN ET AL.: "Acta Photonica Sinica", IMAGE ZOOMING BASED ON WAVELET AND MATRIX-VALUED DIFFUSION EQUATION, vol. 37, no. 11, 30 November 2008 (2008-11-30), pages 2365 *
LV , YANLI.: "China Master's Theses Full-text Database Information Technology Album (monthly", RESEARCH ON DIGITAL IMAGE MOSAIC TECHNOLOGY IN GIS, 15 August 2010 (2010-08-15), pages 26 - 29 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108475416A (en) * 2017-06-30 2018-08-31 深圳市大疆创新科技有限公司 The method and apparatus for handling image
CN111145114A (en) * 2019-12-19 2020-05-12 腾讯科技(深圳)有限公司 Image enhancement method and device and computer readable storage medium
CN111145114B (en) * 2019-12-19 2022-03-25 腾讯科技(深圳)有限公司 Image enhancement method and device and computer readable storage medium

Also Published As

Publication number Publication date
CN105763768B (en) 2019-12-13
CN105763768A (en) 2016-07-13

Similar Documents

Publication Publication Date Title
WO2016095541A1 (en) Image processing method, device, system and computer storage medium
WO2016206087A1 (en) Low-illumination image processing method and device
US7983511B1 (en) Methods and apparatus for noise reduction in digital images
JP6485078B2 (en) Image processing method and image processing apparatus
KR20200109391A (en) Detecting keypoints in image data
JP5767064B2 (en) Image edge enhancement method
US8238685B2 (en) Image noise reduction method and image processing apparatus using the same
JP6602789B2 (en) System and method for local contrast enhancement
CN107437239B (en) Image enhancement method and device
WO2020108092A1 (en) Video processing method and device, and electronic device and storage medium
JP2008113222A (en) Image processing apparatus, imaging apparatus, image processing method in these apparatuses, and program allowing computer to execute the method
CN111145114A (en) Image enhancement method and device and computer readable storage medium
CN110782414A (en) Dark light image denoising method based on dense connection convolution
US11089234B2 (en) Systems and methods of image enhancement
TW201624414A (en) Image scaling techniques
CN108885790B (en) Processing images based on generated motion data
US7787021B2 (en) Programmable architecture for flexible camera image pipe processing
CN111724312A (en) Method and terminal for processing image
CN110378860A (en) Method, apparatus, computer equipment and the storage medium of restored video
WO2020107308A1 (en) Low-light-level image rapid enhancement method and apparatus based on retinex
KR100791374B1 (en) Method and apparatus for image adaptive color adjustment of pixel in color gamut
CN115511755B (en) Video stream image self-adaptive enhancement method and system
CN108470327B (en) Image enhancement method and device, electronic equipment and storage medium
KR100700017B1 (en) Apparatus for color interpolation by using adjustable threshold
KR101667306B1 (en) Low-Complexity Topological Derivative-Based Image Segmentation Method and System

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15869052

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15869052

Country of ref document: EP

Kind code of ref document: A1