Image processing method and system

By calculating and adjusting the pixel range and weights during the image reduction process, the problem of image reduction is solved and the image quality is improved.

CN119299873BActive Publication Date: 2025-03-28SHANGHAI WEIJING SEMICONDUCTOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411408851.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-03-28
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

Due to the reduction in image size, the resolution is reduced and pixel resampling is easily caused, which affects the image quality.

Method used

By determining the scaling coefficients in the horizontal and vertical directions, the pixel range of each pixel point in the original image is calculated, and the compensation coefficient is determined based on the reduction multiple, the pixel range is expanded to calculate the pixel mean and weight, and then the reduced pixel value is determined to reduce the sawtooth phenomenon.

Benefits of technology

By increasing the receptive field and adaptive weight adjustment, the brightness mutations and jagging between pixels in the reduced image are reduced, and image quality is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299873B_ABST
    Figure CN119299873B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method and system. The method includes: determining a first scaling factor in the horizontal direction and a second scaling factor in the vertical direction; obtaining a first pixel range corresponding to each pixel point in the second image in the first image based on the first scaling factor and the second scaling factor; determining a compensation factor based on the reduction factor between the first image and the second image, and using the compensation factor to expand the first pixel range to obtain a second pixel range in the first image, wherein the compensation factor increases as the reduction factor increases; calculating a pixel mean and a pixel weight of each pixel in the second pixel range based on the second pixel range in the first image, and determining a pixel value of each pixel in the second image based on the pixel mean and the pixel weight of each pixel in the second pixel range, so as to suppress the aliasing generated when the first image is reduced to the second image. The method can be used to suppress the aliasing generated when the image is reduced to improve the image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method and system. Background Art

[0002] Aliasing in an image can be caused by insufficient image resolution or an inadequate image processing algorithm. Aliasing can occur on the edges of diagonal or curved lines, making the edge look like a series of steps rather than a smooth curve or line. For example, when an image is reduced, especially when it is reduced by a high magnification, due to the large reduction ratio, strong contrast aliasing will be generated in the image, thus affecting the image quality.

[0003] Therefore, how to suppress the aliasing produced when the image is reduced is an urgent problem to be solved. Summary of the invention

[0004] In view of this, the present application discloses an image processing method and system for suppressing aliasing generated when an image is reduced, so as to improve image quality.

[0005] In a first aspect, the present application discloses an image processing method for suppressing aliasing generated when a first image is reduced to a second image, the method comprising: determining a first scaling factor in the horizontal direction and a second scaling factor in the vertical direction; obtaining a first pixel range corresponding to each pixel point in the second image in the first image based on the first scaling factor and the second scaling factor; determining a compensation coefficient based on the reduction factor between the first image and the second image, and using the compensation coefficient to expand the first pixel range to obtain a second pixel range in the first image, wherein the compensation coefficient increases with the increase in the reduction factor; calculating a pixel mean and a pixel weight of each pixel in the second pixel range based on the second pixel range in the first image, and determining a pixel value of each pixel in the second image based on the pixel mean and the pixel weight of each pixel in the second pixel range, so as to suppress aliasing generated when the first image is reduced to the second image, wherein the smaller the difference between the pixel value of the pixel in the second pixel range and the pixel mean, the greater the pixel weight.

[0006] Optionally, determining a first scaling factor in the horizontal direction and a second scaling factor in the vertical direction includes: calculating a quotient of a width of the first image and a width of the second image to obtain the first scaling factor; and calculating a quotient of a length of the first image and a length of the second image to obtain the second scaling factor.

[0007] Optionally, the second image includes a target pixel point; the first starting coordinate of the first pixel range in the horizontal direction is the product of the horizontal coordinate of the target pixel point and the first scaling factor, and the first ending coordinate in the horizontal direction is the sum of the first starting coordinate and the first scaling factor; the second starting coordinate of the first pixel range in the vertical direction is the product of the vertical coordinate of the target pixel point and the second scaling factor, and the second ending coordinate in the vertical direction is the sum of the second starting coordinate and the second scaling factor.

[0008] Optionally, the compensation coefficient is between 0.1 and 0.4; the third starting coordinate of the second pixel range in the horizontal direction is the first starting coordinate minus the product of the compensation coefficient and the first scaling factor, and the third ending coordinate in the horizontal direction is the first ending coordinate plus the product of the compensation coefficient and the first scaling factor; the fourth starting coordinate of the second pixel range in the vertical direction is the second starting coordinate minus the product of the compensation coefficient and the second scaling factor, and the fourth ending coordinate in the vertical direction is the second ending coordinate plus the product of the compensation coefficient and the second scaling factor.

[0009] Optionally, the pixel mean is the quotient of the sum of the pixel values ​​of all pixels in the second pixel range and the number of pixels in the second pixel range; the calculation formula for the pixel weight of each pixel in the second pixel range is as follows:

[0010]

[0011] Among them, weight (x,y) is the pixel weight of the pixel with coordinates (x, y) in the second pixel range, MeanI [strat,end] is the pixel mean, I max is the maximum depth of the first image.

[0012] Optionally, the pixel value of each pixel in the second image is determined based on the pixel mean and the pixel weight of each pixel in the second pixel range, and the calculation formula is as follows:

[0013]

[0014] Wherein, startXnew is the starting coordinate of the second pixel range in the horizontal direction, endXnew is the ending coordinate of the second pixel range in the horizontal direction, startYnew is the starting coordinate of the second pixel range in the vertical direction, endYnew is the ending coordinate of the second pixel range in the vertical direction, I(x,y) is the pixel value of the pixel point with coordinates (x,y) in the second pixel range, dst (i,j) is the pixel value of the pixel with coordinates (i, j) in the second image.

[0015] Optionally, the image processing method further includes: after determining the pixel value of each pixel in the second image, performing a domain smoothing process on the second image in units of pixels to suppress brightness abnormalities in the second image.

[0016] Optionally, the community smoothing process includes low-pass filtering, and weighted summing the result of the low-pass filtering and the pixel value of each pixel in the second image is performed to optimize the second image.

[0017] Optionally, the filter window of the low-pass filter increases as the reduction factor increases.

[0018] In a second aspect, the present application discloses an image processing system, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the image processing method disclosed in the first aspect above.

[0019] In summary, the image processing method and system disclosed in the present application have at least the following beneficial effects: by increasing the receptive field, the transition between each pixel point in the reduced image is made more continuous; adaptive weight adjustment can reduce the brightness mutation between adjacent pixels in the reduced image; a smoothing post-processing operation is performed on the initially obtained reduced image to reduce the abnormal prominence of excessive darkness and excessive brightness; through the above measures, the jagged phenomenon generated when the image is reduced can be reduced, thereby improving the image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The following is a brief introduction to the drawings used in describing the embodiments of the present application:

[0021] Figure 1 An example diagram of an image processing method in the prior art is shown.

[0022] Figure 2 A flowchart illustrating an image processing method provided in an embodiment of the present application is shown.

[0023] Figure 3 A before-and-after comparison diagram of a pixel range provided in an embodiment of the present application is shown.

[0024] Figure 4 A diagram showing an example of a value of a weight coefficient provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the specific implementation methods of the present application will be described below with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other accompanying drawings and other implementation methods can be obtained based on these drawings without creative work. Adjustments and improvements made without departing from the concept of the present application are all within the scope of protection of the present application.

[0026] In order to simplify the drawings, only the parts related to the corresponding embodiments are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, only part of the components with the same structure or function in some figures are schematically drawn, and there may be more or fewer components with the same structure or function in reality.

[0027] In this application, unless otherwise clearly specified and limited, ordinal numbers, such as "first", "second", etc., are only used to distinguish and describe associated objects, and cannot be understood as indicating or implying the relative importance or order between associated objects; in addition, they do not represent the number of associated objects. "Multiple" includes two or more, and other quantifiers are similar. " / " is used to describe the relationship between associated objects, which indicates the "or" relationship between associated objects. "And / or" is used to describe the relationship between associated objects, which includes any combination relationship between associated objects, such as "a and / or b" includes: "alone a", "alone b", or "a and b". "One or more" or "at least one" in multiple objects refers to any object or any combination of multiple objects, such as "one or more of a1, a2, a3" or "at least one of a1, a2, a3" includes: "alone a1", "alone a2", "alone a3", "a1 and a2", "a1 and a3", "a2 and a3", or "a1, a2 and a3".

[0028] Aliasing is a common problem in image processing. It can occur where there are diagonal lines, curves or diagonal edges in the image, and the edges appear stepped and not smooth. This is because images are made up of discrete pixels. When the direction of the lines or curves in the image is not completely aligned with the pixel arrangement, the pixels cannot show continuity well, so the lines or curves become uneven, resulting in aliasing. The essence of aliasing is a problem caused by digital sampling. In digital image processing, the scene or graphic is converted into a pixel grid. This is a discretization process that introduces some inaccurate sampling. These insufficient sampling problems make it impossible to completely restore continuous lines in the image, especially those that are diagonal to the pixel grid.

[0029] Common causes of aliasing include insufficient resolution, discretization problems, and undersampling. When the resolution is too low, the limited number of pixels cannot accurately describe the details of the line or curve, causing the edge to appear rough and stair-step. When the elements in the image are divided into discrete pixels rather than continuous signals, the lines and curves are discretized onto the pixel grid, and the diagonal lines and curves are prone to aliasing. In digital images, if the sampling rate is lower than the Nyquist frequency, image details are lost, resulting in aliasing.

[0030] When the image is reduced, due to the reduction of image resolution and pixel resampling, aliasing may also occur. When the image is reduced, the original number of pixels is reduced, and more information needs to be compressed into fewer pixels. For example, the original length of 10 pixels may become 5 pixels after reduction. In this process, many original details will be discarded, especially at the edge of the image. Since the redistribution of these edge pixels can no longer accurately express the details of the original lines or curves, discontinuous aliasing appears on the edges. In addition, reducing the image means resampling the image. If there are not enough sampling points during resampling, or there are high-frequency details in the image that exceed the sampling capacity, insufficient sampling will occur, resulting in aliasing effects. Aliasing effects refer to the situation that when the signal is undersampled, the high-frequency components appear as wrong information in the low-frequency components, resulting in aliasing on the edges. In addition, when the image is reduced, each original pixel will be mapped to a new smaller grid, but not all pixels can be accurately mapped. In particular, when the lines or edges in the original image are not aligned with the new pixel grid when reduced, these misalignments will cause the new pixels to fail to correctly represent the original image contours, resulting in aliasing. In addition, when reducing an image, the color information of the image edge may be processed inaccurately. When the color transition of the edge is simplified or not filtered, the edge of the image after reduction will appear rougher, resulting in more obvious aliasing, which will reduce the image quality. Therefore, reliable image processing methods are urgently needed to solve the aliasing that may occur when the image is reduced.

[0031] Among the image processing methods in the prior art, the most versatile ones are the common methods such as interArea interpolation, Lanczos interpolation or Bilinear. When zooming at a small magnification (e.g., a magnification less than 8 times), these algorithms can have a good image effect, that is, good sharpness and good image continuity. However, when the reduction ratio is a large ratio (e.g., a large ratio of 8 times or more), there is still a clear jagged feeling in the reduced image.

[0032] The idea of ​​the above image processing method can be roughly divided into the following two parts. The first part is to calculate the original image coordinate range corresponding to the coordinates of the reduced image through the scaling factor (for example: the X direction (that is, horizontal direction) and Y direction (that is, vertical direction) coordinate range corresponding to a certain pixel in the reduced result image in the original image: [startX, endX], [startY, endY]). The second part is to perform weighted fusion on the pixels in the corresponding coordinate range of the original image to obtain the pixel value after reduction (that is, to perform weighted fusion on all pixels in the range of [startX, endX], [startY, endY] in the first part). The image composed of these pixels is the reduced image. Figure 1 An example diagram of an image processing method in the prior art is shown. Figure 1 , there are two 8*8 pixel areas in the original image (each small square represents one pixel), which are reduced by 8 times to obtain two pixels in the reduced image, that is, each pixel in the reduced image is obtained by weighted fusion of 64 pixels in the original image. In this high-magnification reduction process, since a large number of pixels are fused into one pixel output, the pixel difference between two adjacent pixels after output is likely to be too large, and the pixel value is excessively discontinuous, making the aliasing effect obvious.

[0033] In order to solve the above problems existing in the prior art, the present application discloses an image processing method and system for suppressing aliasing generated when an image is reduced, so as to improve the image quality.

[0034] Figure 2 FIG. 1 shows an example flow chart of an image processing method provided by an embodiment of the present application. Figure 2 As shown, an image processing method is used to suppress aliasing generated when a first image is reduced to a second image, and the method includes:

[0035] S100, determining a first scaling factor in the horizontal direction and a second scaling factor in the vertical direction;

[0036] S200, obtaining a first pixel range corresponding to each pixel point in the second image in the first image based on the first scaling factor and the second scaling factor;

[0037] S300, determining a compensation coefficient based on a reduction ratio between the first image and the second image, and using the compensation coefficient to expand the first pixel range to obtain a second pixel range in the first image, wherein the compensation coefficient increases as the reduction ratio increases;

[0038] S400, calculating a pixel mean and a pixel weight of each pixel in the second pixel range in the first image based on the second pixel range, and determining a pixel value of each pixel in the second image based on the pixel mean and the pixel weight of each pixel in the second pixel range, so as to suppress aliasing generated when the first image is reduced to the second image, wherein the smaller the difference between the pixel value of the pixel in the second pixel range and the pixel mean is, the larger the pixel weight is.

[0039] In the present application, the first image can be regarded as the image before reduction, and the second image can be regarded as the image after the first image is reduced; and the reduction ratio from the first image to the second image can be set in advance, for example, it can be a high ratio of 8 times or more. The horizontal direction can be understood as the x direction of the coordinate axis, and the vertical direction can be understood as the y direction of the coordinate axis.

[0040] First, the first scaling factor in the horizontal direction and the second scaling factor in the vertical direction must be determined, that is, the corresponding scaling factors are determined according to the length and width of the image before and after reduction. In some embodiments of the present application, determining the first scaling factor in the horizontal direction and the second scaling factor in the vertical direction includes: calculating the quotient of the width of the first image and the width of the second image to obtain the first scaling factor; calculating the quotient of the length of the first image and the length of the second image to obtain the second scaling factor. For example, in the horizontal direction, the first scaling factor scaleX = inW / outW, where scaleX is the first scaling factor, inW represents the width of the first image, that is, the number of pixels included in the wide side of the first image, and outW represents the width of the second image, that is, the number of pixels included in the wide side of the second image. In this way, the first scaling factor in the horizontal direction can be obtained. Based on the same method as above, the quotient of the length of the first image and the length of the second image can be calculated to obtain the second scaling factor, and the calculation formula is as follows: scaleY=inL / outL, where scaleY is the second scaling factor, inL represents the length of the first image, that is, the number of pixels included in the long side of the first image, and outL represents the length of the second image, that is, the number of pixels included in the long side of the second image. Thus, the second scaling factor in the vertical direction can be obtained.

[0041] Subsequently, the first pixel range corresponding to each pixel point in the second image in the first image is obtained based on the first scaling factor and the second scaling factor. The second image may include several pixel points, and one of the pixel points is now described as the target pixel point, and the remaining pixel points in the second image can be processed accordingly with reference to the situation of the target pixel point. The first pixel range is the area corresponding to the target pixel point in the first image, and the boundary value of the first pixel range can be calculated according to the first scaling factor and the second scaling factor, that is, the position of the first pixel range in the first image is determined. The first pixel range can be, for example, a square area. In some embodiments of the present application, the first starting coordinate of the first pixel range in the horizontal direction is the product of the horizontal coordinate of the target pixel point and the first scaling factor, and the first ending coordinate in the horizontal direction is the sum of the first starting coordinate and the first scaling factor; the second starting coordinate of the first pixel range in the vertical direction is the product of the vertical coordinate of the target pixel point and the second scaling factor, and the second ending coordinate in the vertical direction is the sum of the second starting coordinate and the second scaling factor. Taking the horizontal direction as an example, the calculation formula is as follows: startX=i*scaleX, endX=startX+scaleX. Where i is the horizontal coordinate of the target pixel, startX is the first starting coordinate, scaleX is the first scaling factor, and endX is the first ending coordinate. Similar to the horizontal direction, the second starting coordinate and the second ending coordinate in the vertical direction can be obtained, and the calculation formula is as follows: startY=j*scaleY, endY=startY+scaleY. Where j is the vertical coordinate of the target pixel, startY is the second starting coordinate, scaleY is the second scaling factor, and endY is the second ending coordinate. Therefore, according to the first starting coordinate, the first ending coordinate, the second starting coordinate, and the second ending coordinate, the position of the first pixel range corresponding to the target pixel in the first image can be determined (since the first pixel range is a square range, the values ​​of its four vertices are determined, and its overall position can also be determined).

[0042] For the first pixel range obtained in the above embodiment, the transition between each pixel point in the second image can be made more continuous by increasing its receptive field. Exemplarily, the first pixel range can be expanded according to the reduction factor to achieve the purpose of increasing the receptive field. That is, a compensation coefficient is determined based on the reduction factor between the first image and the second image, and the first pixel range is expanded using the compensation coefficient to obtain the second pixel range in the first image, wherein the compensation coefficient increases as the reduction factor increases.

[0043] In some embodiments of the present application, the value of the compensation coefficient is between 0.1 and 0.4; the third starting coordinate of the second pixel range in the horizontal direction is the first starting coordinate minus the product of the compensation coefficient and the first scaling coefficient, and the third ending coordinate in the horizontal direction is the first ending coordinate plus the product of the compensation coefficient and the first scaling coefficient; the fourth starting coordinate of the second pixel range in the vertical direction is the second starting coordinate minus the product of the compensation coefficient and the second scaling coefficient, and the fourth ending coordinate in the vertical direction is the second ending coordinate plus the product of the compensation coefficient and the second scaling coefficient. The calculation formula in the horizontal direction is as follows: startXnew = i*scaleX-α*scaleX, endXnew = startX+scaleX+α*scaleX; where startXnew is the third starting coordinate, α is the compensation coefficient, and endXnew is the third ending coordinate. Similarly, the calculation formula in the vertical direction is as follows: startYnew = j*scaleY-α*scaleY, endYnew = startY+scaleY+α*scaleY; where startYnew is the fourth starting coordinate, α is the compensation coefficient, and endYnew is the fourth ending coordinate.

[0044] It can be seen from the above embodiments that the second pixel range is determined by the third starting coordinate, the third ending coordinate, the fourth starting coordinate and the fourth ending coordinate; and, compared with the vertex values ​​of the first pixel range, the third starting coordinate is smaller than the first starting coordinate, the third ending coordinate is larger than the first ending coordinate, the fourth starting coordinate is smaller than the second starting coordinate, and the fourth ending coordinate is larger than the second ending coordinate. Therefore, the second pixel range uses the supplementary coefficient to increase the receptive field on the basis of the first pixel range, so that the transition between pixels after reduction is more continuous. Figure 3 A before-after comparison diagram of a pixel range provided in an embodiment of the present application is shown. Figure 3 , with the dotted line as the boundary, the pixel range above the dotted line can be considered as the first pixel range (for ease of distinction, it is called the upper figure), and the pixel range below the dotted line can be considered as the second pixel range (for ease of distinction, it is called the lower figure). Figure 3 The horizontal direction is used as an example in this article. The vertical direction can also be referred to Figure 3In the figure above, the mark A in the figure is the first starting coordinate, B is the first ending coordinate, C is the second starting coordinate, and D is the second ending coordinate; correspondingly, in the figure below, A is the third starting coordinate, B is the third ending coordinate, C is the fourth starting coordinate, and D is the fourth ending coordinate. Comparing the figure below with the figure above, it can be seen that the second pixel range is expanded by 2 pixels in the horizontal direction compared to the first pixel range, that is, part of the content in the adjacent pixel range is included, so that the adjacent pixels in the second image can have a smoother transition and reduce aliasing. It should be noted that Figure 3 This is merely used as an example. In actual operation, the increase in the horizontal direction of the second pixel range compared to the first pixel range is not necessarily limited to being increased by 2 pixels on the left and right.

[0045] After increasing the receptive field, the brightness mutation between adjacent pixels of the reduced image (i.e., the second image) can also be reduced by adaptive weight adjustment processing. Exemplarily, in the first image, the pixel mean and the pixel weight of each pixel in the second pixel range are calculated based on the second pixel range, and the pixel value of each pixel in the second image is determined based on the pixel mean and the pixel weight of each pixel in the second pixel range to suppress the aliasing generated when the first image is reduced to the second image, wherein the smaller the difference between the pixel value of the pixel in the second pixel range and the pixel mean, the greater the pixel weight. In other words, the closer the pixel is to the mean, the greater the weight it participates in, and the farther the pixel is from the mean, the smaller the weight it participates in. In some embodiments of the present application, the pixel mean is the quotient of the sum of the pixel values ​​of all pixels in the second pixel range and the number of pixels in the second pixel range; the calculation formula for the pixel weight of each pixel in the second pixel range is as follows:

[0046]

[0047] Among them, weight (x,y) is the pixel weight of the pixel with coordinates (x, y) in the second pixel range, MeanI [strat,end] is the pixel mean, I max is the maximum depth of the first image. max The value of is determined by the hardware device that acquires the image. For example, in an 8-bit image, I max =255, in 12-bit images I max =4095.

[0048] In some embodiments of the present application, the pixel value of each pixel in the second image is determined based on the pixel mean and the pixel weight of each pixel in the second pixel range, and the calculation formula is as follows:

[0049]

[0050] Wherein, startXnew is the starting coordinate of the second pixel range in the horizontal direction (that is, the third starting coordinate in the above embodiment), endXnew is the ending coordinate of the second pixel range in the horizontal direction (that is, the third ending coordinate in the above embodiment), startYnew is the starting coordinate of the second pixel range in the vertical direction (that is, the fourth starting coordinate in the above embodiment), endYnew is the ending coordinate of the second pixel range in the vertical direction (that is, the fourth ending coordinate in the above embodiment), I(x, y) is the pixel value of the pixel point with coordinates (x, y) in the second pixel range, dst (i,j) is the pixel value of the pixel point with coordinates (i, j) in the second image. Through the above adaptive weight adjustment, the brightness mutation between adjacent pixels in the reduced image can be reduced.

[0051] In some embodiments of the present application, the image processing method further includes: after determining the pixel value of each pixel in the second image, performing domain smoothing on the second image in units of pixels to suppress brightness anomalies in the second image. By performing a post-smoothing operation on the initially obtained reduced image, the abnormal prominence of being too dark and too bright can be reduced. Exemplarily, the domain smoothing process includes low-pass filtering, and weighted summing the result of the low-pass filtering and the pixel value of each pixel in the second image to optimize the second image; the filter window of the low-pass filter increases with the increase in the reduction factor. The filter window can be, for example, a neighborhood 3x3 filter or a 5x5 filter. The principle is that the larger the reduction factor, the larger the filter window. The filter kernel is a general low-pass filter, and the present application does not limit this.

[0052] The result of low-pass filtering and the pixel value of each pixel in the second image are weighted and summed to optimize the second image. The calculation formula is as follows: out (i,j) =β*filterDst (i,j) +(1-β)*dst (i,j) , where out (i,j) is the pixel value of the pixel with coordinates (i, j) in the second image after weighted optimization, filterDst (i,j) is the result obtained after low-pass filtering of the pixel point with coordinates (i, j) in the second image, and β is the weight coefficient of this weighting. Figure 4 An example diagram of a weight coefficient value provided in an embodiment of the present application is shown. Figure 4 , the larger the reduction factor, the larger α1 is, and it is not greater than The larger the reduction factor, the smaller α2 is, and it should not be less than

[0053] In the above embodiments, by increasing the receptive field, the transition between each pixel in the reduced image is made more continuous; the adaptive weight adjustment can reduce the brightness mutation between adjacent pixels in the reduced image; the initial reduced image is smoothed and processed to reduce the abnormal prominence of too dark and too bright areas; through the above measures, the jagged phenomenon generated when the image is reduced can be reduced, thereby improving the image quality.

[0054] Based on similar technical concepts, the present application discloses an image processing system, including a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the image processing method disclosed in the above embodiments.

[0055] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. In addition, the above embodiments can be freely combined as needed.

Claims

1. An image processing method, characterized in that: The method is used to suppress aliasing generated when a first image is reduced to a second image, and comprises: determining a first scaling factor in a horizontal direction and a second scaling factor in a vertical direction; Obtaining a first pixel range in the first image corresponding to each pixel point in the second image based on the first scaling factor and the second scaling factor; determining a compensation coefficient based on a reduction ratio between the first image and the second image, and using the compensation coefficient to expand the first pixel range to obtain a second pixel range in the first image, wherein the compensation coefficient increases as the reduction ratio increases; Calculating a pixel mean value and a pixel weight of each pixel in the second pixel range in the first image based on the second pixel range, wherein the smaller the difference between the pixel value of the pixel in the second pixel range and the pixel mean value, the greater the pixel weight; The pixel value of each pixel in the second image is determined based on the pixel value of each pixel point in the second pixel range and its corresponding pixel weight to suppress aliasing generated when the first image is reduced to the second image. The calculation formula is as follows: Wherein, startXnew is the starting coordinate of the second pixel range in the horizontal direction, endXnew is the ending coordinate of the second pixel range in the horizontal direction, startYnew is the starting coordinate of the second pixel range in the vertical direction, endYnew is the ending coordinate of the second pixel range in the vertical direction, weight (x,y) is the pixel weight of the pixel point with coordinates (x, y) in the second pixel range, I(x, y) is the pixel value of the pixel point with coordinates (x, y) in the second pixel range, dst (i,j) is the pixel value of the pixel point with coordinates (i, j) in the second image.

2. The image processing method according to claim 1, characterized in that: The determining of the first scaling factor in the horizontal direction and the second scaling factor in the vertical direction includes: calculating a quotient of a width of the first image and a width of the second image to obtain the first scaling factor; The quotient of the length of the first image and the length of the second image is calculated to obtain the second scaling factor.

3. The image processing method according to claim 1, characterized in that: The second image includes target pixels; The first starting coordinate of the first pixel range in the horizontal direction is the product of the horizontal coordinate of the target pixel point and the first scaling factor, and the first ending coordinate of the first pixel range in the horizontal direction is the sum of the first starting coordinate and the first scaling factor; The second starting coordinate of the first pixel range in the vertical direction is the product of the vertical coordinate of the target pixel point and the second scaling factor, and the second ending coordinate of the first pixel range in the vertical direction is the sum of the second starting coordinate and the second scaling factor.

4. The image processing method according to claim 3, characterized in that: The compensation coefficient is between 0.1 and 0.4; A third starting coordinate of the second pixel range in the horizontal direction is the first starting coordinate minus the product of the compensation coefficient and the first scaling coefficient, and a third ending coordinate of the second pixel range in the horizontal direction is the first ending coordinate plus the product of the compensation coefficient and the first scaling coefficient; The fourth starting coordinate of the second pixel range in the vertical direction is the second starting coordinate minus the product of the compensation coefficient and the second scaling coefficient, and the fourth ending coordinate of the second pixel range in the vertical direction is the second ending coordinate plus the product of the compensation coefficient and the second scaling coefficient.

5. The image processing method according to claim 1, characterized in that: The pixel mean is the quotient of the sum of the pixel values ​​of all pixels in the second pixel range and the number of pixels in the second pixel range; The calculation formula of the pixel weight of each pixel in the second pixel range is as follows: Among them, weight (x,y) is the pixel weight of the pixel point with coordinates (x, y) in the second pixel range, MeanI [strat,end] is the pixel mean, I max is the maximum depth of the first image, and I(x, y) is the pixel value of the pixel point with coordinates (x, y) in the second pixel range.

6. The image processing method according to any one of claims 1 to 5, characterized in that: Also includes: After determining the pixel value of each pixel in the second image, a field smoothing process is performed on the second image in units of pixels to suppress brightness abnormalities in the second image.

7. The image processing method according to claim 6, characterized in that: The community smoothing process includes low-pass filtering, and weighted summing the result of the low-pass filtering and the pixel value of each pixel in the second image is performed to optimize the second image.

8. The image processing method according to claim 7, characterized in that: The filtering window of the low-pass filter increases as the reduction factor increases.

9. An image processing system, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the image processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image reduction method and device

    CN102800049A

  • Image scaling system and method in substrate management control

    CN115359135A