Method, apparatus, and storage medium for eliminating false contours in an image

Through pseudo-contour detection and pixel interpolation processing, the quality degradation caused by pseudo-contour in the image is solved, and image quality improvement and hardware resource conservation are achieved.

CN114494026BActive Publication Date: 2025-07-11MONTAGE TECH CHENGDU CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011146132.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-23
Publication Date
2025-07-11
Estimated Expiration
2040-10-23

AI Technical Summary

Technical Problem

In video image processing, due to image compression and quantization errors, the generated pseudo-contours lead to a decrease in subjective and objective quality of the image, and the prior art is difficult to effectively eliminate.

Method used

By receiving the target image, pseudo-contour detection is performed, pseudo-contour is identified using the difference parameters, and the width of adjacent strips is predicted based on the width of the detected pseudo-contour, pixel interpolation processing is performed to eliminate the pseudo-contour.

Benefits of technology

Effectively identify and eliminate pseudo-contours, improve image quality, and reduce hardware overhead in image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494026B_ABST
    Figure CN114494026B_ABST
Patent Text Reader

Abstract

The present application discloses a method, an apparatus, and a non-transitory computer storage medium for eliminating false contours in an image. The method includes: A) receiving a target image, where the target image includes a two-dimensional pixel array arranged in rows and columns; B) performing false contour detection on a target arrangement in the target image in one of a row direction and a column direction of the target image; C) in response to detecting a false contour between two adjacent first bands and a second band on the target arrangement, predicting at least a second band width of the second band based on at least a first band width of the first band; and D) performing pixel interpolation processing on at least a part of pixels in the second band to eliminate the false contour.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more particularly, to a method, apparatus, and storage medium for eliminating false contours in an image. Background Art

[0002] In the process of video image processing, due to reasons such as image compression and quantization errors, some false contours similar to image edges will be generated in relatively flat areas of the image, and an image area similar to a stripe will be formed between two false contours. Compared with real image edges, false contours are usually less different and often appear in flat areas of the image, and the human eye is often sensitive to such false contours in flat areas, resulting in a decrease in the subjective perceptual quality of video images. In addition, during image enhancement processing, these false contours are also prone to cause a decrease in the objective quality of the image due to corresponding enhancement.

[0003] Therefore, it is necessary to provide a method capable of eliminating false contours in an image. Summary of the Invention

[0004] An object of this application is to provide an image processing method capable of identifying and eliminating false contours in an image.

[0005] In one aspect of this application, a method for eliminating false contours in an image is provided. The method includes: A) receiving a target image, where the target image includes a two-dimensional pixel array arranged in rows and columns; B) performing false contour detection on a target arrangement in the target image in one of the row direction and the column direction of the target image; C) in response to detecting a false contour between two adjacent first stripe and second stripe on the target arrangement, predicting at least the second stripe width of the second stripe based on the first stripe width of the first stripe; and D) performing pixel interpolation processing on at least a part of the pixels in the second stripe to eliminate the false contour.

[0006] In some embodiments, the step B includes: determining a target pixel on the target arrangement; windowing the target arrangement with a false contour detection window to obtain a group of adjacent pixels adjacent to the target pixel; determining a first difference parameter, where the first difference parameter indicates the degree of individual pixel difference related to the target pixel; determining a second difference parameter, where the second difference parameter indicates the degree of overall difference between the group of adjacent pixels or between a group of adjacent pixels adjacent to the pixels at the previous false contour; and determining whether the target pixel is at the false contour of the target arrangement at least according to the first difference parameter and the second difference parameter.

[0007] In some embodiments, determining the first difference parameter includes: comparing the difference between two adjacent pixels adjacent to the target pixel; or comparing the difference between the target pixel and the next adjacent pixel of the target pixel on the target arrangement;

[0008] In some embodiments, determining the second difference parameter includes: comparing the difference between all adjacent pixels before the target pixel and all adjacent pixels after the target pixel in the group of adjacent pixels.

[0009] In some embodiments, determining the second difference parameter includes: comparing the difference between the accumulated value of all pixels in the group of adjacent pixels and the accumulated value of all pixels in a group of adjacent pixels adjacent to the pixels at the previous pseudo-contour.

[0010] In some embodiments, determining whether the target pixel is at the pseudo-contour of the target arrangement based at least on the first difference parameter and the second difference parameter includes: determining that the target pixel is at the pseudo-contour of the target arrangement when the first difference parameter belongs to a first predetermined difference range and the second difference parameter belongs to a second predetermined difference range.

[0011] In some embodiments, the pseudo-contour detection window is a window centered on the target pixel with a width of not less than 5 pixels.

[0012] In some embodiments, step B further includes: determining a third difference parameter, where the third difference parameter indicates the maximum pixel difference of the group of adjacent pixels; and determining whether the target pixel is at the pseudo-contour of the target arrangement based on the first difference parameter, the second difference parameter, and the third difference parameter.

[0013] In some embodiments, determining whether the target pixel is at the pseudo-contour of the target arrangement based on the first difference parameter, the second difference parameter, and the third difference parameter includes: determining that the target pixel is at the pseudo-contour of the target arrangement when the first difference parameter belongs to a first predetermined difference range, the second difference parameter belongs to a second predetermined difference range, and the third difference parameter does not exceed a predetermined difference threshold.

[0014] In some embodiments, the predetermined difference threshold is an adaptive threshold related to the target pixel.

[0015] In some embodiments, step C includes: using the first strip width of the first strip as the predicted value of the second strip width of the second strip.

[0016] In some embodiments, step C includes: comparing the width of the first strip with a reference strip width; and when the width of the first strip is greater than the reference strip width, using the width of the first strip as the predicted value of the width of the second strip; and when the width of the first strip is not greater than the reference strip width, using the average value of the width of the first strip and the reference strip width as the predicted value of the width of the second strip.

[0017] In some embodiments, the reference strip width is the predicted value of the width of the first strip.

[0018] In some embodiments, it is characterized in that step B includes: windowing the target arrangement with a pseudo-contour detection window to obtain a group of adjacent pixels adjacent to the target pixel; and determining a second difference parameter, where the second difference parameter indicates the degree of overall difference within the group of adjacent pixels; step C further includes: limiting the predicted value of the width of the second strip based on the second difference parameter.

[0019] In some embodiments, step C further includes: using the strip widths of two strips corresponding to the first strip on two arrangements adjacent to the target arrangement in a non-target direction in the row direction and the column direction to correct the predicted value of the width of the second strip.

[0020] In some embodiments, the first strip starts from a pseudo-contour or an image edge.

[0021] In some embodiments, the interpolation processing includes interpolation smoothing filtering processing.

[0022] In some embodiments, at least a part of the pixels within the second strip start from the target pixel but do not exceed 3 / 4 of the predicted value of the length of the second strip.

[0023] In some embodiments, after step D, the method further includes: performing an amplitude correction process on the pixels for which pixel interpolation is performed, so that the difference between each interpolated pixel and the pixel before the interpolated pixel on the target arrangement does not exceed a predetermined amplitude threshold.

[0024] In some embodiments, the predetermined amplitude threshold is an adaptive threshold.

[0025] In some embodiments, in the step of the amplitude correction process, different predetermined amplitude thresholds are applied to the pixels located in the flat area and the non-flat area of the image.

[0026] In other aspects of the present application, an image processing device and a non-transitory computer storage medium are further provided.

[0027] It can be seen that when processing an image using the method of the present application, it can detect pseudo-contours in the image and count relevant information, and use the width of the previous strip at the pseudo-contour that has been calculated to predict the width of the next adjacent strip. In this way, these statistical information can be used to eliminate the pseudo-contours in the original image through methods such as interpolation smoothing filtering, reducing the running memory and saving the hardware overhead of image processing while achieving the same image effect.

[0028] The above is an overview of the present application. There may be simplifications, generalizations, and omissions of details. Therefore, those skilled in the art should recognize that this part is only illustrative and is not intended to limit the scope of the present application in any way. This overview section is neither intended to identify the key features or essential features of the claimed subject matter nor intended to be used as an aid in determining the scope of the claimed subject matter. Brief Description of the Drawings

[0029] Through the following description of the specification and the appended claims in combination with the drawings, the above and other features of the content of the present application will be more fully and clearly understood. It can be understood that these drawings only depict several embodiments of the content of the present application, and thus should not be considered as limiting the scope of the content of the present application. By using the drawings, the content of the present application will be more clearly and detailedly described.

[0030] Figure 1 Shows a method for eliminating pseudo-contours in an image according to an embodiment of the present application;

[0031] Figure 2 Shows that it can be Figure 1 An exemplary image processed by the method shown, which includes a two-dimensional pixel array arranged in rows and columns;

[0032] Figure 3 Shows a schematic diagram of pixel interpolation processing on a target arrangement. Detailed Description of the Invention

[0033] In the following detailed description, reference is made to the accompanying drawings which form a part hereof. In the drawings, like reference numerals generally represent like components unless the context otherwise indicates. The illustrative embodiments described in the detailed description, the drawings, and the claims are not intended to be limiting. Other embodiments may be employed and other changes may be made without departing from the spirit or scope of the subject matter of the present application. It can be understood that various different configurations, substitutions, combinations, and designs can be made to the various aspects of the content of the present application generally described and illustrated in the drawings, and all of these are clearly constituted as a part of the content of the present application.

[0034] Figure 1A method for eliminating false contours in an image according to an embodiment of the present application is shown. In some embodiments, the method can be used to process static images or dynamic images (such as video images) to eliminate false contours in these images.

[0035] Figure 2 An exemplary image that can be processed by the Figure 1 shown method is shown. The image includes a two-dimensional pixel array arranged in rows and columns. For Figure 2 the shown image, in a row of pixels along its row direction or in a column of pixels along its column direction, there may be two adjacent pixels whose pixel values have a visually perceivable difference, but this difference is usually smaller than the pixel value difference between two adjacent pixels at a real image edge. Therefore, false contour detection can be performed on the image row by row, or it can also be performed column by column, and corresponding processing is performed after false contours are found. As an example, for Figure 2 the shown image, false contour detection is performed on the image column by column. For example, the target arrangement is the current column of pixels being detected. It can be understood that the resolution of the image determines the number of pixels in each row or each column. For example, for an image with a resolution of 1920*1080, the number of pixels in each row is 1920, and the number of pixels in each column is 1080. It should be noted that in this article, the target image to be processed can conform to various image formats, such as the YUV or RGB format. For an image conforming to the YUV format, the pixel value can be the value of any one of its Y channel, U channel, or V channel. In some embodiments, false contour detection and elimination processing can be performed only on one channel of the image, such as the Y channel; in other embodiments, false contour detection and elimination processing can also be performed on multiple channels or all channels of the image respectively. For an image conforming to the RGB format, the pixel value can be the value of one or more channels among the R channel, G channel, or B channel.

[0036] Next, in combination with Figure 1 and Figure 2 , the method for eliminating false contours in an embodiment of the present application is specifically described.

[0037] First, in step 102, a target image is received. The target image includes a two-dimensional pixel array arranged in rows and columns. The target image is, for example, Figure 2 the shown image.

[0038] Then, in step 104, false contour detection is performed on a target arrangement in the target image according to a target direction among the row direction and the column direction of the target image. For example, false contours can be detected column by column according to the column direction (target direction) on each column of pixels, just as Figure 2As shown. In the present application, the pseudo-contour may be located between two adjacent strips with visually perceivable differences, and the difference is smaller than the obvious difference of the image edge. Inside each strip, the overall or at least between every two adjacent pixels generally has the same or similar pixel values.

[0039] Since the pseudo-contour is usually a local characteristic of the image, for the target arrangement being currently processed, when detecting the pseudo-contour, it is not necessary to obtain the information of all pixels in the target arrangement at one time, but only to obtain the information of a part of the multiple pixels adjacent to a certain pixel for judgment. Therefore, for example Figure 2 For the target arrangement shown, it is possible to detect whether each pixel is at the pseudo-contour pixel by pixel along the column direction. In one embodiment, a target pixel on the target arrangement can be selected, such as Figure 2 the target pixel a3 in; then, the target arrangement can be windowed with a pseudo-contour detection window to obtain a set of adjacent pixels adjacent to and including the target pixel (in the present application, a set of adjacent pixels adjacent to the target pixel all include the target pixel itself), such as Figure 2 the set of adjacent pixels a0 to a6 in; after that, based on the information of this set of adjacent pixels, it can be detected whether the target pixel is at the pseudo-contour of the target arrangement where it is located. It can be understood that after detecting the target pixel a3, the next pixel a4 behind it can be used as the target pixel, and a plurality of pixels adjacent to it can be selected for similar processing. It can be understood that the pseudo-contour detection window defines the number and position of the adjacent pixels corresponding to the target pixel. In Figure 2 the pseudo-contour detection window is a window with a length of 7 (pixels) centered on the target pixel a3. In some other embodiments, the pseudo-contour detection window can be a window centered on the target pixel and with a length of at least 5 (such as 5, 6, 7, 8, 9, 10, 11 or more pixels). In other embodiments, the pseudo-contour detection window may not be centered on the target pixel. For example, in an alternative embodiment, the pseudo-contour detection window can also obtain Figure 2 the set of pixels a0 to a7 adjacent to the target pixel a3 in for pseudo-contour detection. Those skilled in the art can increase or adjust the size and range of the pseudo-contour detection window according to the actual application needs.

[0040] In some embodiments, one or more difference parameters can be determined based on the set of adjacent pixels obtained by the pseudo-contour detection window, where these difference parameters can indicate the pixel differences related to the target pixel and / or within this set of adjacent pixels. Based on these difference parameters, it can be further determined whether the target pixel is at the pseudo-contour of the target arrangement.

[0041] In one embodiment, the determined one or more difference parameters may include a first difference parameter indicating a degree of difference of individual pixels relative to the target pixel. Figure 2 , still taking the target pixel a3 as an example, the first difference parameter can be the difference between the target pixel a3 and the next pixel a4 in the same arrangement (in this application, unless otherwise specified, the difference refers to the absolute value), or it can also be the difference between the next pixel a4 of the target pixel a3 and the previous pixel a2 of the target pixel a3. If the target pixel is at the pseudo contour, the first difference parameter should belong to a predetermined difference range, which can be expressed as the first predetermined difference range for ease of explanation. Specifically, the first predetermined difference range should have a difference lower limit threshold and a difference upper limit threshold; wherein the difference lower limit threshold cannot be too large, and a typical value is, for example, 1 (assuming that the pixel value is represented as an 8-bit depth value of 0 to 255), otherwise it is difficult to detect the true pseudo contour; but the difference upper limit threshold cannot be too large, and a typical value is, for example, 6 (also assuming that the pixel value is represented as an 8-bit depth value of 0 to 255), because if the difference upper limit threshold is too large, the image edge may be mistakenly detected as a pseudo contour. Generally speaking, if the difference between the pixel values ​​of adjacent pixels exceeds 8, it can be considered that it is at the true image edge. In practical applications, the actual range of the first predetermined difference range may vary slightly depending on the calculation method of the first difference parameter. It should also be noted that, in the following, pixel values ​​are described using 8-bit depth values ​​as an example, but those skilled in the art will understand that other bit (e.g., 10-bit) depth values ​​may have corresponding pixel values ​​and thresholds. For example, for pixel values ​​of 8-bit depth values, the upper limit threshold of the difference in the first predetermined difference range is 6; and for pixel values ​​of 10-bit depth values, the upper limit threshold of the difference in the first predetermined difference range may be approximately 24, i.e., 6*4, where the multiplication by 4 is because the depth value of the pixel is increased by 2 bits, and the calculation of other parameters is similar.

[0042] It can be understood that since the calculation of the first difference parameter is only related to the target pixel and one or two adjacent pixels, the first difference parameter does not reflect the overall difference information of the group of adjacent pixels. Accordingly, in some embodiments, the determined difference parameter may also include a second difference parameter, which is used to indicate the degree of overall difference within the group of adjacent pixels. In some embodiments, the second difference parameter can be determined by comparing the difference between all adjacent pixels before the target pixel and all adjacent pixels after the target pixel in the group of adjacent pixels. For example, the second difference parameter can be calculated as the accumulated value of the upper / front half of the pixels of the pseudo contour detection window (for example, Figure 2 The pixel a0+a1+a2 in the middle and the lower / back half of the pixel (e.g. Figure 2The difference between the accumulated values of pixels a4 + a5 + a6); alternatively, the second difference parameter can also be calculated as the difference between the average value of the upper / front half pixels and the average value of the lower / back half pixels in the pseudo-contour detection window. When the target pixel is at the pseudo-contour, the second difference parameter should generally also fall within a predetermined difference range, such as a second predetermined difference range with a difference lower threshold and a difference upper threshold. In some embodiments, the second difference parameter can be calculated as the accumulated value of the upper / front half pixels of the pseudo-contour detection window, and the lower threshold of the second predetermined difference range can be set to 4, while the upper threshold of the second predetermined difference range can be set to 24 (for example, both the upper threshold and the lower threshold correspond to Figure 2 the difference between the accumulated value of the three upper half pixels a0 + a1 + a2 and the accumulated value of the three lower half pixels a4 + a5 + a6). It can be understood that the specific values of the upper / lower thresholds of the second predetermined difference range may vary depending on the calculation method of the second difference parameter.

[0043] Alternatively, the second difference parameter can also indicate the degree of overall difference between a set of adjacent pixels corresponding to the target pixel and a set of adjacent pixels adjacent to the pixels at the previous pseudo-contour. For example, the second difference parameter can be calculated as the difference between the pixel accumulated value of a set of adjacent pixels related to the currently detected target pixel and the pixel accumulated value of a set of adjacent pixels adjacent to the pixels at the previous pseudo-contour (obtained based on a pseudo-contour detection window of the same size). If the second difference parameter exceeds the predetermined lower threshold, it indicates that the target pixel is at the pseudo-contour. Therefore, the second difference parameter similarly corresponds to the overall difference between the pixel values of two adjacent strips; similarly, the second difference parameter should be less than the predetermined upper threshold, because if the second difference parameter is too large, the real image edge will be misidentified as a pseudo-contour.

[0044] In some embodiments, it can be determined whether the target pixel is at the pseudo-contour of the target arrangement based on the determined first difference parameter and second difference parameter. Specifically, if the first difference parameter belongs to the first predetermined range and the second difference parameter belongs to the second predetermined range, it is determined that the target pixel is at the pseudo-contour of the target arrangement; otherwise, it is determined that the target pixel is not at the pseudo-contour.

[0045] In some embodiments, other difference parameters related to the target pixel can also be calculated, and it can be determined whether the target pixel is at a pseudo contour based on the first difference parameter, the second difference parameter, and the other difference parameters. For example, a third difference parameter can be determined, which can indicate the maximum pixel difference of the set of adjacent pixels corresponding to the target pixel, that is, the difference between the maximum pixel value and the minimum pixel value in the set of adjacent pixels. Generally speaking, the maximum pixel difference should not be too large. For example, it should not exceed a predetermined threshold, and the predetermined threshold can take a value of, for example, 2 to 20. In some preferred embodiments, the predetermined threshold corresponding to the maximum pixel difference can be an adaptive threshold that varies with the pixel value of the target pixel. It can be understood that the larger (brighter) the pixel value of the target pixel, the larger the predetermined threshold can be.

[0046] Still referring to Figure 1 , in step 104, if the relevant calculation result for the currently processed target pixel indicates that the target pixel is not at a pseudo contour, then it can be shifted to the next adjacent pixel, and the detection operation of whether the pixel is at a pseudo contour can be repeated. However, if it is detected that the current pixel is at a pseudo contour, then it is necessary to eliminate the pseudo contour from the target image, that is, adjust the pixel values of the target pixel adjacent to the pixel at the pseudo contour and one or more adjacent pixels thereof, so that the pixel value transition in the adjacent region of the target pixel is more natural, and the visual discomfort caused by the pseudo contour is reduced or avoided.

[0047] Next, in step 106, in response to detecting a pseudo contour between two adjacent first bands and second bands on the target arrangement, predict the second band width of the second band based at least on the first band width of the first band before the pseudo contour.

[0048] As described above, the currently detected pseudo contour is located between two adjacent first bands and second bands on the target arrangement. Therefore, the width of the first band can be calculated by comparing the position of the current pixel (the current pseudo contour) with the position of the previous pseudo contour. In other words, the first band can start from the previous pseudo contour and end at the current pseudo contour. Generally speaking, for two adjacent bands in the same image, their widths usually do not differ much. Therefore, the width of the unknown subsequent band (the second band) can be predicted based on the width of the known previous band (the first band) among the two adjacent bands. Herein, the so-called unknown band refers to a band for which only the starting position (i.e., the position of the current pseudo contour) can be determined, and the ending position (i.e., the position of the next pseudo contour) cannot or has not been determined yet.

[0049] In some embodiments, the width of the first band may be used as a predicted value for the width of the second band. Due to reasons such as image noise, the detection of pseudo-contours may be inaccurate. In particular, pixels relatively close to the previous pseudo-contour may be detected and recognized as pseudo-contours, thus erroneously shortening the width of the first band. To avoid errors caused by image noise interference or other interferences, in some preferred embodiments, the width of the second band may be predicted by the following method: First, the width of the first band may be compared with a reference band width; and when the width of the first band is greater than the reference band width, the width of the first band may be used as the predicted value for the width of the second band, while when the width of the first band is not greater than the reference band width, the average value of the width of the first band and the reference band width may be used as the predicted value for the width of the second band. Among them, the reference band width may be the predicted value of the width of the first band, which is determined when detecting and recognizing the previous pseudo-contour of the currently detected pseudo-contour, and may be saved for subsequent processing. It can be understood that the prediction of the first band involves a band before the first band, and the predicted value of the width of the first band is also predicted based on the actual width of the previous band. Since the width changes of two or more adjacent bands in the same arrangement may not be significant, comprehensively considering the predicted value and the actual value of the width of the first band to predict the width of the second band can reduce the interference and influence of noise on the prediction of the width of subsequent bands.

[0050] In some embodiments, when predicting the width of the second band, the predicted width value may also be limited. In other words, the predicted width of the second band should not be too large. The reason for limiting the predicted width value is, on the one hand, to store information with fewer hardware storage resources during actual processing, and on the other hand, to make the interpolation calculation result more consistent with the actual changes of the image during subsequent pseudo-contour removal interpolation processing (see below), because the interpolation calculation is performed on at least some pixels within the second band range. In one example, the predicted value of the width of the second band may be limited based on a second difference parameter indicating the overall difference degree within a group of adjacent pixels. For example, the upper threshold value of the predicted value of the width of the second band may be 3 to 6 times the second difference parameter (as described above, assuming that the pixel value is an 8-bit depth value and the units of these two parameters are not considered).

[0051] It can be understood that in some cases, the target pixel is detected to be at the image edge, for example, any one of the first difference parameter, the second difference parameter, or the third difference parameter exceeds its corresponding upper threshold. At this time, the adjacent area before the target pixel cannot be regarded as a stripe, so the information used to predict the width of the second stripe can be reset. This can avoid saving incorrect information for subsequent pseudo-contour elimination calculations. It can be understood that when recalculating after reset, especially when determining the width of the first stripe, the first stripe can start from the image edge and end at the current pseudo-contour.

[0052] In some cases, in addition to using the width of the first stripe in the target arrangement to predict the width of the second stripe, stripes adjacent to the first stripe or other stripes with positions close to the first stripe in the original image can also be used to predict or correct the width of the second stripe. These adjacent stripes can be located in two arrangements adjacent to the target arrangement along the non-target direction (in Figure 2 the example shown, the non-target direction is the row direction). For example, in Figure 2 the example shown, the columns where pixels u0 to u6 are located and the columns where pixels d0 to d6 are located are two arrangements adjacent to the target arrangement. It can be understood that depending on the actual pixel values of the columns where pixels u0 to u6 are located and the columns where pixels d0 to d6 are located, the start and / or end positions of the stripes corresponding to the first stripe on these two columns may not be aligned with the start and / or end positions of the first stripe, and may have a width different from the width of the first stripe. For example, the stripe corresponding to the first stripe on the column where pixels u0 to u6 are located may end at u2 (i.e., u2 is recognized as a pseudo-contour). If the target pixel a3 in the first stripe is recognized as a pseudo-contour, then u2 is the pixel closest to the target pixel a3 among the pixels u0 to u6 in the column that is recognized as a pseudo-contour; the stripe corresponding to the first stripe on the column where pixels d0 to d6 are located may end at d0, which is also the pixel closest to the target pixel a3 above the target pixel a3.

[0053] In one example, considering the widths of the adjacent stripes on the adjacent arrangements comprehensively, the predicted value band2_width of the second stripe width can be corrected by the following equation (1):

[0054] band2_width = (band_width_u + 2 * band1_width + band_width_d) / 4 (1)

[0055] Among them, band1_width represents the actual width of the first band, band_width_u represents the actual width of the band corresponding to the first band on the column where pixels u0 to u6 are located, and band_width_d represents the actual width of the band corresponding to the first band on the column where pixels d0 to d6 are located. It can be understood that although these three bands are on different columns, since they are adjacent in the row direction, they usually have the same or similar image characteristics. Therefore, the predicted value of the band width on the target arrangement being currently processed can be corrected based on the band widths on adjacent non-target arrangements. It can be understood that in some other embodiments, the predicted value of the band width currently being processed on the target arrangement can also be corrected based on the band widths on more adjacent non-target arrangements.

[0056] Return to Figure 1 , then, in step 108, pixel interpolation processing can be performed on at least a part of the pixels in the second band to eliminate false contours. It can be understood that the second band described here is the range of the predicted second band.

[0057] Figure 3 shows a schematic diagram of performing pixel interpolation processing on the target arrangement. As Figure 3 shown, based on the information of the pixels obtained from the false contour detection window, it is determined that the target pixel is at false contour 1. Correspondingly, pixel interpolation processing is performed on the second band starting from false contour 1 and having the predicted width of the second band, and this second band is predicted to end at the predicted false contour 2.

[0058] In some embodiments, pixel interpolation processing can be performed on all the pixels in the second band; while in some other embodiments, pixel interpolation processing can also be performed only on a part of the pixels in the second band. In the Figure 3 shown example, pixel interpolation processing can be performed on the pixels within the range starting from the target pixel (at false contour 1) but not exceeding 3 / 4 (75%) of the predicted value of the length of the second band. It can be understood that in some other examples, pixel interpolation processing can also be performed on other proportional amounts of the pixels of the predicted value of the length of the second band, such as 60%, 70%, 80%, 85%, 90%, 95% or higher. This pixel interpolation processing can make the pixel values of the interpolated pixels in the first band gradually change from the pixel values of the first band to be equal to or close to the pixel values of the second band. Among them, since the second band generally has the same or similar pixel values, the pixel values of this second band can be represented by the pixel values of the target pixels located at the false contour (i.e., between the first band and the second band).

[0059] In some embodiments, pixel interpolation processing can be implemented through interpolation smoothing filtering processing. Preferably, a linear interpolation smoothing filtering algorithm can be used to implement pixel interpolation processing. Specifically, with reference toFigure 2 and Figure 3 , taking the interpolation process of only the pixels within 3 / 4 (75%) of the predicted value of the length of the second band as an example, the pixel value P of the interpolated pixel with a target pixel pitch of d can be represented by the following equation (2):

[0060] P = (band1_avg * (3 / 4 * band2_width - d) + sum * d) / (3 / 4 * band2_width * win_width) Equation (2)

[0061] where band1_avg represents the average pixel value of the pixels in the first band. In some embodiments, it can be represented by the pixel value of pixel a0 (refer to Figure 2 , assuming that the target pixel a3 is at the pseudo contour 1); band2_width is the predicted value of the width of the second band, and sum is the average pixel value of the pixels in the current interpolation window. In some embodiments, band1_avg can be represented by the pixel value of pixel a6 (refer to Figure 2 , assuming that the target pixel a3 is at the pseudo contour 1); d represents the distance of the current pixel from the pseudo contour 1; win_width represents the width of the window (the current interpolation window) where the current pixel is located, which is, for example, 7. It can be seen that in the preferred embodiments, the average values of multiple pixels can be used to participate in the interpolation process, which can make the transition smoother.

[0062] It should be noted that the interpolation method shown in Equation (2) is only exemplary. In some other embodiments, other interpolation algorithms can also be used to calculate the pixel values of some or all of the pixels in the predicted second band range.

[0063] It can be understood that based on Figure 1 the method shown, the pseudo contours in the image can be identified and eliminated through interpolation. During the processing, in addition to identifying pseudo contours, this method can also detect and determine other non-pseudo contour regions in the image, such as the image edge regions. For the pixels in these non-pseudo contour regions, if they are at the image edge, the original pixel values of these pixels can be directly output without interpolation or adjustment. In some processing, when the distance between two pseudo contours is small, that is, the strip width defined by them is small, instead of using interpolation smoothing filtering, other alternative interpolation algorithms, such as average filtering, can be used to eliminate the pseudo contours.

[0064] In some embodiments, the pixel value of a pixel in the image obtained after being processed by the above embodiments of the present invention may have a relatively large change compared to the pixel value of the previous pixel adjacent to it in the same arrangement, and this change can be referred to as an increase amplitude. In some embodiments, amplitude correction can be performed on the processed image to avoid some undesired overly large pixel value changes in the processed image. Specifically, it can be Figure 1 After step 108 shown in, add a step of amplitude correction. In this step, when the pixel value change between a certain pixel and its adjacent pixel exceeds a preset or adaptive amplitude threshold, amplitude correction processing can be performed on the pixel value of this pixel.

[0065] It can be understood that for different regions in the image, the actually applied amplitude correction algorithms may be different. If the current pixel is in a flat region where pseudo - contour elimination is required, then a relatively small amplitude threshold (delta_th1) can be applied when performing amplitude limit processing on it. At this time, if the difference between the pixel value of the current pixel (obtained based on the interpolation algorithm) and the pixel value of the previous pixel (the pixel value after pseudo - contour removal) in the same arrangement (the same row or the same column) is greater than the amplitude threshold delta_th1, then amplitude correction can be performed on the current pixel; if it does not exceed the amplitude threshold delta_th1, then amplitude correction can be not performed and the pixel value obtained by interpolation can be used. In some embodiments, the amplitude threshold delta_th1 can be an adaptive threshold, and its value range is, for example, from 1 to 4.

[0066] On the other hand, for pixels in the actual edge region of the image, their increase amplitude compared to the previous pixel in the same row or the same column may actually be relatively large. Therefore, when performing amplitude limit processing on them, a larger amplitude threshold (delta_th2) can be applied. At this time, if the difference between the pixel value of the current pixel (obtained based on the interpolation algorithm) and the pixel value of the previous pixel (the pixel value after pseudo - contour removal) in the same arrangement (the same row or the same column) is greater than the amplitude threshold delta_th2, then amplitude correction can be performed on the current pixel; and if it does not exceed the amplitude threshold delta_th2, then amplitude correction can be not performed and the pixel value obtained by interpolation can be used. In some embodiments, the amplitude threshold delta_th2 applicable to the edge region can be greater than the amplitude threshold delta_th1 applicable to the flat region, and its value range is, for example, from 1 to 6.

[0067] In practical applications, the edge region usually includes different pixels with significant differences. The differences between the pixel values of these different pixels after interpolation processing may indeed be relatively large. Therefore, not all pixels in the edge region need to be corrected for amplitude increase according to the above judgment method, or at least it cannot be determined whether amplitude increase correction is required only by relying on the amplitude increase threshold delta_th2. Instead, the pixel value differences between different pixels before processing need to be considered. Accordingly, in some preferred embodiments, if the differences between the current pixel and its previous and next pixels in the original image are both less than a reference threshold delta_th (which indicates that there is no obvious difference in the pixel values between the current pixel and its adjacent pixels), but when the difference between the pixel value of the current pixel after interpolation calculation and its previous pixel is greater than the amplitude increase threshold (delta_th2), this indicates that the interpolation processing may inappropriately increase the pixel value difference between the current pixel and its previous pixel. Therefore, at this time, the pixel value of the current pixel needs to be corrected. The reference threshold delta_th can be equal to or greater than the amplitude increase threshold delta_th2. Both of these thresholds are user-defined thresholds, and their value ranges are, for example, from 2 to 6.

[0068] Similarly, for a part of the pixels outside the flat region at non-edge locations, that is, if the image has not detected pseudo-contours when processing the current pixel, or the pixel before the current pixel in the same arrangement is detected as being at the image edge, or the stripe width calculated for the current pixel (that is, it is detected that the current pixel is at a pseudo-contour location) is relatively small, then at this time, if it is further determined that the difference between the pixel value of the current pixel and the actual pixel value of its previous pixel after correction is greater than the amplitude increase threshold delta_th1, then the pixel value of the current pixel needs to be corrected for amplitude increase. In some embodiments, the amplitude increase threshold delta_th1 can also be an adaptive threshold, and its value range is, for example, from 1 to 4.

[0069] In some embodiments, the correction of the pixel values in the flat region can be calculated using the following equations (3) to (6):

[0070] delta_value1 = (data_out_tmp - prev_output) / 6 (3)

[0071] delta_value = delta_value1 + prev_delta (4)

[0072] data_out = INT(prev_output + delta_value) (5)

[0073] prev_delta = FRA(prev_output + delta_value) (6)

[0074] Among them, data_out_tmp represents the pixel value of the current pixel obtained by interpolation calculation; prev_output represents the pixel value of the previous pixel of the current pixel; prev_delta represents the fractional part of the corrected increment of the previous pixel, delta_value represents the corrected increment of the current pixel, and data_out represents the corrected pixel value of the current pixel. INT represents taking the integer part, FRA represents taking the fractional part, and data_out is an integer value. When the current pixel does not meet the increment correction condition, both delta_value and prev_delta are set to 0.

[0075] In some embodiments, for the correction of pixel values in non-flat regions, equations (7) and (4) to (6) can be applied for calculation.

[0076] delta_value1 = (data_out_tmp - prev_output) / 4 (7)

[0077] Equation (3) is similar to equation (7), except that the calculation method of delta_value1 is slightly different. This is because the change in pixel values in the flat region is relatively small. Therefore, taking this value to be smaller can make the output smoother.

[0078] It can be seen that through the increment correction, the difference in pixel values calculated by interpolation between adjacent pixels can be effectively adjusted, so that the processed image has a natural transition.

[0079] In some embodiments, the present application also provides some computer program products, which include non-transitory computer-readable storage media. The non-transitory computer-readable storage media include computer-executable code for executing Figure 1 the steps in the method embodiments shown. In some embodiments, the computer program product can be stored in a hardware device, such as an image processing device.

[0080] It can be seen that when the method of the present application is used to process an image, it can detect and count relevant information about the pseudo-contours in the image, and predict the width of the next adjacent strip using the width of the previous strip at the pseudo-contour that has been calculated. In this way, these statistical information can be used to eliminate the pseudo-contours in the original image through methods such as interpolation smoothing filtering, reducing the running memory and saving the hardware overhead of image processing while achieving the same image effect.

[0081] Embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated designed hardware. Those of ordinary skill in the art can understand that the above devices and methods can be implemented using computer-executable instructions and / or included in processor control code, such as provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, or can be implemented by a combination of the above hardware circuits and software such as firmware.

[0082] It should be noted that although several steps, sub-steps, or modules, sub-modules of methods and devices for eliminating false contours in images are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present application, the features and functions of two or more of the above-described modules can be embodied in one module. Conversely, the features and functions of one module described above can be further divided and embodied by multiple modules.

[0083] Those of ordinary skill in the art can understand and implement other changes to the disclosed embodiments by studying the specification, the disclosed content, the drawings, and the appended claims. In the claims, the term "comprising" does not exclude other elements and steps, and the terms "a", "an" do not exclude a plurality. In the actual application of the present application, a component may perform the functions of multiple technical features recited in the claims. Any reference signs in the claims should not be construed as limiting the scope.

Claims

1. A method for eliminating false contours in an image, characterized in that, The method includes: A) Receiving a target image, the target image including a two-dimensional pixel array arranged in rows and columns; B) Performing pseudo-contour detection on a target arrangement in the target image in one of the row direction and the column direction of the target image; C) In response to detecting a pseudo-contour between two adjacent first bands and a second band on the target arrangement, predicting at least the second band width of the second band based on the first band width of the first band; and D) Performing pixel interpolation processing on at least a part of the pixels in the second band to eliminate the pseudo-contour.

2. The method according to claim 1, characterized in that, The step B includes: Determining a target pixel on the target arrangement; Windowing the target arrangement with a pseudo-contour detection window to obtain a group of adjacent pixels adjacent to the target pixel; Determining a first difference parameter, the first difference parameter indicating the degree of individual pixel difference related to the target pixel; Determining a second difference parameter, the second difference parameter indicating the degree of overall difference between the group of adjacent pixels or between a group of adjacent pixels adjacent to the pixels at the previous pseudo-contour; and Determining whether the target pixel is at the pseudo-contour of the target arrangement at least according to the first difference parameter and the second difference parameter.

3. The method according to claim 2, wherein Determining the first difference parameter includes: Comparing the difference between two adjacent pixels adjacent to the target pixel; or Comparing the difference between the target pixel and the next adjacent pixel of the target pixel on the target arrangement.

4. The method according to claim 2, wherein Determining the second difference parameter includes: Comparing the difference between all adjacent pixels before the target pixel and all adjacent pixels after the target pixel in the group of adjacent pixels.

5. The method according to claim 2, wherein Determining the second difference parameter includes: Comparing the difference between the accumulated values of all pixels in the group of adjacent pixels and the accumulated values of all pixels in a group of adjacent pixels adjacent to the pixels at the previous pseudo-contour.

6. The method according to claim 2, characterized in that Determining whether the target pixel is at the pseudo-contour of the target arrangement at least according to the first difference parameter and the second difference parameter includes: When the first difference parameter belongs to a first predetermined difference range and the second difference parameter belongs to a second predetermined difference range, determining that the target pixel is at the pseudo-contour of the target arrangement.

7. The method according to claim 2, wherein The pseudo-contour detection window is a window centered on the target pixel with a width of not less than 5 pixels.

8. The method according to claim 2, wherein The step B further includes: Determining a third difference parameter, the third difference parameter indicating the maximum pixel difference of the group of adjacent pixels; and Determining whether the target pixel is at the pseudo-contour of the target arrangement according to the first difference parameter, the second difference parameter, and the third difference parameter.

9. The method according to claim 8, wherein Determining whether the target pixel is at the pseudo-contour of the target arrangement according to the first difference parameter, the second difference parameter, and the third difference parameter includes: When the first difference parameter belongs to a first predetermined difference range, the second difference parameter belongs to a second predetermined difference range, and the third difference parameter does not exceed a predetermined difference threshold, determining that the target pixel is at the pseudo-contour of the target arrangement.

10. The method according to claim 9, characterized in that, The predetermined difference threshold is an adaptive threshold related to the target pixel.

11. The method according to claim 1, characterized in that, Step C includes: Using the width of the first strip as the predicted value of the width of the second strip.

12. The method according to claim 1, wherein Step C includes: Comparing the width of the first strip with the width of a reference strip; and When the width of the first strip is greater than the width of the reference strip, using the width of the first strip as the predicted value of the width of the second strip; and when the width of the first strip is not greater than the width of the reference strip, using the average value of the width of the first strip and the width of the reference strip as the predicted value of the width of the second strip.

13. The method according to claim 12, wherein The width of the reference strip is the predicted value of the width of the first strip.

14. The method according to claim 11 or 12, wherein Step B includes: Determining a target pixel on the target arrangement; Windowing the target arrangement with a pseudo-contour detection window to obtain a group of adjacent pixels adjacent to the target pixel; and Determining a second difference parameter, the second difference parameter indicating the degree of overall difference within the group of adjacent pixels; Step C further includes: Limiting the predicted value of the width of the second strip based on the second difference parameter.

15. The method according to claim 11 or 12, characterized in that, Step C further includes: Using the strip widths of two strips corresponding to the first strip on two arrangements adjacent to the target arrangement in a non-target direction among the row direction and the column direction to correct the predicted value of the width of the second strip.

16. The method according to claim 1, characterized in that, The first strip starts from a pseudo-contour or an image edge.

17. The method according to claim 2, characterized in that, The interpolation process includes interpolation smoothing filtering.

18. The method according to claim 17, wherein At least a part of the pixels within the second strip start from the target pixel but do not exceed a range of 3 / 4 of the predicted value of the length of the second strip.

19. The method according to claim 1, characterized in that After step D, the method further includes: Performing an amplitude correction process on the pixels for which pixel interpolation is performed, so that the difference between each interpolated pixel and a pixel before the interpolated pixel on the target arrangement does not exceed a predetermined amplitude threshold.

20. The method according to claim 19, wherein The predetermined amplitude threshold is an adaptive threshold.

21. The method according to claim 19, wherein In the step of the amplitude correction process, different predetermined amplitude thresholds are applied to the pixels located in the flat area and the non-flat area of the image.

22. A non-transitory computer storage medium having one or more executable instructions stored thereon, the one or more executable instructions, when executed by a processor, perform a method for eliminating false contours in an image, characterized in that, The method includes: A) Receiving a target image, the target image including a two-dimensional pixel array arranged in rows and columns; B) Performing pseudo-contour detection on a target arrangement in the target image in one of the row direction and the column direction of the target image; C) In response to detecting a pseudo-contour between two adjacent first and second strips on the target arrangement, predicting at least the width of the second strip based on the width of the first strip; and D) Performing pixel interpolation on at least a part of the pixels within the second strip to eliminate the pseudo-contour.

23. An apparatus for eliminating false contours in an image, characterized in that, The device includes a non-transitory computer storage medium, on which one or more executable instructions are stored, and after being executed by a processor, the one or more executable instructions perform the following steps: A) Receiving a target image, the target image including a two-dimensional pixel array arranged in rows and columns; B) Detect pseudo-contours for a target arrangement in the target image in one of the row direction and the column direction of the target image; C) In response to detecting pseudo-contours between two adjacent first bands and a second band on the target arrangement, predict the second band width of the second band based at least on the first band width of the first band; And D) Perform pixel interpolation processing on at least a part of the pixels in the second band to eliminate the pseudo-contours.

Citation Information

Patent Citations

  • Reducing contours in digital images

    US20090304270A1

  • Image processing device, display device and image processing method, and its program

    US20100189349A1