Mosaic judgment method based on gamma 2.2

Through the selection phase of the prediction mode of image compression, the use of Gamma 2.2 method to handle image mosaic is used to solve the problem of limited operational operation in existing technologies, complicated computing processes, and setting of threshold settings. The accuracy and rapid identification of the block simplify the calculation process and improve the efficiency and effect of image processing.

CN119379576APending Publication Date: 2025-01-28HEFEI JUNZHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310916459.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The prior art has limited operability when processing image mosaics, complex calculation process and threshold setting does not conform to the human eye characteristics, resulting in poor results.

Method used

In the selection stage of image compression prediction mode, through the GAMMA 2.2 method, the average pixel and difference are determined to determine the flat block, eliminate the more obvious predictive mode of the mosaic phenomenon, use simple calculations and process marks to be a serious prediction block, and and also use the heavily predicted block of the mosaic mosaic. During the calculation process, select the threshold associated with Gamma and human eye to the gray level recognition characteristics.

Benefits of technology

The accuracy and rapid identification of mosaic blocks are achieved, and the calculation process is simplified, and the threshold selection is more in line with human eye sensor effects, which improves the efficiency and effect of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379576A_ABST
    Figure CN119379576A_ABST
Patent Text Reader

Abstract

The invention discloses a gamma 2.2-based mosaic judgment method. The method comprises the following steps: S1, inputting a current image block; s2, determining whether a current block is a flat block using a pixel average value and a pixel difference- If yes, the step S3 is carried out, and if not, the mosaic blocks are marked as non-mosaic blocks; s3, judging the mosaic phenomenon by using gamma 2.2; using pixel characteristics of neighboring blocks to determine whether blocks are mosaic suspicious blocks- If yes, the step S4 is carried out, and if not, the mosaic blocks are marked as non-mosaic blocks; s4, judging whether boundary exists or not If yes, the step S5 is carried out, and if not, the mosaic blocks are marked as non-mosaic blocks; and S5, marking the mosaic blocks. In the prediction mode selection stage of image compression, the mosaic module is accurately and quickly distinguished to be excluded and used.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing, and in particular relates to a mosaic determination method based on gamma 2.2. Background Art

[0002] In the prior art, there are Figure 1 The processing method for reducing image mosaic (flat area block effect) shown in FIG. 1 includes inputting image blocks, detecting mosaics, removing isolated mosaics, performing fast guided graph filtering on mosaic areas, image fusion, and outputting a de-mosaiced image. That is, by dividing the input image blocks into 8x8 image blocks, calculating the pixel block variance, and comparing it with a certain threshold T, marking the mosaic blocks, and then performing filtering processing.

[0003] However, the prior art has the following problems:

[0004] 1. This method belongs to the processing method of reconstructing images, and its operability for excluding mosaic blocks is limited;

[0005] 2. The calculation process is relatively complicated;

[0006] 3. The threshold T setting in the process does not fully consider the characteristics of the human eye.

[0007] In addition, commonly used technical terms in the prior art include:

[0008] Gamma: The broad definition of the gamma value is the gamma power exponential relationship between the input value and the output value, which is used to compensate for the nonlinear perception of natural brightness by the human eye.

[0009] Gamma2.2: Gamma is a display brightness parameter. The actual brightness value y perceived by the human eye is an exponential multiple of the actual brightness x. The relationship y=x gamma In order to meet the human eye's perception of brightness, the gamma value is assigned to 2.2. This is the meaning of gamma 2.2.

[0010] Isp_gamma: isp_gamma is the gamma value used when sampling the ISP image, that is, the power exponential relationship between the pixel value stored by the isp and the actual sampled value.

[0011] Mosaic: Block-based transform coding is widely used in image compression coding. As the bit rate decreases, quantization becomes coarse and discontinuities appear at the boundaries of blocks, forming obvious defects in the reconstructed image, which is called block effect, also known as mosaic.

[0012] Flat area: All pixel values ​​in the image area do not change or change slowly relative to the characteristics of the human eye (based on gamma2.2 compensation).

[0013] Variance: Variance is a measure of the degree of dispersion of a random variable or a set of data in probability theory and statistics. The variance (sample variance) in statistics is the average of the squares of the differences between each sample value and the mean of all sample values.

[0014] Grayscale: Grayscale is the process of dividing the brightness change between the brightest and darkest into several parts, so as to facilitate the screen brightness control corresponding to the signal input. Summary of the invention

[0015] In order to solve the above problems, the purpose of this application is to:

[0016] ① In the prediction mode selection stage, the features of adjacent blocks of different modes are extracted, and the prediction mode blocks with obvious mosaic phenomenon are eliminated;

[0017] ② Use simple calculations and processes to mark mosaic severely predicted blocks;

[0018] ③ The threshold selection in the calculation process is related to gamma and the grayscale recognition characteristics of the human eye, which is more in line with the sensory effect.

[0019] Specifically, the present invention provides a mosaic determination method based on gamma 2.2, the method comprising the following steps:

[0020] S1, input current image block;

[0021] S2, using pixel average and pixel difference to determine whether the current block and its neighbors are flat blocks? If yes, proceed to step S3, if not, mark them as non-mosaic blocks;

[0022] 0 1 2 3 4 5 6 7 8 ;

[0023] S3, using gamma2.2 to determine the mosaic phenomenon, that is, in the prediction mode selection stage, the method determines whether the current block 4 and the adjacent blocks 1, 3, 5 and 7 are all flat blocks. If they are all flat blocks, determine whether there is a mosaic phenomenon based on the relationship between adjacent pixels between the current block and the adjacent blocks:

[0024] Use the pixel characteristics of the adjacent blocks to determine whether it is a mosaic suspicious block? If yes, proceed to step S4, if not, mark it as a non-mosaic block;

[0025] S4, determine whether there is a boundary? If yes, proceed to step S5, if not, mark it as a non-mosaic block;

[0026] S5, labeling mosaic blocks.

[0027] The step S2 further comprises:

[0028] S2.1, determine whether the current block is a flat block, first calculate the average value avg of all pixels in the NxN image block as follows:

[0029]

[0030] Where: f(x, y) represents the brightness value of the pixel at the corresponding coordinate in the current block, N represents the width and height of the current block, and the brightness values ​​of the pixels in the NxN image block are accumulated and divided by the number of pixels N 2 Get the mean avg;

[0031] S2.2, use the brightness value f(x, y) of each pixel in the image block to make a difference with the average value avg to get the absolute value p(x, y), and compare it with the threshold T0. When p(x, y) < T0, f(x, y) is called a flat pixel. When the number of flat pixels in the image block is greater than N*(N-1), the image block is called a flat block; otherwise, it is a non-flat block, and this block is marked as a non-mosaic block:

[0032] p(x,y)=|f(x,y)-avg|

[0033] Where: f(x,y) represents the brightness value of the pixel corresponding to the coordinate in the current block, and p(x,y) represents the difference between the corresponding coordinate in the current block and the mean value avg in the block.

[0034] When the current block is a flat block, the step S3 further comprises:

[0035] First, determine whether the four adjacent blocks of the current block are all flat blocks. If there is a non-flat block among the four adjacent blocks, the current block is marked as a non-mosaic block; if they are all flat blocks, the average avg of the current image block is compared with the average avg of the four adjacent blocks. N Make the absolute value difference P N , compared with the threshold T1, if it is compared with the interpolation P of the four adjacent blocks N All of them are greater than the threshold T1. This block and the adjacent blocks may form obvious block effects. The current block is marked as a suspicious mosaic block:

[0036] p N =|avg-avg N |

[0037] Where: avg represents the average brightness of the number of pixels in the current block, avg N Represents the average brightness of pixels in a certain adjacent block within the current block.

[0038] The step S4 further comprises:

[0039] When the current block is a suspicious mosaic block, the average pixel value of the adjacent rows between the current image block and the two adjacent blocks above and below, as well as the average pixel value of the adjacent columns between the current block and the two adjacent blocks on the left and right are calculated, and the absolute value difference Q is calculated between the average value of the row between the current block and the two adjacent blocks above and below. X , the absolute difference R between the current block and the average value of the columns of the two adjacent blocks on the left and right X , and then compare them with the threshold T2 to determine whether there is a false boundary between the current block and the four adjacent blocks. X and R X When both are greater than the threshold T2, the current block and the adjacent block are called false boundaries, otherwise they are non-false boundaries:

[0040]

[0041]

[0042] Q U =|Row U -Row0|

[0043] In the formula: Row U represents the average brightness of the last row of pixels in the upper adjacent block of the current block, Row0 represents the average brightness of the first row of pixels in the current block, Q U Indicates the average difference between the pixels in adjacent rows of the current block and the upper adjacent block.

[0044]

[0045]

[0046] Q D =|Row D -Row N-1 |

[0047] In the formula: Row D Represents the average brightness of the first row of pixels in the next adjacent block of the current block, Row N-1 Represents the average brightness of the last row of pixels in the current block, Q D Indicates the average difference between the adjacent rows of pixels of the current block and the next adjacent block;

[0048]

[0049]

[0050] R L =|Row D -Row N-1 |

[0051] Where: Col Lrepresents the average brightness of the pixels in the adjacent rows of the left adjacent block of the current block, Col0 represents the average brightness of the pixels in the first column of the current block, R L Indicates the average difference between the adjacent columns of the current block and the left adjacent block;

[0052]

[0053]

[0054] R L =|Row D -Row N-1 |

[0055] Where: Col R Represents the average brightness of the adjacent rows of the right adjacent block of the current block, Col N-1 Represents the average brightness of the last column of pixels in the current block, R R Indicates the average difference between the pixels in adjacent columns of the current block and the right adjacent block.

[0056] The step S5 further comprises:

[0057] The current block will be marked as a mosaic block only when the boundaries between the current block and all adjacent blocks are false boundaries and the current block is a mosaic suspicious block;

[0058] The thresholds T0, T1, and T2 are all based on the characteristics of the human eye, and the maximum recognition ability of the human eye is 64 gray levels.

[0059] In addition, according to gamma2.2, the thresholds are divided into three groups for low grayscale 0-4, medium grayscale 4-32, and high grayscale 32-64. The three groups of basic thresholds t are divided into 4, 8, and 16, and multiplied by different coefficients k to correct the thresholds T. T0, T1, and T2 are 1.0, 0.9, and 0.5 respectively; the current block belongs to the grayscale interval gray and the threshold T is calculated as follows:

[0060]

[0061] T=t×k.

[0062] Therefore, the advantage of the present application is that the present application accurately and quickly identifies the mosaic module in advance in the prediction mode selection stage of image compression for exclusion. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0064] Figure 1 It is a schematic diagram of a method for reducing image mosaic in the prior art.

[0065] Figure 2 It is a schematic diagram of the mosaic determination method of this method. DETAILED DESCRIPTION

[0066] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.

[0067] The present application provides a mosaic determination method based on gamma 2.2, comprising:

[0068] S1, input current image block;

[0069] S2, using pixel average and pixel difference to determine whether the current block and its neighbors are flat blocks? If yes, proceed to step S3, if not, mark them as non-mosaic blocks;

[0070] 0 1 2 3 4 5 6 7 8 ;

[0071] S3, using gamma2.2 to determine the mosaic phenomenon, that is, in the prediction mode selection stage, the method determines whether the current block 4 and the adjacent blocks 1, 3, 5 and 7 are all flat blocks. If they are all flat blocks, determine whether there is a mosaic phenomenon based on the relationship between adjacent pixels between the current block and the adjacent blocks:

[0072] Use the pixel characteristics of the adjacent blocks to determine whether it is a mosaic suspicious block? If yes, proceed to step S4, if not, mark it as a non-mosaic block;

[0073] S4, determine whether there is a boundary? If yes, proceed to step S5, if not, mark it as a non-mosaic block;

[0074] S5, labeling mosaic blocks.

[0075] That is, the process is as follows Figure 2 As shown, input the current image, determine whether it is a flat block? If not, mark it as a non-mosaic block; if yes, further determine whether it is a mosaic suspicious block? If not, mark it as a non-mosaic block; if yes, further determine whether there is a false boundary? If not, mark it as a non-mosaic block; if yes, mark it as a mosaic block.

[0076] Furthermore, step S2 of the method includes:

[0077] S2.1. To determine whether the current block is a flat block, first calculate the average value avg of all pixels in the NxN image block as follows:

[0078]

[0079] S2.2. Then use the difference between the brightness value f(x, y) of each pixel in the image block and the average value avg to get the absolute value p(x, y), and compare it with the threshold T0. When p(x, y) < T0, f(x, y) is called a flat pixel. When the number of flat pixels in the image block is greater than N*(N-1), the image block is called a flat block:

[0080] p(x,y)=|f(x,y)-avg|

[0081] Step S3 of the method further includes: when the adjacent blocks are all flat blocks, the mean value avg of the current image block is compared with the mean value avg of a certain adjacent block. N Make the absolute value difference P N , compared with the threshold T1, if it is consistent with the interpolation P of all adjacent blocks N All of them are greater than the threshold T1. This block and the adjacent blocks may form obvious block effects. The current block is marked as a suspicious mosaic block:

[0082] p N =|avg-avg N |

[0083] Step S4 of the method further includes: calculating the average pixel values ​​of the adjacent rows of the current image block and the upper and lower adjacent blocks, and the average pixel values ​​of the adjacent columns of the current block and the left and right adjacent blocks, and calculating the absolute value difference Q between the average pixel values ​​of the current block and the adjacent block rows. X , the absolute difference R between the current block and the average value of the adjacent block column X , and then compare them with the threshold T2 to determine whether there is a false boundary between the current block and the adjacent block. X and R X When both are less than the threshold T2, the current block and the adjacent block are called false boundaries, otherwise they are non-false boundaries:

[0084]

[0085]

[0086] Q U =|Row U -Row0|

[0087]

[0088]

[0089] Q D =|Row D -Row N-1 |

[0090]

[0091]

[0092] R L =|Row D -Row N-1 |

[0093]

[0094]

[0095] R L =|Row D -Row N-1 |

[0096] Step S5 of the method further includes: only when the boundaries between the current block and all adjacent blocks are false boundaries and the current block is a mosaic suspicious block, the current block will be marked as a mosaic block.

[0097] The thresholds (T0, T1, T2) are all based on the characteristics of the human eye, and the human eye's maximum recognition ability of 64 grayscale is used to divide the threshold. In addition, according to gamma2.2, the thresholds are divided into three groups for low grayscale (0-4), medium grayscale (4-32), and high grayscale (32-64). The three groups of basic thresholds t are divided into 4, 8, and 16, and multiplied by different coefficients k to correct the threshold T. T0, T1, and T2 are obtained as 1.0, 0.9, and 0.5 respectively. The current block belongs to the grayscale interval gray and the threshold T is calculated as follows:

[0098]

[0099] T=t×k.

[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A mosaic determination method based on gamma 2.2, characterized in that: The method comprises the following steps: S1, input current image block; S2, using pixel average and pixel difference to determine whether the current block and its neighbors are flat blocks? If yes, proceed to step S3, if not, mark them as non-mosaic blocks; S3, using gamma2.2 to determine the mosaic phenomenon, that is, in the prediction mode selection stage, the method determines whether the current block 4 and the adjacent blocks 1, 3, 5 and 7 are all flat blocks. If they are all flat blocks, determine whether there is a mosaic phenomenon based on the relationship between adjacent pixels between the current block and the adjacent blocks: Use the pixel characteristics of the adjacent blocks to determine whether it is a mosaic suspicious block? If yes, proceed to step S4, if not, mark it as a non-mosaic block; S4, determine whether there is a boundary? If yes, proceed to step S5, if not, mark it as a non-mosaic block; S5, labeling mosaic blocks.

2. The mosaic determination method based on gamma 2.2 according to claim 1, characterized in that: The step S2 further comprises: S2.1, determine whether the current block is a flat block, first calculate the average value avg of all pixels in the NxN image block as follows: Where: f(x,y) represents the brightness value of the pixel at the corresponding coordinate in the current block, N represents the width and height of the current block, and the brightness values ​​of the pixels in the NxN image block are accumulated and divided by the number of pixels N 2 Get the mean avg; S2.2, then use the brightness value f(x, y) of each pixel in the image block to make a difference with the average value avg to get the absolute value p(x, y), and compare it with the threshold T0. When p(x, y) < T0, f(x, y) is called a flat pixel. When the number of flat pixels in the image block is greater than N*(N-1), the image block is called a flat block; otherwise, it is a non-flat block, and this block is marked as a non-mosaic block: p(x,y)=|f(x,y)-avg| Where: f(x,y) represents the brightness value of the pixel corresponding to the coordinate in the current block, and p(x,y) represents the difference between the corresponding coordinate in the current block and the mean value avg in the block.

3. The mosaic determination method based on gamma 2.2 according to claim 2, characterized in that: When the current block is a flat block, the step S3 further comprises: First, determine whether the four adjacent blocks of the current block are all flat blocks. If there is a non-flat block among the four adjacent blocks, the current block is marked as a non-mosaic block; if they are all flat blocks, the average avg of the current image block is compared with the average avg of the four adjacent blocks. N Make the absolute value difference P N , compared with the threshold T1, if it is compared with the interpolation P of the four adjacent blocks N All of them are greater than the threshold T1. This block and the adjacent blocks may form obvious block effects. The current block is marked as a suspicious mosaic block: on N =|avg-avg N | Where: avg represents the average brightness of the number of pixels in the current block, avg N Represents the average brightness of pixels in a certain adjacent block within the current block.

4. The mosaic determination method based on gamma 2.2 according to claim 3, characterized in that: The step S4 further comprises: When the current block is a suspicious mosaic block, the average pixel value of the adjacent rows between the current image block and the two adjacent blocks above and below, as well as the average pixel value of the adjacent columns between the current block and the two adjacent blocks on the left and right are calculated, and the absolute value difference Q is calculated between the average value of the row between the current block and the two adjacent blocks above and below. X , the absolute difference R between the current block and the average value of the columns of the two adjacent blocks on the left and right X , and then compare them with the threshold T2 to determine whether there is a false boundary between the current block and the four adjacent blocks. X and R X When both are greater than the threshold T2, the current block and the adjacent block are called false boundaries, otherwise they are non-false boundaries: Q U =|Row U -Row0| In the formula: Row U represents the average brightness of the last row of pixels in the upper adjacent block of the current block, Row0 represents the average brightness of the first row of pixels in the current block, Q U Indicates the average difference between the pixels in the adjacent rows of the current block and the upper adjacent block; Q D =|Row D -Row N-1 | In the formula: Row D Represents the average brightness of the first row of pixels in the next adjacent block of the current block, Row N-1 Represents the average brightness of the last row of pixels in the current block, Q D Indicates the average difference between the adjacent rows of pixels of the current block and the next adjacent block; R L =|Row D -Row N-1 | Where: Col L represents the average brightness of the pixels in the adjacent rows of the left adjacent block of the current block, Col0 represents the average brightness of the pixels in the first column of the current block, R L Indicates the average difference between the adjacent columns of the current block and the left adjacent block; R L =|Row D -Row N-1 | Where: Col R Represents the average brightness of the adjacent rows of the right adjacent block of the current block, Col N-1 Represents the average brightness of the last column of pixels in the current block, R R Indicates the average difference between the pixels in the adjacent columns of the current block and the right adjacent block.

5. The mosaic determination method based on gamma 2.2 according to claim 4, characterized in that: The step S5 further comprises: The current block will be marked as a mosaic block only when the boundaries between the current block and all adjacent blocks are false boundaries and the current block is a mosaic suspicious block; The thresholds T0, T1, and T2 are all based on the characteristics of the human eye, and the maximum recognition ability of the human eye is 64 gray levels. In addition, according to gamma2.2, the thresholds are divided into three groups for low grayscale 0-4, medium grayscale 4-32, and high grayscale 32-64. The three groups of basic thresholds t are divided into 4, 8, and 16, and multiplied by different coefficients k to correct the thresholds T. T0, T1, and T2 are 1.0, 0.9, and 0.5 respectively; the current block belongs to the grayscale interval gray and the threshold T is calculated as follows: T=t×k.