A processing method for CT image anti-aliasing
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-08-11
AI Technical Summary
[0006]鉴于上述的分析,本发明实施例旨在提供一种用于CT图像抗锯齿的处理方法,用以解决现有针对CT图像的抗锯齿的处理方法效果差的问题
[0042] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
Smart Images

Figure CN121707860B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CT image processing technology, and in particular to a processing method for anti-aliasing of CT images. Background Technology
[0002] Computed Tomography (CT) technology, with its core advantage of non-invasively acquiring the fine internal structure of objects, has become a key imaging method in fields such as industrial non-destructive testing and medical diagnosis.
[0003] In spiral CT scanning scenarios, excessively fast workpiece movement speed can easily lead to jagged artifacts in the reconstructed slice images. These jagged artifacts can severely interfere with the identification and analysis of workpiece structural details, hindering subsequent high-precision applications such as defect detection and dimensional measurement.
[0004] Existing processing solutions for jagged images have significant shortcomings: one type relies on hardware adjustments and scanning parameter optimization, which can only attempt to avoid jaggedness by controlling the scanning process, but cannot perform jaggedness removal processing on the generated reconstructed image, resulting in extremely poor flexibility and applicability; another type is traditional anti-aliasing algorithms that process at the pixel scale. For large jagged edges commonly found in CT images, traditional anti-aliasing algorithms require multiple iterations to achieve a limited smoothing effect, which is not only inefficient but also prone to causing excessive image blurring, destroying key information such as edges and fine structures, and making it difficult to balance processing effect with the need for detail preservation.
[0005] Therefore, there is an urgent need for a new technical solution for processing CT images with jagged edges. Summary of the Invention
[0006] Based on the above analysis, the present invention aims to provide a processing method for anti-aliasing of CT images, in order to solve the problem of poor performance of existing anti-aliasing processing methods for CT images.
[0007] This invention provides a method for anti-aliasing CT images, the method comprising:
[0008] Preprocessing the jagged CT images yields the images to be processed.
[0009] Edge extraction is performed on the image to be processed based on a preset gradient threshold and a preset Sobel operator, and the image to be processed is divided into a region to be replaced and a region to be retained.
[0010] The pixel value of each pixel in the image region to be replaced is determined based on the preset sampling rate and the image to be processed, and the image region after replacement is obtained.
[0011] The replaced image region and the retained image region are combined to obtain the anti-aliased image.
[0012] Based on a further improvement to the above processing method, the step of determining the pixel value of each pixel in the image region to be replaced according to a preset sampling rate and the image to be processed, to obtain the replaced image region, includes:
[0013] The image to be processed is downsampled according to a preset sampling rate to obtain a downsampled image;
[0014] The downsampled image is anti-aliased to obtain the anti-aliased downsampled image.
[0015] The downsampled image after anti-aliasing is upsampled according to a preset sampling rate to obtain a replacement image;
[0016] Replace the pixel value of each pixel in the image region to be replaced with the pixel value of the same pixel in the replacement image to obtain the replaced image region.
[0017] Based on a further improvement to the above processing method, the step of performing anti-aliasing processing on the downsampled image to obtain an anti-aliased downsampled image includes:
[0018] Based on the preset filter box and the preset pixel value difference threshold, each pixel in the downsampled image is traversed to determine multiple pixels to be mixed and multiple pixels to be retained in the downsampled image.
[0019] Determine the horizontal and vertical pixel value gradients for each pixel to be blended, and select the direction with the larger pixel value gradient as the blending direction for each pixel to be blended;
[0020] The pixel value of each pixel to be mixed after anti-aliasing is determined based on two pixels in the fusion direction of each pixel to be mixed;
[0021] The multiple retained pixels and the multiple pixels to be mixed after anti-aliasing are combined to obtain the downsampled image after anti-aliasing.
[0022] Based on a further improvement to the above processing method, the step of traversing each pixel in the downsampled image according to a preset filtering box and a preset pixel value difference threshold to determine multiple pixels to be mixed and multiple retained pixels in the downsampled image includes:
[0023] Using each pixel in the downsampled image as the center of a preset filter box, calculate the difference between the maximum and minimum pixel values within the preset filter box;
[0024] Determine if the difference between the maximum and minimum pixel values is greater than a preset pixel value difference threshold; if the difference is greater than the preset pixel value difference threshold, then the pixel is selected as the pixel to be mixed; otherwise, the pixel is selected as the reserved pixel.
[0025] Based on a further improvement of the above processing method, the preset filter box is cross-shaped.
[0026] Based on further improvements to the above processing method, the pixel value of each pixel to be mixed after anti-aliasing is calculated using the following formula:
[0027]
[0028] Where P represents the pixel value of each pixel to be blended, P' represents the pixel value of each pixel to be blended after anti-aliasing, and P1 and P2 represent two pixels in the fusion direction of each pixel to be blended.
[0029] Based on a further improvement to the above processing method, the step of upsampling the downsampled image after anti-aliasing according to a preset sampling rate to obtain a replacement image includes:
[0030] Determine the replacement pixel for each pixel in the replacement image in the downsampled image after antialiasing;
[0031] The pixel value of each pixel in the replacement image is determined based on the replacement pixel and the four surrounding integer coordinate pixels.
[0032] Based on the further improvement of the above processing method, the pixel value of each pixel in the image to be replaced is calculated using the following formula:
[0033]
[0034] Where i and j represent the coordinates of each pixel in the replacement image, x and y represent the coordinates of the replacement pixel in the downsampled image after anti-aliasing, and k represents the preset sampling rate. Indicates rounding down. This indicates rounding up. p(x,y) represents the pixel value at coordinates x and y in the downsampled image after antialiasing, and p(i,j) represents the pixel value at coordinates i and j in the replacement image.
[0035] Based on a further improvement to the above processing method, the step of edge extraction of the image to be processed based on a preset gradient threshold and a preset Sobel operator, segmenting the image to be processed into a region to be replaced and a region to be retained, includes:
[0036] The gradient intensity of each pixel in the image to be processed is calculated based on the preset Sobel operator;
[0037] Determine whether the gradient intensity of each pixel in the image to be processed is greater than a preset gradient threshold; if the gradient intensity of each pixel in the image to be processed is greater than the preset gradient threshold, then the pixel is used as a pixel in the image region to be replaced; otherwise, the pixel is used as a pixel in the image region to be retained.
[0038] Based on further improvements to the above processing method, the preprocessing includes one or more of the following processing methods:
[0039] Normalization;
[0040] Noise reduction;
[0041] Geometric transformations.
[0042] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0043] 1. The image to be processed is divided into a replacement image region and a retention image region by using a preset gradient threshold and a preset Sobel operator. The pixel value of each pixel in the replacement image region is updated according to the preset sampling rate and the image to be processed, while the pixel value of the pixels in the retention image region remains unchanged. This not only preserves the original image information in non-edge areas, but also accurately eliminates jagged artifacts.
[0044] 2. The image to be processed is downsampled according to a preset sampling rate to convert large-sized jagged edges into pixel-level jagged edges to obtain a downsampled image. Anti-aliasing is then applied to the downsampled image to obtain an anti-aliased downsampled image. Finally, the anti-aliased downsampled image is upsampled according to the preset sampling rate to obtain a replacement image. This eliminates the need for multiple iterations targeting large-sized jagged edges, improving processing efficiency several times over compared to traditional iterative schemes. This significantly saves computational resources and time costs, avoiding information loss due to overprocessing while maximizing the preservation of the original image details.
[0045] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description
[0046] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0047] Figure 1 A flowchart illustrating a method for anti-aliasing CT images provided in an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of a sawtooth CT image provided in an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the image region to be replaced and the image region to be retained, provided in an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of a downsampled image provided in an embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of an image after anti-aliasing processing, provided in an embodiment of the present invention. Detailed Implementation
[0052] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0053] A specific embodiment of the present invention discloses a method for anti-aliasing CT images, such as... Figure 1 As shown, the processing method includes:
[0054] Step S1: Preprocess the jagged CT image to obtain the image to be processed;
[0055] Step S2: Based on the preset gradient threshold and the preset Sobel operator, perform edge extraction on the image to be processed, and segment the image to be processed into the image region to be replaced and the image region to be retained;
[0056] Step S3: Determine the pixel value of each pixel in the image region to be replaced based on the preset sampling rate and the image to be processed, and obtain the image region after replacement;
[0057] Step S4: Combine the replaced image region and the retained image region to obtain the anti-aliased image.
[0058] Specifically, in spiral CT scanning scenarios, excessively fast workpiece movement can easily lead to jagged artifacts in the reconstructed images, such as... Figure 2 As shown, such jagged CT images can severely interfere with the identification and analysis of workpiece structural details, hindering subsequent high-precision applications such as defect detection and dimensional measurement.
[0059] Specifically, the embodiment of the present invention provides a processing method for anti-aliasing of CT images, used for... Figure 2 The jagged CT image shown has been processed to remove anti-aliasing, such as... Figure 1 As shown, in step S1, the sawtooth CT image is preprocessed to obtain the preprocessed image as the image to be processed.
[0060] Preferably, the preprocessing includes one or more of the following processing methods:
[0061] Normalization;
[0062] Noise reduction;
[0063] Geometric transformations.
[0064] Specifically, normalization can standardize the pixel value range of jagged CT images, making them conform to a specific statistical distribution, which is beneficial to the stability and accuracy of numerical calculations.
[0065] Specifically, noise reduction can suppress or eliminate random and unnecessary interference signals introduced during image acquisition and transmission, making the main information clearer and reducing the impact of noise on subsequent processing.
[0066] Specifically, geometric transformations are used to change the shape, position, and viewing angle of each pixel in a jagged CT image.
[0067] Specifically, such as Figure 1 As shown, in step S1, the sawtooth CT image is preprocessed to obtain the image to be processed.
[0068] Specifically, such as Figure 1 As shown, in step S2, a gradient threshold and a Sobel operator are preset, and edge extraction is performed on the image to be processed obtained in step S1 based on the gradient threshold and the Sobel operator, dividing the image to be processed into an image region to be replaced and an image region to be retained.
[0069] Preferably, the step of performing edge extraction on the image to be processed based on a preset gradient threshold and a preset Sobel operator, and segmenting the image to be processed into a region to be replaced and a region to be retained, includes:
[0070] The gradient intensity of each pixel in the image to be processed is calculated based on the preset Sobel operator;
[0071] Determine whether the gradient intensity of each pixel in the image to be processed is greater than a preset gradient threshold; if the gradient intensity of each pixel in the image to be processed is greater than the preset gradient threshold, then the pixel is used as a pixel in the image region to be replaced; otherwise, the pixel is used as a pixel in the image region to be retained.
[0072] Specifically, the default Sobel operator uses a 3x3 horizontal operator and a vertical operator.
[0073] Specifically, the preset gradient threshold range is 0.5-0.8. When the gradient threshold is within the range of 0.5-0.8, the final anti-aliasing image effect is quite good.
[0074] Specifically, if more refined anti-aliasing processing is required for a large number of images to be processed in the same batch, a small portion of the images to be processed can be extracted first and the method provided in this embodiment of the invention can be executed. A gradient threshold can be set according to the anti-aliasing effect, and finally, the set gradient threshold can be used to process all the images to be processed.
[0075] Specifically, the gradient intensity of each pixel in the image to be processed is calculated by using preset horizontal Sobel operators and vertical Sobel operators respectively, and then the gradient intensity of the horizontal direction and the gradient intensity of the vertical direction are combined to obtain the gradient intensity of each pixel in the image to be processed.
[0076] Specifically, the gradient intensity of each pixel in the image to be processed is compared with a pre-set gradient threshold to determine the comparison result of each pixel, and each pixel in the image to be processed is classified according to the comparison result.
[0077] Specifically, if the gradient intensity of a pixel in the image to be processed is greater than a preset gradient threshold, then the pixel is used as a pixel in the image region to be replaced, and the pixel value of the pixel is re-determined in step S3.
[0078] Specifically, if the gradient strength of a pixel in the image to be processed is less than or equal to a preset gradient threshold, then that pixel is retained as a pixel in the image region.
[0079] Specifically, such as Figure 3 As shown, the black area represents the image area to be retained, and the pixel values of the pixels in the black area do not need to be changed; the white area represents the image area to be replaced, and the pixel values of the pixels in the white area are re-determined in step S3.
[0080] Specifically, such as Figure 1 As shown, in step S2, the image region to be replaced and the image region to be retained are obtained, and the pixel value of each pixel in the image region to be replaced is determined in step S3.
[0081] Preferably, the step of determining the pixel value of each pixel in the image region to be replaced based on a preset sampling rate and the image to be processed, to obtain the replaced image region, includes:
[0082] The image to be processed is downsampled according to a preset sampling rate to obtain a downsampled image;
[0083] The downsampled image is anti-aliased to obtain the anti-aliased downsampled image.
[0084] The downsampled image after anti-aliasing is upsampled according to a preset sampling rate to obtain a replacement image;
[0085] Replace the pixel value of each pixel in the image region to be replaced with the pixel value of the same pixel in the replacement image to obtain the replaced image region.
[0086] Specifically, the function of the preset sampling rate is to transform large-sized jagged edges in the image to be processed into pixel-level jagged edges, which can be set individually for each image.
[0087] Specifically, when processing images in the same batch, since the jagged edges are caused by the workpiece traveling too fast, the same preset sampling rate can be set for all images in the same batch.
[0088] For example, if the jagged edges of the image to be processed occupy 5 pixels, the preset sampling rate can be set to 5.
[0089] Specifically, by downsampling the image to be processed using a preset sampling rate, large jagged edges in the image are converted into pixel-level jagged edges, such as... Figure 4 As shown, this is the low-resolution image after downsampling, which is used as the downsampled image.
[0090] Specifically, for Figure 4 The downsampled image in the image is processed with anti-aliasing to obtain the anti-aliased downsampled image.
[0091] Specifically, when performing anti-aliasing processing on downsampled images, the existing mature Fast Approximate Anti-Aliasing (FXAA) algorithm can be used.
[0092] Preferably, the step of performing anti-aliasing processing on the downsampled image to obtain an anti-aliased downsampled image includes:
[0093] Based on the preset filter box and the preset pixel value difference threshold, each pixel in the downsampled image is traversed to determine multiple pixels to be mixed and multiple pixels to be retained in the downsampled image.
[0094] Determine the horizontal and vertical pixel value gradients for each pixel to be blended, and select the direction with the larger pixel value gradient as the blending direction for each pixel to be blended;
[0095] The pixel value of each pixel to be mixed after anti-aliasing is determined based on two pixels in the fusion direction of each pixel to be mixed;
[0096] The multiple retained pixels and the multiple pixels to be mixed after anti-aliasing are combined to obtain the downsampled image after anti-aliasing.
[0097] Specifically, a filter box and a pixel value difference threshold are preset. Each pixel in the downsampled image is processed according to the filter box and the pixel value difference threshold. Each pixel in the downsampled image is classified as a pixel to be mixed or a pixel to be retained. Finally, all pixels to be mixed are treated as multiple pixels to be mixed in the downsampled image, and all pixels to be retained are treated as multiple pixels to be retained in the downsampled image.
[0098] Preferably, the preset filter box is cross-shaped.
[0099] Specifically, the cross-shaped filter box includes the center pixel, as well as the four pixels above, below, left, and right of the center pixel.
[0100] Preferably, the step of traversing each pixel in the downsampled image according to a preset filter box and a preset pixel value difference threshold to determine multiple pixels to be mixed and multiple pixels to be retained in the downsampled image includes:
[0101] Using each pixel in the downsampled image as the center of a preset filter box, calculate the difference between the maximum and minimum pixel values within the preset filter box;
[0102] Determine if the difference between the maximum and minimum pixel values is greater than a preset pixel value difference threshold; if the difference is greater than the preset pixel value difference threshold, then the pixel is selected as the pixel to be mixed; otherwise, the pixel is selected as the reserved pixel.
[0103] Specifically, each pixel in the downsampled image is used as the center pixel of the preset filter box. The center pixel, as well as the maximum and minimum pixel values among the five pixels above, below, left, and right of the center pixel, are found. The difference between the maximum and minimum pixel values is calculated and used as the difference between the maximum and minimum pixel values in the preset filter box.
[0104] For example, the preset pixel value difference threshold is 0.8.
[0105] Determine whether the difference between the maximum and minimum pixel values is greater than a preset pixel value difference threshold, and classify each pixel based on the determination result.
[0106] If the difference between the maximum and minimum pixel values in the preset filter box corresponding to a pixel is greater than the preset pixel value difference threshold, then the pixel is taken as the pixel to be mixed.
[0107] If the difference between the maximum and minimum pixel values in the preset filter box corresponding to a pixel is less than or equal to the preset pixel value difference threshold, then the pixel is reserved.
[0108] Specifically, the horizontal and vertical pixel value gradients of each pixel to be mixed are calculated, and then the magnitudes of the horizontal and vertical pixel value gradients are compared. The direction with the larger pixel value gradient is taken as the fusion direction of the pixel to be mixed.
[0109] Specifically, after determining the fusion direction of the mixed pixels, the two adjacent pixels of the mixed pixel are obtained with the mixed pixel as the center in the fusion direction, and the pixel value of the mixed pixel is re-determined based on the two adjacent pixels and the mixed pixel.
[0110] Preferably, the pixel value of each pixel to be blended after anti-aliasing is calculated using the following formula:
[0111]
[0112] Where P represents the pixel value of each pixel to be blended, P' represents the pixel value of each pixel to be blended after anti-aliasing, and P1 and P2 represent two pixels in the fusion direction of each pixel to be blended.
[0113] Specifically, after determining the mean pixel values of multiple mixed pixels, all mixed pixels and all retained pixels are combined to form the downsampled image after anti-aliasing.
[0114] Specifically, the downsampled image after anti-aliasing is upsampled according to a preset sampling rate to obtain a replacement image.
[0115] Preferably, the step of upsampling the downsampled image after anti-aliasing according to a preset sampling rate to obtain a replacement image includes:
[0116] Determine the replacement pixel for each pixel in the replacement image in the downsampled image after antialiasing;
[0117] The pixel value of each pixel in the replacement image is determined based on the replacement pixel and the four surrounding integer coordinate pixels.
[0118] Specifically, the replacement image and the image to be processed are the same size. The downsampled image after anti-aliasing is a low-resolution image. The downsampled image after anti-aliasing is then upsampled to obtain the replacement image.
[0119] Specifically, the replacement pixel in the downsampled image after anti-aliasing is calculated for each pixel in the replacement image.
[0120] Specifically, the replacement pixel in the downsampled image after anti-aliasing is calculated using the following formula:
[0121]
[0122] Where i and j represent the coordinates of each pixel in the replacement image, x and y represent the coordinates of the replacement pixel in the downsampled image after anti-aliasing, and k represents the preset sampling rate.
[0123] Specifically, the pixel value of each pixel in the replacement image is determined based on the replacement pixel and the four surrounding integer coordinate pixels.
[0124] Preferably, the pixel value of each pixel in the replacement image is calculated using the following formula:
[0125]
[0126] Where i and j represent the coordinates of each pixel in the replacement image, x and y represent the coordinates of the replacement pixel in the downsampled image after anti-aliasing, and k represents the preset sampling rate. Indicates rounding down. This indicates rounding up. p(x,y) represents the pixel value at coordinates x and y in the downsampled image after antialiasing, and p(i,j) represents the pixel value at coordinates i and j in the replacement image.
[0127] Specifically, the pixel values of all pixels in the replaced image are calculated.
[0128] Specifically, at this point, the size of the image formed by the image area to be replaced and the image area to be retained is the same as the size of the replacement image. At this point, the pixel values of all pixels in the image area to be retained remain unchanged. It is only necessary to replace the pixel value of the same pixel in the image area to be replaced with the pixel value of the same pixel in the replacement image.
[0129] Specifically, the pixel value of each pixel in the image region to be replaced is replaced with the pixel value of the same pixel in the replacement image to obtain the replaced image region.
[0130] Specifically, such as Figure 1 As shown, in step S4, the replaced image region and the retained image region are combined to obtain the anti-aliased image.
[0131] Specifically, such as Figure 5 As shown, the anti-aliasing process essentially eliminates all the jagged edges that appeared in the original image.
[0132] It is worth noting that the anti-aliasing processing method for CT images provided by the embodiments of the present invention can directly eliminate aliasing in the generated reconstructed images, completely solving the pain point that hardware adjustment schemes cannot process existing images, and greatly improving the utilization rate and quality of CT image data.
[0133] Compared with existing technologies, the anti-aliasing processing method for CT images provided in this invention segments the image to be processed into a replacement image region and a retained image region by using a preset gradient threshold and a preset Sobel operator. The pixel value of each pixel in the replacement image region is updated according to a preset sampling rate and the image to be processed, while the pixel values of the pixels in the retained image region remain unchanged. This not only preserves the original image information in non-edge areas but also accurately eliminates aliasing artifacts. Furthermore, the image to be processed is downsampled according to the preset sampling rate, converting large-sized aliasing into pixel-level aliasing to obtain a downsampled image. Anti-aliasing processing is then performed on the downsampled image to obtain an anti-aliased downsampled image. Finally, the anti-aliased downsampled image is upsampled according to the preset sampling rate to obtain a replacement image. This eliminates the need for multiple iterations targeting large-sized aliasing, improving processing efficiency several times compared to traditional iterative schemes, significantly saving computational resources and time costs. It avoids information loss due to overprocessing and maximizes the preservation of the original image details.
[0134] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0135] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for anti-aliasing CT images, characterized in that, The processing method includes: Preprocessing the jagged CT images yields the images to be processed. Edge extraction is performed on the image to be processed based on a preset gradient threshold and a preset Sobel operator, and the image to be processed is divided into a region to be replaced and a region to be retained. Based on the preset sampling rate and the image to be processed, the pixel value of each pixel in the image region to be replaced is determined, resulting in the replaced image region, including: The image to be processed is downsampled according to a preset sampling rate to obtain a downsampled image; the downsampled image is anti-aliased to obtain an anti-aliased downsampled image; the anti-aliased downsampled image is upsampled according to a preset sampling rate to obtain a replacement image; the pixel value of each pixel in the image region to be replaced is replaced with the pixel value of the same pixel in the replacement image to obtain the replaced image region. The anti-aliasing process for the downsampled image to obtain the anti-aliased downsampled image includes: traversing each pixel in the downsampled image according to a preset filter box and a preset pixel value difference threshold to determine multiple pixels to be mixed and multiple retained pixels in the downsampled image; determining the horizontal and vertical pixel value gradients of each pixel to be mixed, and selecting the direction with the larger pixel value gradient as the fusion direction of each pixel to be mixed; determining the pixel value of each pixel to be mixed after anti-aliasing based on two pixels in the fusion direction of each pixel to be mixed; and combining the multiple retained pixels and the multiple pixels to be mixed after anti-aliasing to obtain the anti-aliased downsampled image. The replaced image region and the retained image region are combined to obtain the anti-aliased image.
2. The processing method according to claim 1, characterized in that, The step of traversing each pixel in the downsampled image according to a preset filter box and a preset pixel value difference threshold to determine multiple pixels to be mixed and multiple pixels to be retained in the downsampled image includes: Using each pixel in the downsampled image as the center of a preset filter box, calculate the difference between the maximum and minimum pixel values within the preset filter box; Determine if the difference between the maximum and minimum pixel values is greater than a preset pixel value difference threshold; if the difference is greater than the preset pixel value difference threshold, then the pixel is selected as the pixel to be mixed; otherwise, the pixel is selected as the reserved pixel.
3. The processing method according to claim 1 or 2, characterized in that, The preset filter box is cross-shaped.
4. The processing method according to claim 1, characterized in that, The pixel value of each pixel to be blended after anti-aliasing is calculated using the following formula: ; in, This represents the pixel value of each pixel to be blended. This represents the pixel value of each pixel to be blended after anti-aliasing. and This represents two pixels in the fusion direction of each pixel to be mixed.
5. The processing method according to claim 1, characterized in that, The step of upsampling the downsampled image after anti-aliasing according to a preset sampling rate to obtain a replacement image includes: Determine the replacement pixel for each pixel in the replacement image in the downsampled image after antialiasing; The pixel value of each pixel in the replacement image is determined based on the replacement pixel and the four surrounding integer coordinate pixels.
6. The processing method according to claim 5, characterized in that, The pixel value of each pixel in the image to be replaced is calculated using the following formula: , ; ; in, , This indicates that the coordinates of each pixel in the image will be replaced. , This represents the coordinates of the replacement pixel in the downsampled image after anti-aliasing for each pixel in the replacement image. Indicates the preset sampling rate. This indicates rounding down. Indicates rounding up. This indicates the coordinates in the downsampled image after anti-aliasing. , pixel values, This indicates that the coordinates in the image to be replaced are... , The pixel value.
7. The processing method according to claim 1, characterized in that, The process of edge extraction of the image to be processed based on a preset gradient threshold and a preset Sobel operator, dividing the image to be processed into a region to be replaced and a region to be retained, includes: The gradient intensity of each pixel in the image to be processed is calculated based on the preset Sobel operator; Determine whether the gradient intensity of each pixel in the image to be processed is greater than a preset gradient threshold; if the gradient intensity of each pixel in the image to be processed is greater than the preset gradient threshold, then the pixel is used as a pixel in the image region to be replaced; otherwise, the pixel is used as a pixel in the image region to be retained.
8. The processing method according to any one of claims 1-2 and 4-7, characterized in that, The preprocessing includes one or more of the following processing methods: Normalization; Noise reduction; Geometric transformations.
Citation Information
Patent Citations
Method for enhancing image resolution by convolution filtering and anti-aliasing analyzing
CN102831589A
Anti-aliasing system and method based on edge detection
CN118397029A