A method and terminal for removing moiré of filter grid
By performing preprocessing operations such as interpolation edge filling, edge signal extraction or logarithmic transformation on the image, combined with frequency domain filtering and post-processing, the signal loss and artifact problems when removing the molecular texture of the filter line grid in the prior art are solved, and the signal loss and artifact problems are realized. Effective oscillation artifact suppression and image quality improvement.
Patent Information
- Application Number
- CN202111649047.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The prior art inevitably eliminates some useful signals when removing the wire grid molar and produces severe oscillation artifacts, especially at the image boundaries.
Image preprocessing operations are performed on the image to be processed, including interpolated edge complement or edge signal extraction, followed by frequency domain filtering, and corresponding image post-processing operations to avoid oscillation artifacts caused by edge differences and filter line gate amplitude level differences. . Specific methods include interpolation edge filling, edge signal extraction and logarithmic transformation.
The oscillation artifacts are effectively suppressed, while removing the filter wire grid molar pattern, improving image quality, reducing the computational amount, and avoiding the artifacts caused by edge differences and filter wire grid amplitude differences in frequency domain filtering.
Smart Images

Figure CN114418846B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and a terminal for removing moiré patterns of a filter grid. Background Art
[0002] In order to improve the image quality of current DR (Digital Radiography) images, medical grids are often used. The inside of the grid is composed of multiple thin lead strips arranged in an intersecting manner, and the space between the two lead strips is filled and positioned with a material that is easy to transmit X-rays. Each lead strip and the filler are regarded as a line pair, which is a periodic line pair. Since the detector is also composed of pixels arranged in a matrix and is also sampled at a certain period, the sampling frequency of the detector is similar to the frequency of the grid line pair. Moiré will be generated during sampling, which appears as periodic light and dark stripes on the real domain image. At present, the grid moiré can be physically eliminated or weakened by using methods such as vibrating the grid and increasing the grid line pairs, but this will bring other problems and is expensive. Therefore, the current common method is to use a frequency filtering algorithm to remove the grid moiré, but the frequency filtering algorithm will inevitably eliminate some useful signals and increase non-existent artifacts, such as serious oscillation artifacts at the image boundary. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method and a terminal for removing the moiré of a filter grid, which can effectively suppress the oscillation artifact while removing the moiré of the filter grid.
[0004] In order to solve the above technical problems, a technical solution adopted by the present invention is:
[0005] A method for removing moiré patterns of a filter grid, comprising:
[0006] Get the image to be processed;
[0007] Performing an image preprocessing operation on the image to be processed to obtain a preprocessed image to be processed, wherein the image preprocessing operation includes an interpolation edge filling operation or an edge signal extraction operation;
[0008] Performing frequency domain filtering on the preprocessed image to be processed to obtain a filtered image;
[0009] An image post-processing operation corresponding to the image pre-processing operation is performed on the filtered image to obtain a final image.
[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0011] A filter grid moiré removal terminal comprises a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0012] Get the image to be processed;
[0013] Performing an image preprocessing operation on the image to be processed to obtain a preprocessed image to be processed, wherein the image preprocessing operation includes an interpolation edge filling operation or an edge signal extraction operation;
[0014] Performing frequency domain filtering on the preprocessed image to be processed to obtain a filtered image;
[0015] An image post-processing operation corresponding to the image pre-processing operation is performed on the filtered image to obtain a final image.
[0016] The beneficial effects of the present invention are as follows: an image preprocessing operation is performed on an image to be processed to obtain a preprocessed image to be processed, the image preprocessing operation includes an interpolation and edge filling operation or an edge signal extraction operation, frequency domain filtering is performed on the preprocessed image to be processed, and an image post-processing operation corresponding to the image preprocessing operation is performed on the filtered image to obtain a final image. Unlike the prior art, the image to be processed is no longer directly subjected to frequency domain filtering, but the image preprocessing operation is first performed on the image, and then frequency domain filtering is performed. The interpolation and edge filling operation or the edge signal extraction operation can effectively avoid edge differences and filter line grid amplitude level differences, thereby avoiding the edge differences and filter line grid amplitude level differences from causing oscillation artifacts in subsequent frequency domain filtering, so that the oscillation artifacts can be effectively suppressed while removing the filter line grid moiré. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A flowchart of a method for removing moiré from a grid according to an embodiment of the present invention;
[0018] Figure 2 A schematic structural diagram of a grid moiré removal terminal according to an embodiment of the present invention;
[0019] Figure 3 It is a schematic diagram of the flow of frequency domain filtering in the prior art;
[0020] Figure 4 It is a schematic diagram of a process of first expanding to obtain a transition region and then performing frequency domain filtering in a method for removing moiré of a grid according to an embodiment of the present invention;
[0021] Figure 5 It is a schematic diagram of the process of frequency domain filtering after interpolation replacement of edge areas in the method for removing grid moiré in an embodiment of the present invention;
[0022] Figure 6It is a schematic diagram of the process of interpolation replacement in the method for removing grid moiré in an embodiment of the present invention;
[0023] Figure 7 It is a schematic diagram of the process of first extracting edge difference images and then performing frequency domain filtering in the method for removing grid moiré in an embodiment of the present invention;
[0024] Figure 8 It is a schematic diagram of the process of extracting edge difference images in the method for removing grid moiré according to an embodiment of the present invention;
[0025] Fig. 9 A comparison diagram of an image to be processed after interpolation and edge filling in a method for removing grid moiré according to an embodiment of the present invention and an original image to be processed;
[0026] Fig.10 This is a comparison diagram of the effects of first interpolating and filling the edges and then filtering in the frequency domain and directly filtering in the frequency domain in the method for removing the moiré of the filter grid according to the embodiment of the present invention;
[0027] Fig.11 This is a comparison diagram of the effects of existing direct frequency domain filtering, first extracting edge signal images and then frequency domain filtering, and first performing logarithmic transformation and then extracting edge signal images and then frequency domain filtering in the method for removing grid moiré in an embodiment of the present invention;
[0028] Fig.12 (a) is a final image obtained by using the existing frequency domain filtering in the method for removing the grid moiré in an embodiment of the present invention;
[0029] Fig.12 (b) is a final image obtained by frequency domain filtering after interpolation and edge filling in the method for removing grid moiré in an embodiment of the present invention;
[0030] Fig.12 (c) is the final image obtained by frequency domain filtering after edge signals are extracted in the method for removing grid moiré in an embodiment of the present invention;
[0031] Fig.12 (d) is the final image obtained by extracting edge signals after logarithmic transformation and then filtering in the frequency domain in the method for removing moiré of the grid according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0033] Please refer to Figure 1 , an embodiment of the present invention provides a method for removing moiré patterns of a filter grid, comprising:
[0034] Get the image to be processed;
[0035] Performing an image preprocessing operation on the image to be processed to obtain a preprocessed image to be processed, wherein the image preprocessing operation includes an interpolation edge filling operation or an edge signal extraction operation;
[0036] Performing frequency domain filtering on the preprocessed image to be processed to obtain a filtered image;
[0037] An image post-processing operation corresponding to the image pre-processing operation is performed on the filtered image to obtain a final image.
[0038] From the above description, it can be seen that the beneficial effects of the present invention are: performing an image preprocessing operation on the image to be processed to obtain a preprocessed image to be processed, the image preprocessing operation includes an interpolation and edge filling operation or an edge signal extraction operation, performing frequency domain filtering on the preprocessed image to be processed, and performing an image post-processing operation corresponding to the image preprocessing operation on the filtered image to obtain a final image. Unlike the prior art, frequency domain filtering is no longer performed directly on the image to be processed, but the image preprocessing operation is first performed on the image, and then frequency domain filtering is performed. The interpolation and edge filling operation or the edge signal extraction operation can effectively avoid edge differences and filter line grid amplitude level differences, thereby avoiding edge differences and filter line grid amplitude level differences from causing oscillation artifacts in subsequent frequency domain filtering, so that the oscillation artifacts can be effectively suppressed while removing the filter line grid moiré.
[0039] Furthermore, performing an image preprocessing operation on the image to be processed to obtain the preprocessed image to be processed includes:
[0040] Performing the interpolation and edge-filling operation on the image to be processed to obtain the image to be processed after edge-filling;
[0041] The performing frequency domain filtering on the preprocessed image to be processed to obtain a filtered image comprises:
[0042] The image to be processed after edge filling is subjected to frequency domain filtering to obtain a filtered image.
[0043] From the above description, it can be seen that the oscillation artifacts at the image boundary are caused by the image edge differences in the frequency domain filtering operation. Therefore, by performing an interpolation and edge filling operation on the image to be processed to obtain the padded image to be processed, and then performing frequency domain filtering on the padded image to be processed, the edge differences of the image can be effectively reduced, thereby effectively suppressing the oscillation artifacts.
[0044] Furthermore, performing the interpolation and edge-filling operation on the image to be processed to obtain the image to be processed after edge-filling includes:
[0045] Determining an edge region from the image to be processed;
[0046] Expanding the edge area by interpolation replacement to obtain a transition area;
[0047] The image to be processed with the transition area is smoothed and filtered to obtain the image to be processed after edge filling.
[0048] From the above description, it can be seen that by determining the edge area from the image to be processed, the edge area is expanded by difference replacement to obtain the transition area, and then the image to be processed with the transition area is smoothed and filtered to obtain the image to be processed after edge filling, the interpolation edge filling operation is realized. After the transition area is interpolated and replaced, the junction between the interpolated area and the non-interpolated area in the image will produce a weaker gradient boundary due to the difference. Therefore, smoothing filtering the image to be processed after the initial edge filling can reduce the boundary strength at the junction and further suppress the oscillation artifact.
[0049] Further, performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image includes:
[0050] The filtered image is cropped according to the transition area to obtain a final image.
[0051] From the above description, it can be seen that by cropping the filtered image according to the transition area to obtain the final image, the negative impact caused by the interpolation edge filling can be effectively removed, thereby improving the quality of the final image.
[0052] Furthermore, performing the interpolation and edge-filling operation on the image to be processed to obtain the image to be processed after edge-filling includes:
[0053] Determining an edge region from the image to be processed;
[0054] Performing interpolation replacement on the edge area to obtain an image to be processed after initial edge filling;
[0055] The image to be processed after the initial edge-padded process is smoothed and filtered to obtain the image to be processed after the edge-padded process.
[0056] From the above description, it can be seen that in addition to the above-mentioned interpolation edge filling method, the edge area can also be determined from the image to be processed, the edge area can be interpolated and replaced to obtain the image to be processed after the initial edge filling, and the image to be processed after the initial edge filling can be smoothed and filtered to obtain the image to be processed after the edge filling. By directly sacrificing part of the edge pixel values of the image, the transition area can also be realized in the original image. When the frequency domain filtering is performed later, the connected boundaries use the transition area as a buffer, which greatly suppresses the boundary oscillation artifacts.
[0057] Further, performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image includes:
[0058] The filtered image is restored according to the edge region to obtain a final image.
[0059] From the above description, it can be seen that restoring the filtered image according to the edge area effectively avoids the adverse interpolation effect.
[0060] Furthermore, performing an image preprocessing operation on the image to be processed to obtain the preprocessed image to be processed includes:
[0061] Performing the edge signal extraction operation on the image to be processed to obtain an extracted image to be processed;
[0062] The performing frequency domain filtering on the preprocessed image to be processed to obtain a filtered image comprises:
[0063] The extracted image to be processed is subjected to frequency domain filtering to obtain a filtered image.
[0064] From the above description, it can be seen that compared with the existing method of directly performing frequency domain filtering on an image, by performing an edge signal extraction operation on the image to be processed to obtain an extracted image to be processed, and then performing frequency domain filtering on the extracted image to be processed to obtain a filtered image, the amount of calculation can be reduced, and while removing the moiré pattern of the filter grid, the oscillation artifact can be effectively suppressed.
[0065] Further, performing the edge signal extraction operation on the image to be processed to obtain the extracted image to be processed includes:
[0066] Downsampling the image to be processed to obtain a downsampled image to be processed;
[0067] Upsampling the downsampled image to be processed to obtain an edge difference image;
[0068] Performing a subtraction operation on the edge difference image and the image to be processed to obtain a detail image;
[0069] Performing a division operation on the detail image and the image to be processed to obtain an extracted image to be processed;
[0070] The performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image comprises:
[0071] Multiplying the filtered image by the image to be processed to obtain a restored image;
[0072] The restored image is added to the edge difference image to obtain a final image.
[0073] From the above description, it can be seen that the filter line moiré signal is required to be retained while extracting the image edge difference signal. The image edge difference signal covers the entire image, but the filter line moiré is related to the sampling frequency of the detector. Moiré will only occur when the sampling frequency of the detector is close to the frequency of occurrence of the filter line pair. If the sampling frequency of the detector is much lower than the frequency of occurrence of the filter line pair, then the filter line moiré will not appear. Therefore, by downsampling the image to be processed, an image that retains the edge difference signal and basically has no filter line moiré signal can be obtained. By upsampling the image, an edge difference image with the same resolution as the original image can be obtained. By subtracting the edge difference image from the image to be processed, a detail image without edge difference can be obtained. Since the amplitude of the grid signal on the detail image is related to the grayscale value, the grid signal amplitude in the area with high grayscale value is also high. By dividing the detail image with the image to be processed to obtain the extracted image to be processed, the grid signal can be corrected so that the grid amplitudes at different grayscale values are at the same level, thereby avoiding oscillation artifacts caused by different grid amplitude levels.
[0074] Further, performing the edge signal extraction operation on the image to be processed to obtain the extracted image to be processed includes:
[0075] Performing logarithmic transformation on the image to be processed to obtain a logarithmically transformed image to be processed;
[0076] Down-sampling the image to be processed after the logarithmic transformation to obtain a down-sampled image to be processed;
[0077] Upsampling the downsampled image to be processed to obtain an edge difference image;
[0078] Subtracting the edge difference image from the image to be processed to obtain an extracted image to be processed;
[0079] The performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image comprises:
[0080] Performing an addition operation on the filtered image and the edge difference image to obtain a restored image;
[0081] Performing exponential transformation on the restored image to obtain a final image.
[0082] As can be seen from the above description, the filter grid signal can be corrected by performing logarithmic transformation on the image to be processed, down-sampling the image to be processed after the logarithmic transformation, up-sampling the down-sampled image to be processed to obtain an edge difference image, and subtracting the edge difference image from the image to be processed to obtain the extracted image to be processed, which can avoid oscillation artifacts caused by different filter grid amplitude levels.
[0083] Please refer to Figure 2 Another embodiment of the present invention provides a filter grid moiré removal terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the filter grid moiré removal method when executing the computer program.
[0084] The above-mentioned method and terminal for removing grid moiré of the present invention can be applied to DR images that need to remove grid moiré, and are described below through specific implementation methods:
[0085] Embodiment 1
[0086] Since the grid moiré is a periodic signal in the real domain, the existing frequency domain filtering method converts it into the frequency domain through the Fourier formula. At this time, the grid moiré signal is mainly concentrated in multiple frequency points in the frequency domain. The notch filter is used to remove or suppress this part of the signal at these frequency points, and then converted to the real domain, most of the grid moiré can be removed. The general process is to first convert the real domain image to the frequency domain according to the Fourier formula, then use the notch filter for filtering, and then convert it to the real domain according to the inverse Fourier transform, such as Figure 3 As shown;
[0087] The use of frequency domain filtering methods will inevitably lose part of the signal, especially when the image has a strong boundary, which will inevitably cause oscillation artifacts of the strong boundary; from the analysis of the Fourier transform formula and the Fourier inverse transform formula, it can be seen that the Fourier transform is a periodic sampling;
[0088] The Fourier transform formula is:
[0089]
[0090] The inverse Fourier transform formula is:
[0091]
[0092] Among them, F(u) = F(u+M), f(x) = f(x+M); the starting edge and the ending edge of the real domain signal are connected together. When the values of the starting position and the ending position of the signal differ greatly, a strong boundary with a large drop will be formed. Therefore, using traditional methods to perform frequency domain filtering will leave serious oscillation artifacts;
[0093] Please refer to Figure 1 , 4 , a method for removing moiré patterns of a filter grid according to this embodiment includes:
[0094] S1, obtaining the image to be processed;
[0095] S2, performing an image preprocessing operation on the image to be processed to obtain a preprocessed image to be processed, wherein the image preprocessing operation includes an interpolation edge filling operation or an edge signal extraction operation;
[0096] In an optional implementation, S2 specifically includes:
[0097] The interpolation and edge filling operation is performed on the image to be processed to obtain the image to be processed after edge filling, such as Figure 4 As shown, specifically including:
[0098] S21, determining an edge region from the image to be processed;
[0099] S22, expanding the edge area by interpolation replacement to obtain a transition area;
[0100] S23, performing smoothing filtering on the image to be processed with the transition area to obtain the image to be processed after edge filling;
[0101] S3, performing frequency domain filtering on the pre-processed image to be processed to obtain a filtered image;
[0102] In an optional implementation, frequency domain filtering is performed on the image to be processed after edge filling to obtain a filtered image;
[0103] S4, performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image;
[0104] Specifically, the filtered image is cropped according to the transition area to obtain a final image.
[0105] Embodiment 2
[0106] Please refer to Figure 1 , 5 6. The difference between this embodiment and the first embodiment is that the interpolation edge filling operation is performed based on the original edge area of the image, specifically:
[0107] In another optional embodiment, if Figure 5 As shown, the S2 specifically includes:
[0108] S21, determining an edge region from the image to be processed;
[0109] S22, interpolating and replacing the edge area to obtain the image to be processed after initial edge filling, such as Figure 6 As shown, specifically including:
[0110] S221, obtaining a first length, a first starting position, a first pixel value corresponding to the first starting position, a first ending position, and a second pixel value corresponding to the first ending position of each line in the edge area;
[0111] S222, obtaining a second length, a second starting position, a third pixel value corresponding to the second starting position, a second ending position, and a fourth pixel value corresponding to the second ending position of each column in the edge region;
[0112] S223, interpolating and replacing the edge area according to the first length, the first starting position, the first pixel value, the first ending position, the second pixel value, the second length, the second starting position, the third pixel value, the second ending position and the fourth pixel value according to the first linear interpolation formula and the second linear interpolation formula to obtain an image to be processed after initial edge filling;
[0113] The first linear interpolation formula is:
[0114] in
[0115] Wherein, w represents the first length, x1 represents the first starting position, x2 represents the first ending position, y1 represents the first pixel value, y2 represents the second pixel value, and x represents the x coordinate of the row in the edge area;
[0116] The second linear interpolation formula is:
[0117] in
[0118] Wherein, w' represents the second length, x'1 represents the second starting position, x'2 represents the second ending position, y'1 represents the third pixel value, y'2 represents the fourth pixel value, and x' represents the x coordinate of the column in the edge area;
[0119] S23, performing smoothing filtering on the image to be processed after the initial edge-filling to obtain the image to be processed after the edge-filling;
[0120] In another optional implementation, the S4 is specifically:
[0121] The filtered image is restored according to the edge region to obtain a final image.
[0122] Embodiment 3
[0123] Please refer to Figure 1 , 7 8. The difference between this embodiment and the first or second embodiment is that the edge signal extraction operation is used to remove the moiré pattern of the filter grid, specifically:
[0124] In another optional embodiment, if Figure 7 As shown, the S2 is specifically:
[0125] Performing the edge signal extraction operation on the image to be processed to obtain the extracted image to be processed specifically includes:
[0126] S21, downsampling the image to be processed to obtain a downsampled image to be processed;
[0127] Specifically, Figure 8 As shown, a downsampling interval is calculated according to the sampling rate of the detector and the grid line pairs, and the image to be processed is downsampled according to the downsampling interval to obtain a downsampled image to be processed;
[0128] Among them, the sampling rate LP p Should be less than the grid line pair frequency LP G One quarter of LP p <0.25*LP G , subsequently, an image can be obtained which retains the edge difference signal and has almost no filter grid moiré signal;
[0129] The down sampling adopts a bilinear interpolation method with an anti-aliasing method;
[0130] S22, upsampling the downsampled image to be processed to obtain an edge difference image;
[0131] Specifically, the down-sampled image to be processed is up-sampled using a bilinear interpolation method, and the interpolation interval is consistent with the down-sampling interval to obtain an edge difference image;
[0132] S23, performing a subtraction operation on the edge difference image and the image to be processed to obtain a detail image;
[0133] Specifically, the grayscale value of the image to be processed is subtracted from the grayscale value of the edge difference image to obtain a detail image;
[0134] S24, performing a division operation on the detail image and the image to be processed to obtain an extracted image to be processed;
[0135] Specifically, the grayscale value of the detail image is divided by the grayscale value of the image to be processed to obtain the extracted image to be processed;
[0136] In another optional implementation, S3 is specifically:
[0137] Performing frequency domain filtering on the extracted image to be processed to obtain a filtered image;
[0138] In another optional implementation, the S4 is specifically:
[0139] S41, multiplying the filtered image by the image to be processed to obtain a restored image;
[0140] Specifically, the grayscale value of the filtered image is multiplied by the grayscale value of the image to be processed to obtain a restored image;
[0141] S42, performing an addition operation on the restored image and the edge difference image to obtain a final image;
[0142] Specifically, the grayscale value of the restored image is added to the grayscale value of the edge difference image to obtain a final image;
[0143] Compared with the existing direct frequency domain filtering method, the computational complexity of the present invention is also greatly reduced. By downsampling and then upsampling, only two operations are required on average for each pixel. The computational complexity of the existing direct frequency domain filtering method for detail image extraction is related to the size of the convolution kernel. According to the 1 / 4 reduction ratio n, the length and width of the convolution kernel must be at least 2*n+1=9, and an average of 9*9=81 operations are required for each pixel.
[0144] Embodiment 4
[0145] Please refer to Figure 1 , 9 -12. The difference between this embodiment and the first, second or third embodiment is that the edge signal extraction operation is implemented by logarithmic transformation, specifically:
[0146] In another optional implementation, the S2 specifically includes:
[0147] S21, performing logarithmic transformation on the image to be processed to obtain a logarithmic transformed image to be processed;
[0148] S22, down-sampling the image to be processed after the logarithmic transformation to obtain a down-sampled image to be processed;
[0149] S23, upsampling the downsampled image to be processed to obtain an edge difference image;
[0150] S24, performing a subtraction operation on the edge difference image and the image to be processed to obtain an extracted image to be processed;
[0151] Specifically, the grayscale value of the image to be processed is subtracted from the grayscale value of the edge difference image to obtain the extracted image to be processed;
[0152] In another optional implementation, the S4 is specifically:
[0153] S41, performing an addition operation on the filtered image and the edge difference image to obtain a restored image;
[0154] Specifically, the grayscale value of the filtered image is added to the grayscale value of the edge difference image to obtain a restored image;
[0155] S42, performing exponential transformation on the restored image to obtain a final image;
[0156] During the experiment, the flat panel detector used was 3072*3072Pixels (pixel count), with a resolution of 361p / cm, a grid line pair of 401p / cm, and the shooting position was the shoulder joint;
[0157] When the interpolation and edge filling operation is performed based on the original edge area of the image to be processed, that is, 10 edge pixel points are determined from the image to be processed as the edge area, the edge area is interpolated and replaced to obtain the image to be processed after the initial edge filling, and the image to be processed after the initial edge filling is smoothed and filtered to obtain the image to be processed after the edge filling, such as Fig. 9 As shown, Fig. 9 The comparison between the image to be processed and the image to be processed after edge filling is shown. Figure 9-11 The x-axis represents pixels and the y-axis represents grayscale values;
[0158] like Fig.10 As shown, Fig.10 The comparison chart shows the effects of interpolating and filling the edges first and then filtering in the frequency domain and filtering in the frequency domain directly. It can be seen that the artifact range of the image to be processed after direct filtering is more than 30 pixels, while the artifact is much weaker after interpolating and filling the edges by 10 pixels and then filtering in the frequency domain, and the artifact range does not exceed 15 pixels;
[0159] like Fig.11 As shown, Fig.11The comparison chart of the existing direct frequency domain filtering, first extracting the edge signal image and then filtering in the frequency domain, and first logarithmic transformation and then extracting the edge signal image and then filtering in the frequency domain is shown. It can be seen that the final artifact of first extracting the edge signal image and then filtering in the frequency domain is much smaller, and the artifact range is within 10 pixels. When using logarithmic transformation and then extracting the edge signal image and then filtering in the frequency domain, no artifact can be seen, and no pixel signal needs to be lost.
[0160] We calculate the artifact amplitude according to the maximum, minimum and average values: F = (max-min) / mean, and we can get the following table;
[0161] Table 1 Comparison of the effects of different grid moiré removal methods
[0162] method Artifact Amplitude Artifact range (number of pixels) Existing frequency domain filtering ±207.6% 30 Frequency domain filtering after interpolation and edge filling ±20.6% 15 Frequency domain filtering after edge signal extraction ±15.8% 10 Extract edge signals after logarithmic transformation and then filter in frequency domain ±0% 0
[0163] As can be seen from Table 1, the effect of removing the moiré pattern of the filter grid by frequency domain filtering after extracting the edge signal after logarithmic transformation of the processed image is the best, and the oscillation artifact of the boundary can be completely solved;
[0164] like Fig.12 As shown in (a) to (d), Fig.12 (a) shows the final image obtained using the existing frequency domain filtering. Fig.12 The stripes on the left in (a) are oscillation artifacts. Fig.12 (b) shows the final image obtained by frequency domain filtering after edge interpolation. Fig.12 (c) shows the final image obtained by frequency domain filtering after edge signal extraction. Fig.12 (d) shows the final image obtained by frequency domain filtering after extracting edge signals after logarithmic transformation.
[0165] Embodiment 5
[0166] Please refer to Figure 2 A filter grid moiré removal terminal of this embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the filter grid moiré removal method in Embodiment 1, Embodiment 2, Embodiment 3, or Embodiment 4 is implemented.
[0167] In summary, the present invention provides a method and terminal for removing moiré of a filter grid, which obtains an image to be processed; performs an image preprocessing operation on the image to be processed to obtain a preprocessed image to be processed, wherein the image preprocessing operation includes an interpolation edge filling operation or an edge signal extraction operation, wherein the interpolation edge filling operation can expand the edge area by difference replacement to obtain a transition area, and then perform smoothing filtering on the image to be processed with the transition area to obtain the image to be processed after edge filling, or the edge area can be determined from the image to be processed, the edge area is interpolated and replaced, and then smoothing filtering is performed. Both interpolation edge filling methods can use the transition area as a buffer for the connected boundaries when performing subsequent frequency domain filtering, thereby suppressing boundary oscillation artifacts to a great extent; the edge signal extraction operation can be performed by downsampling the image to be processed, upsampling the downsampled image to be processed, and comparing the edge difference image with the image to be processed. A subtraction operation is performed, and a division operation is performed on the detail image and the image to be processed to obtain the extracted image to be processed, so that the filter line grid signal can be corrected, and the oscillation artifact caused by different filter line grid amplitude levels can be avoided; the image to be processed can also be logarithmically transformed, the image to be processed after the logarithmic transformation is down-sampled, and the down-sampled image to be processed is up-sampled to obtain an edge difference image, and the edge difference image is subtracted from the image to be processed to obtain the extracted image to be processed, which can also avoid the oscillation artifact caused by different filter line grid amplitude levels; the pre-processed image to be processed is subjected to frequency domain filtering, and the filtered image is subjected to an image post-processing operation corresponding to the image pre-processing operation to obtain a final image, so as to avoid the edge difference and the filter line grid amplitude level difference causing oscillation artifacts in the subsequent frequency domain filtering, so that the oscillation artifacts can be effectively suppressed while removing the filter line grid moiré.
[0168] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for removing moiré patterns of a filter grid, characterized in that: include: Get the image to be processed; Performing an image preprocessing operation on the image to be processed to obtain a preprocessed image to be processed, wherein the image preprocessing operation includes an interpolation edge filling operation or an edge signal extraction operation; Performing frequency domain filtering on the pre-processed image to be processed to obtain a filtered image; Performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image; The performing an image preprocessing operation on the image to be processed to obtain the preprocessed image to be processed comprises: Performing the interpolation and edge-filling operation on the image to be processed to obtain an image to be processed after edge-filling; The performing frequency domain filtering on the pre-processed image to be processed to obtain a filtered image comprises: Performing frequency domain filtering on the image to be processed after edge padding to obtain a filtered image; The performing the interpolation and edge-filling operation on the image to be processed to obtain the image to be processed after edge-filling includes: determining an edge region from the image to be processed; Expanding the edge region by interpolation replacement to obtain a transition region; Performing smoothing filtering on the image to be processed with the transition area to obtain the image to be processed after edge filling; The performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image comprises: cropping the filtered image according to the transition region to obtain a final image; or, The performing an image preprocessing operation on the image to be processed to obtain the preprocessed image to be processed comprises: Performing the edge signal extraction operation on the image to be processed to obtain an extracted image to be processed; The performing frequency domain filtering on the pre-processed image to be processed to obtain a filtered image comprises: Performing frequency domain filtering on the extracted image to be processed to obtain a filtered image; The performing the edge signal extraction operation on the image to be processed to obtain the extracted image to be processed comprises: Downsampling the image to be processed to obtain a downsampled image to be processed; Upsampling the downsampled image to be processed to obtain an edge difference image; Performing a subtraction operation on the edge difference image and the image to be processed to obtain a detail image; Performing a division operation on the detail image and the image to be processed to obtain an extracted image to be processed; The performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image comprises: Multiplying the filtered image by the image to be processed to obtain a restored image; The restored image is added to the edge difference image to obtain a final image.
2. The method for removing grid moiré according to claim 1, wherein: The performing the interpolation and edge-filling operation on the image to be processed to obtain the image to be processed after edge-filling includes: determining an edge region from the image to be processed; Performing interpolation replacement on the edge area to obtain an image to be processed after initial edge filling; The image to be processed after the initial edge-padded process is smoothed and filtered to obtain the image to be processed after the edge-padded process.
3. The method for removing grid moiré according to claim 2, wherein: The performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image comprises: The filtered image is restored according to the edge region to obtain a final image.
4. The method for removing grid moiré according to claim 1, wherein: The performing the edge signal extraction operation on the image to be processed to obtain the extracted image to be processed comprises: Performing logarithmic transformation on the image to be processed to obtain a logarithmically transformed image to be processed; Downsampling the image to be processed after the logarithmic transformation to obtain a downsampled image to be processed; Upsampling the downsampled image to be processed to obtain an edge difference image; Performing a subtraction operation on the edge difference image and the image to be processed to obtain an extracted image to be processed; The performing an image post-processing operation corresponding to the image pre-processing operation on the filtered image to obtain a final image comprises: Performing an addition operation on the filtered image and the edge difference image to obtain a restored image; Performing exponential transformation on the restored image to obtain a final image.
5. A grid moiré removal terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, each step of the method for removing grid moiré patterns according to any one of claims 1 to 4 is implemented.
