Method, apparatus, device, and medium for removing moire

By transforming the image from the time domain to the frequency domain, locating and removing high-frequency noise, and using discrete inverse Fourier transform to remove moiré patterns, the problem of cumbersome and poor-quality time-domain moiré removal in existing technologies is solved, achieving efficient moiré removal.

CN116957971BActive Publication Date: 2026-01-16HEFEI SUNGROW RENEWABLE ENERGY SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310919497.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2026-01-16
Estimated Expiration
2043-07-25

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively remove moiré patterns in image processing, especially in the time domain where the removal process is complex and yields poor results.

Method used

By transforming the image from the time domain to the frequency domain, high-frequency noise in the preliminary spectrum image is located and removed, and discrete inverse Fourier transform is performed on the target spectrum image to remove moiré patterns.

Benefits of technology

It efficiently removes moiré patterns in the frequency domain, improving image processing performance and simplifying the removal process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116957971B_ABST
    Figure CN116957971B_ABST
Patent Text Reader

Abstract

The application discloses a moire removal method, device, equipment and medium, and belongs to the technical field of image processing. Since moire is difficult to remove in the time domain, a method for removing moire in the frequency domain is provided in the application. First, a to-be-processed image with moire is transformed from the time domain to the frequency domain to obtain a corresponding preliminary frequency spectrum image, then high-frequency noise points in the preliminary frequency spectrum image are located, the high-frequency noise points are removed in the preliminary frequency spectrum image to obtain a target frequency spectrum image, and finally, discrete inverse Fourier transform is performed on the target frequency spectrum image, so that a target image with removed moire is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and particularly relates to a moire removal method, a moire removal device, a moire removal equipment and a computer readable storage medium. BACKGROUND

[0002] The moire is similar to water waves. In physics, moire refers to the phenomenon that two or more waves are superimposed in space to form a new wave form. In the field of image processing, when the spatial frequency of a pixel array is lower than the frequency of the signal itself, spectrum aliasing occurs, and the appearance on the image is moire. If there is moire in the image, it will affect the subsequent edge detection algorithm. At present, moire is often removed in the time domain, but the process is complicated and the effect is poor. SUMMARY

[0003] The main purpose of the present application is to provide a moire removal method, a moire removal device, a moire removal equipment and a computer readable storage medium, aiming at solving the technical problem of difficult moire removal.

[0004] To achieve the above purpose, the present application provides a moire removal method, which comprises:

[0005] Positioning high-frequency noise points in a preliminary frequency spectrum image, wherein the preliminary frequency spectrum image is a frequency spectrum image corresponding to a to-be-processed image with moire;

[0006] Removing the high-frequency noise points in the preliminary frequency spectrum image to obtain a target frequency spectrum image;

[0007] Performing inverse discrete Fourier transform on the target frequency spectrum image to obtain a target image with moire removed.

[0008] Illustratively, before the step of positioning high-frequency noise points in the preliminary frequency spectrum image, the method comprises:

[0009] Performing discrete Fourier transform on the to-be-processed image with moire to obtain a frequency spectrum image corresponding to the to-be-processed image with moire.

[0010] Illustratively, the step of positioning high-frequency noise points in the preliminary frequency spectrum image comprises:

[0011] Positioning high-frequency noise points in the preliminary frequency spectrum image through image recognition, or positioning high-frequency noise points in the preliminary frequency spectrum image through noise point detection.

[0012] Illustratively, the step of positioning high-frequency noise points in the preliminary frequency spectrum image through image recognition comprises:

[0013] determining a region image covered by the preset spectrum template in the initial spectrum image;

[0014] calculating a structural similarity index of each preset spectrum template and the region image respectively, and determining a target structural similarity index of the region image according to the structural similarity index corresponding to each preset spectrum template;

[0015] moving the preset spectrum template in the initial spectrum image by a preset step value, and calculating all the target structural similarity indexes corresponding to the initial spectrum image;

[0016] locating high-frequency noise points in the initial spectrum image based on all the structural similarity indexes.

[0017] The step of determining the target structural similarity index of the region image according to the structural similarity index corresponding to each preset spectrum template includes:

[0018] determining a maximum structural similarity index of the structural similarity index corresponding to each preset spectrum template;

[0019] determining the maximum structural similarity index as the target structural similarity index of the region image.

[0020] Before the step of determining the region image covered by the preset spectrum template in the initial spectrum image, the method includes:

[0021] determining a low-frequency region of the initial spectrum image, wherein the low-frequency region is a central region of the initial spectrum image;

[0022] adjusting the size of the preset spectrum template and the size of the preset step value based on the size of the low-frequency region and the size of the initial spectrum image, wherein the area of the preset spectrum template is smaller than the area of the low-frequency region, and the adjusted preset spectrum template completely covers the initial spectrum image after being moved in the initial spectrum image by the adjusted preset step value.

[0023] After the step of determining the target structural similarity index of the region image according to the structural similarity index corresponding to each preset spectrum template, the method includes:

[0024] moving the preset spectrum template in the initial spectrum image except the low-frequency region by a preset step value, and calculating part of the target structural similarity indexes corresponding to the initial spectrum image except the low-frequency region;

[0025] locating high-frequency noise points in the initial spectrum image based on part of the structural similarity indexes.

[0026] The step of locating the high-frequency noise points in the preliminary frequency spectrum image includes:

[0027] The structure similarity index is subjected to a non-maximum suppression operation to delete redundantly located pending high-frequency noise points, to obtain target high-frequency noise points.

[0028] The step of removing the high-frequency noise points in the preliminary frequency spectrum image to obtain a target frequency spectrum image includes:

[0029] The high-frequency noise points are traversed, and a two-dimensional Gaussian low-pass filter function is generated based on the position coordinates of the high-frequency noise points;

[0030] The high-frequency noise points in the preliminary frequency spectrum image are removed based on the two-dimensional Gaussian low-pass filter function, to obtain a target frequency spectrum image.

[0031] The application further provides a moire removal device, which comprises:

[0032] A locating module is configured to locate high-frequency noise points in a preliminary frequency spectrum image, wherein the preliminary frequency spectrum image is a frequency spectrum image corresponding to a to-be-processed image having moire;

[0033] A removing module is configured to remove the high-frequency noise points in the preliminary frequency spectrum image, to obtain a target frequency spectrum image;

[0034] A transforming module is configured to perform a discrete inverse Fourier transform on the target frequency spectrum image, to obtain a target image from which moire is removed.

[0035] The application further provides a moire removal device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program, when executed by the processor, implements the steps of the moire removal method described above.

[0036] The application further provides a computer readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the moire removal method described above.

[0037] The moire removal method, the moire removal device, the moire removal equipment, and the computer readable storage medium provided by the embodiments of the application locate high-frequency noise points in a preliminary frequency spectrum image, wherein the preliminary frequency spectrum image is a frequency spectrum image corresponding to a to-be-processed image having moire; the high-frequency noise points are removed in the preliminary frequency spectrum image, to obtain a target frequency spectrum image; and a discrete inverse Fourier transform is performed on the target frequency spectrum image, to obtain a target image from which moire is removed.

[0038] Since the moire is difficult to remove in time domain, a method for removing the moire in frequency domain is proposed in the application. Firstly, the image to be processed with the moire is transformed from time domain to frequency domain to obtain a corresponding preliminary frequency spectrum image, then the high frequency noise points in the preliminary frequency spectrum image are located, the high frequency noise points are removed in the preliminary frequency spectrum image to obtain a target frequency spectrum image, finally, the target frequency spectrum image is subjected to inverse discrete Fourier transform to obtain the target image with the moire removed. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 is a structural schematic diagram of a running device of a hardware running environment related to the embodiment scheme of the application;

[0040] Figure 2 is a flow schematic diagram of a moire removal method according to an embodiment related to the embodiment scheme of the application;

[0041] Figure 3 is a frequency spectrum image schematic diagram obtained after discrete Fourier transform according to an embodiment related to the embodiment scheme of the application;

[0042] Figure 4 is a high frequency noise point schematic diagram in a preliminary frequency spectrum image according to an embodiment related to the embodiment scheme of the application;

[0043] Figure 5 is a target frequency spectrum image schematic diagram obtained by removing the high frequency noise points in the preliminary frequency spectrum image according to an embodiment related to the embodiment scheme of the application;

[0044] Figure 6 is a four preset frequency spectrum template schematic diagram according to an embodiment related to the embodiment scheme of the application;

[0045] Figure 7 is a moving preset frequency spectrum template schematic diagram according to an embodiment related to the embodiment scheme of the application;

[0046] Figure 8 is a low frequency area schematic diagram of a preliminary frequency spectrum image according to an embodiment related to the embodiment scheme of the application;

[0047] Figure 9 is a schematic diagram of a moire removal device according to the embodiment scheme of the application.

[0048] The implementation, functional features and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are merely intended to explain the application and are not intended to limit the application.

[0050] Referring to Figure 1 , Figure 1 The hardware environment for the embodiment of the present application is shown in the running device structure diagram.

[0051] As Figure 1 shown, the running device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display screen, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.

[0052] Those skilled in the art can understand that Figure 1 the structure shown in the above description does not constitute a limitation on the running device, and can include more or fewer components than the diagram, or combine certain components, or different component arrangements.

[0053] As Figure 1 shown, the memory 1005 as a storage medium can include an operating system, a data storage module, a network communication module, a user interface module, and a computer program.

[0054] In Figure 1 the running device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the running device of the present application can be arranged in the running device, and the running device calls the computer program stored in the memory 1005 through the processor 1001 and performs the following operations:

[0055] locating high-frequency noise points in a preliminary frequency spectrum image, wherein the preliminary frequency spectrum image is a frequency spectrum image corresponding to a to-be-processed image with moire patterns;

[0056] remove the high-frequency noise points in the preliminary spectrum image to obtain a target spectrum image;

[0057] perform a discrete inverse Fourier transform on the target spectrum image to obtain a target image in which moire is removed.

[0058] In an embodiment, the processor 1001 can invoke a computer program stored in the memory 1005 and further perform the following operations:

[0059] Before the step of locating the high-frequency noise points in the preliminary spectrum image, the method further comprises:

[0060] perform a discrete Fourier transform on the to-be-processed image in which moire exists to obtain a spectrum image corresponding to the to-be-processed image in which moire exists.

[0061] In an embodiment, the processor 1001 can invoke a computer program stored in the memory 1005 and further perform the following operations:

[0062] The step of locating the high-frequency noise points in the preliminary spectrum image comprises:

[0063] The high-frequency noise points in the preliminary spectrum image are located by image recognition or by noise point detection.

[0064] In an embodiment, the processor 1001 can invoke a computer program stored in the memory 1005 and further perform the following operations:

[0065] The step of locating the high-frequency noise points in the preliminary spectrum image by image recognition comprises:

[0066] determine a region image in the preliminary spectrum image to which a starting position of a preset spectrum template covers;

[0067] respectively calculate a structural similarity index of each preset spectrum template and the region image, and determine a target structural similarity index of the region image according to the structural similarity index corresponding to each preset spectrum template;

[0068] move the preset spectrum template in the preliminary spectrum image by a preset step value, and calculate all the target structural similarity indexes corresponding to the preliminary spectrum image;

[0069] locate the high-frequency noise points in the preliminary spectrum image based on all the structural similarity indexes.

[0070] In an embodiment, the processor 1001 can invoke a computer program stored in the memory 1005 and further perform the following operations:

[0071] The step of determining the target structural similarity index of the region image according to the structural similarity index corresponding to each preset spectral template comprises:

[0072] Determining the maximum structural similarity index of the structural similarity index corresponding to each preset spectral template;

[0073] Determining the maximum structural similarity index as the target structural similarity index of the region image.

[0074] In an embodiment, the processor 1001 can invoke the computer program stored in the memory 1005, and further perform the following operations:

[0075] The step of determining the region image covered by the initial position preset spectral template in the preliminary spectral image comprises:

[0076] Determining a low-frequency region of the preliminary spectral image, wherein the low-frequency region is a central region of the preliminary spectral image;

[0077] Adjusting the size of the preset spectral template and the size of the preset step value based on the size of the low-frequency region and the size of the preliminary spectral image, wherein the area of the preset spectral template is smaller than the area of the low-frequency region, and after moving the adjusted preset spectral template in the preliminary spectral image by the adjusted preset step value, the preliminary spectral image is completely covered.

[0078] In an embodiment, the processor 1001 can invoke the computer program stored in the memory 1005, and further perform the following operations:

[0079] The step of determining the target structural similarity index of the region image according to the structural similarity index corresponding to each preset spectral template comprises:

[0080] Moving the preset spectral template in the preliminary spectral image except for the low-frequency region by a preset step value, and calculating the part of the target structural similarity index corresponding to the preliminary spectral image except for the low-frequency region;

[0081] Based on part of the structural similarity index, positioning the high-frequency noise points in the preliminary spectral image.

[0082] In an embodiment, the processor 1001 can invoke the computer program stored in the memory 1005, and further perform the following operations:

[0083] The step of positioning the high-frequency noise points in the preliminary spectral image comprises:

[0084] The structure similarity index is subjected to a non-maximum suppression operation to delete redundantly positioned pending high-frequency noise points, to obtain target high-frequency noise points.

[0085] In an embodiment, the processor 1001 can invoke a computer program stored in the memory 1005, and further perform the following operations:

[0086] The step of removing the high-frequency noise points in the preliminary spectral image to obtain a target spectral image comprises:

[0087] The high-frequency noise points are traversed, and a two-dimensional Gaussian low-pass filter function is generated based on the position coordinates of the high-frequency noise points;

[0088] The high-frequency noise points of the preliminary spectral image are removed based on the two-dimensional Gaussian low-pass filter function to obtain a target spectral image.

[0089] Embodiments of the present application provide a moire removal method, referring to Figure 2 In an embodiment of the moire removal method, the method comprises:

[0090] Step S10, positioning high-frequency noise points in a preliminary spectral image, wherein the preliminary spectral image is a spectral image corresponding to a to-be-processed image with moire.

[0091] Illustratively, the step of positioning high-frequency noise points in a preliminary spectral image comprises, before the step:

[0092] Performing a discrete Fourier transform on the to-be-processed image with moire to obtain a spectral image corresponding to the to-be-processed image with moire.

[0093] In an embodiment, first, an OpenCV is used to read the to-be-processed image with moire and convert it into a gray image img, the height h and the width w of the gray image img are obtained, the image size most suitable for the discrete Fourier transform, i.e., the height H and the width W, are calculated according to the height h and the width w, and the boundaries of the gray image img are zero-padded based on the height H and the width W to obtain a zero-padded image img_zero_fill. Then, each pixel point in the zero-padded image img_zero_fill is traversed, the horizontal direction coordinate is denoted as x, and the vertical direction coordinate is denoted as y, the gray value of each position is multiplied by (-1) x+y to obtain an origin transformation image img_zero_fill_tf, so as to move the coordinate origin to the (H / 2, W / 2) of the zero-padded image img_zero_fill. In an example, the coordinate origin is preset to the top left corner of the zero-padded image img_zero_fill. Next,

[0094] The dft function in OpenCV is called to calculate the discrete Fourier transform of the origin-transformed image img_zero_fill_tf, to obtain a transposed image transform_image, that is, the discrete Fourier transform is performed on the origin-transformed image img_zero_fill_tf to obtain a transposed image transform_image. In the transposed image transform_image, each point is a complex number, and the real part of the complex number is denoted as R(u, v) and the imaginary part is denoted as I(u, v). The complex number can be calculated by the following formula:

[0095] |F(u, v)| = [R 2 (u, v) + I 2 (u, v)] 1 / 2

[0096] The Fourier spectrum is calculated to obtain a spectrum image amplitude, that is, the right side of the above formula is the transposed image transform_image, and the left side of the formula is the spectrum image amplitude.

[0097] In an embodiment, the spectrum image obtained after the discrete Fourier transform is as shown in Figure 3 .

[0098] The step of locating the high-frequency noise points in the preliminary spectrum image includes, for example:

[0099] The high-frequency noise points in the preliminary spectrum image are located by image recognition or by noise point detection.

[0100] In an embodiment, the high-frequency noise points in the preliminary spectrum image are as shown in the circled part in Figure 4 . The white circle is only for illustration and does not participate in subsequent positioning processing. The high-frequency noise points in the preliminary spectrum image can be located by image recognition or by noise point detection. In this embodiment, the image recognition method and the noise point detection method for locating the high-frequency noise points in the preliminary spectrum image are not limited.

[0101] In step S20, the high-frequency noise points in the preliminary spectrum image are removed to obtain a target spectrum image.

[0102] In an embodiment, the target spectrum image obtained by removing the high-frequency noise points in the preliminary spectrum image is as shown in Figure 5 .

[0103] The step of removing the high-frequency noise points in the preliminary spectrum image to obtain a target spectrum image includes, for example:

[0104] The high-frequency noise points are traversed, and a two-dimensional Gaussian low-pass filter function is generated based on the position coordinates of the high-frequency noise points;

[0105] The high-frequency noise points of the preliminary frequency spectrum image are removed based on the two-dimensional Gaussian low-pass filter function, and a target frequency spectrum image is obtained.

[0106] In an embodiment, by traversing all the high-frequency noise points, at each high-frequency noise point (x1, y1),..., (xt, yt), a two-dimensional Gaussian low-pass filter function G(x, y) = 1 / (2πσ 2 -(x2+y2) / (2σ2) is generated based on the position coordinates of the high-frequency noise points, and the two-dimensional Gaussian low-pass filter function is multiplied with the frequency spectrum image amplitude, so as to obtain the target frequency spectrum image as shown in the following formula: Figure 5

[0107] In step S30, a discrete inverse Fourier transform is performed on the target frequency spectrum image, and a target image without moire is obtained.

[0108] A discrete inverse Fourier transform is performed on the obtained target frequency spectrum image, and a target image without moire is obtained. In an embodiment, since the coordinate origin is moved to (H / 2, W / 2) of the zero padding image img_zero_fill, the region of the target image amplitude_idft with the original image size at the upper left corner is intercepted, and the image without moire is obtained.

[0109] In the embodiment, high-frequency noise points in a preliminary frequency spectrum image are located, the preliminary frequency spectrum image is a frequency spectrum image corresponding to a to-be-processed image with moire; the high-frequency noise points are removed in the preliminary frequency spectrum image, and a target frequency spectrum image is obtained; and a discrete inverse Fourier transform is performed on the target frequency spectrum image, and a target image without moire is obtained.

[0110] Since moire is difficult to remove in the time domain, in the embodiment, a method for removing moire in an image in the frequency domain is proposed. First, a to-be-processed image with moire is transformed from the time domain to the frequency domain, and a corresponding preliminary frequency spectrum image is obtained. Then, high-frequency noise points in the preliminary frequency spectrum image are located, and the high-frequency noise points are removed in the preliminary frequency spectrum image to obtain a target frequency spectrum image. Finally, a discrete inverse Fourier transform is performed on the target frequency spectrum image, and a target image without moire is obtained.

[0111] In an embodiment, first, a to-be-processed image is transformed from the time domain to the frequency domain. The frequency spectrum image is traversed, and a structural similarity index (SSIM) between a frequency spectrum template and a region covered by the frequency spectrum template is calculated. Then, a non-maximum suppression method is combined to determine the position of the high-frequency noise points. Gaussian low-pass filtering is performed on the corresponding high-frequency noise points, and the purpose of eliminating moire is achieved.

[0112] ​​The embodiment of the present application provides a moire removal method, in another embodiment of the moire removal method, the step of positioning high-frequency noise points in a preliminary frequency spectrum image through image recognition comprises:

[0113] determining a region image covered by a preset frequency spectrum template at a starting position in the preliminary frequency spectrum image;

[0114] respectively calculating structural similarity indexes of each preset frequency spectrum template and the region image, and determining a target structural similarity index of the region image according to the structural similarity index corresponding to each preset frequency spectrum template;

[0115] moving the preset frequency spectrum template in the preliminary frequency spectrum image by a preset step value, and calculating all the target structural similarity indexes corresponding to the preliminary frequency spectrum image;

[0116] positioning high-frequency noise points in the preliminary frequency spectrum image based on all the structural similarity indexes.

[0117] In an embodiment, four preset frequency spectrum templates as shown in Figure 6 are provided, which are used for positioning high-frequency noise points in a frequency spectrum image.

[0118] Referring to Figure 7 , in an embodiment, the starting position of the preset frequency spectrum template is the upper left corner of the preliminary frequency spectrum image, a region image covered by the preset frequency spectrum template at the starting position is determined in the preliminary frequency spectrum image, structural similarity indexes (SSIM) of each preset frequency spectrum template and the region image are respectively calculated, and a target structural similarity index of the region image is determined according to the structural similarity index corresponding to each preset frequency spectrum template; then, the preset frequency spectrum template is moved in the preliminary frequency spectrum image by a preset step value from the upper left corner to the lower right corner in a manner similar to convolution calculation, all the target structural similarity indexes corresponding to the preliminary frequency spectrum image are calculated. Finally, high-frequency noise points in the preliminary frequency spectrum image are positioned based on all the structural similarity indexes. Here, the calculation of the structural similarity index is not repeated.

[0119] For example, the step of determining the target structural similarity index of the region image according to the structural similarity index corresponding to each preset frequency spectrum template comprises:

[0120] determining the maximum structural similarity index of the structural similarity index corresponding to each preset frequency spectrum template;

[0121] determining the maximum structural similarity index as the target structural similarity index of the region image.

[0122] In the embodiment, the results are recorded as SSIM(x, y, 1), SSIM(x, y, 2), SSIM(x, y, 3), SSIM(x, y, 4), and the final calculation result at the center (x, y) of the template is: SSIM(x, y) = max(SSIM(x, y, i)), where i = 1, 2, 3, 4.

[0123] For example, before the step of determining the initial position of the preset spectral template to cover the region image in the preliminary spectral image, the method comprises the following steps:

[0124] determining a low-frequency region of the preliminary spectral image, wherein the low-frequency region is a central region of the preliminary spectral image;

[0125] adjusting the size of the preset spectral template and the size of the preset step value based on the size of the low-frequency region and the size of the preliminary spectral image, wherein the area of the preset spectral template is smaller than the area of the low-frequency region, and the adjusted preset spectral template is completely covered in the preliminary spectral image after moving the adjusted preset spectral template in the preliminary spectral image by the adjusted preset step value.

[0126] Referring to Figure 4 , the middle part of the preliminary spectral image is the low-frequency region, which cannot be removed.

[0127] Referring to Figure 8 , a low-frequency region of the preliminary spectral image is determined, wherein the low-frequency region is a central region of the preliminary spectral image.

[0128] Referring to Figure 7 , when the spectral template moves to the last right lower corner, it can be found that there is still a part of the region not covered, which can be ignored, or the size of the spectral template and the size of the step value can be adjusted, so that the entire movement process of the spectral template completely covers the spectral image.

[0129] Therefore, in the embodiment, the size of the preset spectral template and the size of the preset step value are adjusted based on the size of the low-frequency region and the size of the preliminary spectral image, the area of the preset spectral template is smaller than the area of the low-frequency region, so that the low-frequency region can be identified, and the adjusted preset spectral template is completely covered in the preliminary spectral image after moving the adjusted preset spectral template in the preliminary spectral image by the adjusted preset step value, so that there is no empty uncovered region as shown in Figure 7 .

[0130] For example, after the step of determining the target structural similarity index of the region image according to the structural similarity index corresponding to each preset spectral template, the method comprises the following steps:

[0131] moving a preset frequency spectrum template in the preliminary frequency spectrum image except the low frequency region by a preset step value, to calculate a part of the target structure similarity index corresponding to the preliminary frequency spectrum image except the low frequency region;

[0132] locating a high frequency noise point in the preliminary frequency spectrum image based on the part of the structure similarity index.

[0133] Since the center low frequency region may cause the low frequency center region to be mistakenly identified as a high frequency noise in image recognition, in the embodiment, when the frequency spectrum template enters the low frequency region, the image recognition of the low frequency region is directly skipped, wherein the entering means that the frequency spectrum template is entirely located in the center low frequency region or a certain proportion thereof is located in the center low frequency region.

[0134] In the embodiment, a preset frequency spectrum template is moved in the preliminary frequency spectrum image except the low frequency region by a preset step value, to calculate a part of the target structure similarity index corresponding to the preliminary frequency spectrum image except the low frequency region. A high frequency noise point in the preliminary frequency spectrum image is located based on the part of the structure similarity index, to obtain a more accurate and less error high frequency noise point position.

[0135] Illustratively, the step of locating the high frequency noise point in the preliminary frequency spectrum image comprises:

[0136] Performing a non-maximum suppression operation on the structure similarity index to delete a redundant located pending high frequency noise point, to obtain a target high frequency noise point.

[0137] Performing a non-maximum suppression operation on all the calculated structure similarity indexes to delete a redundant location, to obtain a final high frequency noise point position (x1, y1),..., (xt, yt).

[0138] Referring to Figure 9 In addition, the embodiment of the present application further provides a moire removal device, the moire removal device comprises:

[0139] A locating module M1 is configured to locate a high frequency noise point in a preliminary frequency spectrum image, wherein the preliminary frequency spectrum image is a frequency spectrum image corresponding to a to-be-processed image with moire;

[0140] A removal module M2 is configured to remove the high frequency noise point in the preliminary frequency spectrum image, to obtain a target frequency spectrum image;

[0141] A transformation module M3 is configured to perform a discrete inverse Fourier transform on the target frequency spectrum image, to obtain a target image with removed moire.

[0142] Illustratively, the moire removal device further comprises a discrete Fourier transform module, which is configured to:

[0143] The step of locating the high-frequency noise points in the preliminary frequency spectrum image is preceded by:

[0144] The presence of moire in the image to be processed is subjected to a discrete Fourier transform to obtain a frequency spectrum image corresponding to the presence of moire in the image to be processed.

[0145] Illustratively, the positioning module is further configured to:

[0146] The high-frequency noise points in the preliminary frequency spectrum image are located by image recognition or by noise detection.

[0147] Illustratively, the positioning module is further configured to:

[0148] A region image covered by the initial position of the preset frequency spectrum template is determined in the preliminary frequency spectrum image;

[0149] The structural similarity indexes of each preset frequency spectrum template and the region image are calculated respectively, and the target structural similarity index of the region image is determined according to the structural similarity index corresponding to each preset frequency spectrum template;

[0150] The preset frequency spectrum template is moved in the preliminary frequency spectrum image by a preset step value, and the target structural similarity indexes corresponding to the preliminary frequency spectrum image are calculated;

[0151] Based on all the structural similarity indexes, the high-frequency noise points in the preliminary frequency spectrum image are located.

[0152] Illustratively, the positioning module is further configured to:

[0153] The maximum structural similarity index of the structural similarity index corresponding to each preset frequency spectrum template is determined;

[0154] The maximum structural similarity index is determined as the target structural similarity index of the region image.

[0155] Illustratively, the moire removal device further comprises an adjusting module configured to:

[0156] The step of determining the region image covered by the initial position of the preset frequency spectrum template in the preliminary frequency spectrum image is preceded by:

[0157] A low-frequency region of the preliminary frequency spectrum image is determined, wherein the low-frequency region is a central region of the preliminary frequency spectrum image;

[0158] adjusting a size of a preset spectrum template and a size of a preset step value based on the size of the low-frequency region and the size of the preliminary spectrum image, wherein an area of the preset spectrum template is smaller than an area of the low-frequency region, and the adjusted preset spectrum template is moved in the preliminary spectrum image by the adjusted preset step value, and the preliminary spectrum image is completely covered after the movement.

[0159] The positioning module is further configured to:

[0160] After the step of determining the target structural similarity index of the region image according to the structural similarity index corresponding to each preset spectrum template:

[0161] moving the preset spectrum template in the preliminary spectrum image except the low-frequency region by a preset step value, and calculating the target structural similarity index corresponding to the part of the preliminary spectrum image except the low-frequency region;

[0162] Based on part of the structural similarity index, positioning the high-frequency noise points in the preliminary spectrum image.

[0163] The positioning module is further configured to:

[0164] performing a non-maximum suppression operation on the structural similarity index to delete redundantly positioned pending high-frequency noise points, to obtain target high-frequency noise points.

[0165] The removing module is further configured to:

[0166] traversing the high-frequency noise points, and generating a two-dimensional Gaussian low-pass filter function based on position coordinates of the high-frequency noise points;

[0167] removing the high-frequency noise points of the preliminary spectrum image based on the two-dimensional Gaussian low-pass filter function, to obtain a target spectrum image.

[0168] The moire removal device provided in the application adopts the moire removal method in the above embodiments, and solves the technical problem of difficult moire removal. Compared with the conventional technology, the moire removal device provided in the embodiments of the application has the same beneficial effects as the moire removal method provided in the above embodiments, and other technical features in the moire removal device are the same as the features disclosed in the above embodiments, and thus will not be described here.

[0169] In addition, the embodiments of the application further provide a moire removal device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program implements the steps of the moire removal method when executed by the processor.

[0170] In addition, the embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of the moire removal method.

[0171] It should be noted that, in this document, the terms "comprising", "containing" or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or system. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0172] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, an optical disk) as described above, and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in various embodiments of the present application.

[0173] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A moire removal method characterized by, The method comprises: locating high-frequency noise points in a preliminary frequency spectrum image, wherein the preliminary frequency spectrum image is a frequency spectrum image corresponding to a to-be-processed image with moire; removing the high-frequency noise points in the preliminary frequency spectrum image to obtain a target frequency spectrum image; performing inverse discrete Fourier transform on the target frequency spectrum image to obtain a target image with removed moire; wherein the step of locating high-frequency noise points in the preliminary frequency spectrum image comprises: determining a region image covered by a preset frequency spectrum template in the preliminary frequency spectrum image; calculating a structural similarity index of each preset frequency spectrum template and the region image respectively, and determining a target structural similarity index of the region image according to the structural similarity index corresponding to each preset frequency spectrum template; the forms of the preset frequency spectrum templates are different from each other; moving the preset frequency spectrum template in the preliminary frequency spectrum image by a preset step value to calculate all target structural similarity indexes corresponding to the preliminary frequency spectrum image; locating high-frequency noise points in the preliminary frequency spectrum image based on all the structural similarity indexes.

2. The moire removal method of claim 1, wherein, Before the step of locating high-frequency noise points in the preliminary frequency spectrum image, the method comprises: performing discrete Fourier transform on the to-be-processed image with moire to obtain a frequency spectrum image corresponding to the to-be-processed image with moire.

3. The moire removal method of claim 1, wherein, The step of determining a target structural similarity index of the region image according to the structural similarity index corresponding to each preset frequency spectrum template comprises: determining a maximum structural similarity index of the structural similarity index corresponding to each preset frequency spectrum template; determining the maximum structural similarity index as the target structural similarity index of the region image.

4. The moire removal method of claim 1, wherein, Before the step of determining a region image covered by a preset frequency spectrum template in the preliminary frequency spectrum image, the method comprises: determining a low-frequency region of the preliminary frequency spectrum image, wherein the low-frequency region is a central region of the preliminary frequency spectrum image; adjusting the size of the preset frequency spectrum template and the size of the preset step value based on the size of the low-frequency region and the size of the preliminary frequency spectrum image, wherein the area of the preset frequency spectrum template is smaller than the area of the low-frequency region, and after moving the adjusted preset frequency spectrum template in the preliminary frequency spectrum image by the adjusted preset step value, the adjusted preset frequency spectrum template completely covers the preliminary frequency spectrum image.

5. The moire removal method of claim 4, wherein, After the step of determining a target structural similarity index of the region image according to the structural similarity index corresponding to each preset frequency spectrum template, the method comprises: moving the preset frequency spectrum template in the preliminary frequency spectrum image excluding the low-frequency region by the preset step value to calculate part of the target structural similarity indexes corresponding to the preliminary frequency spectrum image excluding the low-frequency region; locating high-frequency noise points in the preliminary frequency spectrum image based on part of the structural similarity indexes.

6. The moire removal method according to claim 1 or 5, wherein The step of locating high-frequency noise points in the preliminary frequency spectrum image comprises: performing a non-maximum suppression operation on the structural similarity index to delete redundantly located pending high-frequency noise points to obtain target high-frequency noise points.

7. The moire removal method of claim 1, wherein, The step of removing the high-frequency noise points in the preliminary frequency spectrum image to obtain a target frequency spectrum image comprises: traversing the high-frequency noise points, and generating a two-dimensional Gaussian low-pass filter function based on position coordinates of the high-frequency noise points; removing the high-frequency noise points of the preliminary frequency spectrum image based on the two-dimensional Gaussian low-pass filter function to obtain a target frequency spectrum image.

8. A moire removal device characterized by comprising: The apparatus comprises: a positioning module configured to locate high-frequency noise points in a preliminary frequency spectrum image, wherein the preliminary frequency spectrum image is a frequency spectrum image corresponding to a to-be-processed image having moire patterns; a removing module configured to remove the high-frequency noise points in the preliminary frequency spectrum image to obtain a target frequency spectrum image; a transforming module configured to perform inverse discrete Fourier transform on the target frequency spectrum image to obtain a target image from which moire patterns are removed; the positioning module is further configured to: determine a region image in the preliminary frequency spectrum image covered by a starting position pre-set frequency spectrum template; calculate a structural similarity index of each pre-set frequency spectrum template and the region image respectively, and determine a target structural similarity index of the region image according to the structural similarity index corresponding to each pre-set frequency spectrum template; the pre-set frequency spectrum templates are different in shape; move the pre-set frequency spectrum template in the preliminary frequency spectrum image by a pre-set step value, and calculate all target structural similarity indexes corresponding to the preliminary frequency spectrum image; locate high-frequency noise points in the preliminary frequency spectrum image based on all the structural similarity indexes.

9. A moire removal device characterized by comprising: The moire pattern removal device comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program, when executed by the processor, implements the steps of the moire pattern removal method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and when executed by the processor, implements the steps of the moire pattern removal method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image moire removing method and device, terminal equipment and storage medium

    CN112700376A

  • Noise elimination device, noise elimination method, and position specification method

    WO2016051565A1