An image enhancement method for detecting surface defects on wooden boards

By performing Fourier transform and adaptive filtering on the grayscale image of the wooden board surface, the problem of balancing texture and defect prominence in wooden board surface defect detection was solved, improving the detection accuracy and the performance of the deep learning model.

CN120147142BActive Publication Date: 2026-07-17NANJING FORESTRY UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING FORESTRY UNIV
Filing Date
2025-02-25
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing image processing methods struggle to balance texture weakening and defect highlighting in wood surface defect detection, resulting in insufficient detection accuracy and reliability, especially poor defect detection performance against complex texture backgrounds.

Method used

By performing Fourier transform on the grayscale image of the wooden board surface, texture features are analyzed and an adaptive filtering mask is designed to filter out texture frequency components and retain defect frequency components, thereby improving the signal-to-noise ratio and contrast of the image, making it suitable for input to deep learning models.

Benefits of technology

It improves the accuracy and robustness of surface defect detection on wooden boards, is applicable to images with different textures and defect types, enhances the performance of deep learning models, and is easy to integrate into existing systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120147142B_ABST
    Figure CN120147142B_ABST
Patent Text Reader

Abstract

This invention discloses an image enhancement method for detecting defects on the surface of wooden boards, comprising: randomly selecting several rows from a grayscale image of the wooden board surface; performing a Fast Fourier Transform (FFT) on each row of data to calculate the normalized one-sided spectrum of the frequency domain signal and find the first maximum point; recording the average value of the first maximum position corresponding to each row to obtain the key parameter avg_floor; performing a two-dimensional FFT and centering process on the grayscale image of the wooden board surface to obtain fshift; designing a filter mask to weaken the texture of the wooden board; multiplying the mask by fshift to obtain the filtered frequency domain image; and performing inverse centering and a two-dimensional inverse FFT on the frequency domain image to obtain the enhanced image. This invention considers the basic attributes of the image, such as overall contrast and brightness, and effectively highlights surface defects while weakening texture; thus improving the accuracy and robustness of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, specifically to an image enhancement method for detecting defects on the surface of wooden boards. Background Technology

[0002] In industries such as wood processing and furniture manufacturing, the inspection of wood panel surface quality is crucial for ensuring product quality and improving production efficiency. With the continuous development of computer vision technology, automatically detecting surface defects in wood panels using image processing techniques has become a new direction. Image processing technology can automatically identify and locate defect areas through the analysis and processing of wood panel surface images, thereby achieving fast and accurate defect detection. In recent years, deep learning methods have been increasingly used for target detection tasks involving wood panel surface defects. Deep learning, by constructing multi-layer neural networks, can automatically learn features in images, thereby achieving accurate target identification and location. However, the performance of deep learning models largely depends on the quality of the input image. For wood panel surface defect detection tasks, the complex and diverse textures of wood panels often make defect features inconspicuous, posing a significant challenge to automatic detection.

[0003] Existing image processing methods have limitations in detecting defects on wooden board surfaces. Most image enhancement techniques rely on general image processing algorithms, which often struggle to balance texture weakening and defect highlighting when dealing with surface defects. Over-weakening texture may weaken defect information along with the surface, while over-emphasizing defects may make texture a distracting factor. For example, while some image enhancement methods can improve image contrast and clarity to some extent, they often fail to effectively highlight complex textures and minute defect features on wooden board surfaces. Some filtering-based image processing methods may remove some defect information while removing noise, leading to reduced accuracy in defect detection.

[0004] Therefore, there is an urgent need for an image enhancement method specifically designed for the detection of defects on the surface of wood boards. This method should be able to effectively highlight the defect features of the wood board surface while weakening the texture, providing high-quality image input for subsequent defect detection algorithms. This would improve the accuracy and reliability of defect detection on the surface of wood boards, enabling automated and intelligent inspection of wood board surface quality and promoting the development of industries such as wood processing and furniture manufacturing. Summary of the Invention

[0005] The technical problem this invention aims to solve is to provide an image enhancement method for detecting surface defects on wooden boards, addressing the shortcomings of existing technologies. This image enhancement method improves the signal-to-noise ratio and contrast of wooden board images through image enhancement techniques, making them more suitable for use as input to deep learning models, thereby achieving accurate detection of surface defects. Unlike traditional methods, this invention not only considers the overall contrast and brightness of the image but also deeply analyzes the frequency domain differences between the wood texture and defects. By performing Fourier transform on the grayscale image, the frequency components of the image can be separated, thus achieving precise control over texture and defects. An adaptive filtering mask is also designed to effectively highlight surface defects while weakening texture. This method not only improves the accuracy and robustness of defect detection but also provides more valuable image information for subsequent defect classification and recognition.

[0006] To achieve the above-mentioned technical objectives, the technical solution adopted by the present invention is as follows:

[0007] An image enhancement method for detecting surface defects on wooden boards includes:

[0008] Step 1: Receive the input grayscale image img_gray of the wooden board surface, and obtain the number of rows and columns of the image to provide basic data for subsequent processing;

[0009] Step 2: Analyze the texture features of the grayscale image of the wood surface: Randomly select several rows in the image, perform a fast Fourier transform on each row of data, calculate the normalized one-sided spectrum of the frequency domain signal, and find the first maximum point; record the position of the first maximum point corresponding to each row, calculate the average of all the positions of the first maximum point, and round down to obtain the key parameter avg_floor; this parameter reflects the periodic characteristics of the wood surface texture and provides a basis for subsequent filter design;

[0010] Step 3: Perform a two-dimensional fast Fourier transform on the grayscale image of the wooden board surface to obtain a frequency domain image; center the frequency domain image to obtain fshift; so as to facilitate subsequent automatic observation and analysis of the frequency distribution characteristics of the image, as well as subsequent corresponding processing in the image frequency domain;

[0011] Step 4: Based on the avg_floor parameter obtained in Step 2, design a filter mask to weaken the wood texture. The mask is set to 0 within a specific range in the frequency domain to filter out specific frequency components of the wood surface texture, and set to 1 in other parts to retain the frequency components of defects. This weakens the wood surface texture, thus highlighting surface defects. The width of the filtering area is maskwidth, and the filtering areas on both sides extend from the center to the left and right by masklengtha and masklengthb pixels respectively. masklengtha is set to the avg_floor parameter obtained in Step 2, and masklengthb is a fixed value. Multiply the mask by fshift to obtain the filtered frequency domain image fshiftwithMask.

[0012] Step 5: Perform inverse centering on the filtered frequency domain image fshiftwithMask to obtain fishift; perform two-dimensional inverse fast Fourier transform on fishift to obtain the enhanced image img_back; this image retains texture details while highlighting the defect features on the surface of the wooden board, which is convenient for subsequent defect detection algorithms to accurately identify.

[0013] Step 6: Return the enhanced image img_back as input for the wood board surface defect detection task to improve the performance of defect detection.

[0014] As a further improvement to the present invention, step 2 specifically comprises:

[0015] 2.1 Randomly select the row index of the img_gray matrix of the grayscale image of the wooden board surface. The row index is less than the number of rows and greater than 0. Obtain all grayscale values ​​of the row containing the specified index and save them as a sequence y.

[0016] 2.2 Perform a Fast Fourier Transform (FFT) on each row of data y to convert the time-domain signal into a frequency-domain signal, obtaining the corresponding frequency-domain signal fft_y for each row; where FFT is an existing efficient algorithm used to calculate the Discrete Fourier Transform (DFT), which can quickly convert the signal from the time domain to the frequency domain, making it easier to analyze the frequency components of the signal;

[0017] 2.3 Calculate the normalized one-sided spectrum of the frequency domain signal, specifically as follows:

[0018] Calculate the absolute value of the frequency domain signal fft_y to obtain the two-sided spectrum; then divide the spectrum value by the total number of columns cols for normalization; since the FFT result is symmetrical, only half of the spectrum needs to be analyzed. Take the spectrum value of the first half to obtain the normalized one-sided spectrum normalizationhalf_y.

[0019] 2.4 Find the maximum point in the normalized one-sided spectrum normalizationhalf_y and record the position of the first maximum point, that is, save the index value argrelmax_index of the normalizationhalf_y spectrum sequence corresponding to the first maximum point;

[0020] 2.5. Record the position of the first maximum point (argrelmax_index) corresponding to the row containing the randomly selected row index. Calculate the average of all argrelmax_index values ​​and round down to obtain the key parameter avg_floor. This parameter reflects the periodic characteristics of the wood surface texture and will be used in subsequent filter design to effectively highlight defect features and improve the accuracy and reliability of defect detection.

[0021] As a further improvement to the present invention, step 4 specifically comprises:

[0022] 4.1. Create a mask of the same size as the input image, with all its elements initialized to 1. That is, create a two-dimensional array matrix mask with all elements equal to 1, rows and columns. In subsequent steps, specific regions of the mask can be set to 0 to filter out the frequency components of these regions, which can be used to selectively retain or filter out specific frequency components.

[0023] 4.2 Setting relevant parameters: Since the frequency domain image is centered in step 3, the center of the spectrum is moved to the center of the image. Therefore, half of the number of rows (rows) is taken as crow, and half of the number of columns (cols) is taken as ccol. crow and ccol represent the indices of the center row and center column of the frequency domain image, respectively. The width of the filtering area is maskwidth; masklengtha is set to the avg_floor parameter obtained in step 2; masklengthb is a fixed value; maskwidth and masklength_b can be adjusted appropriately according to the actual situation.

[0024] 4.3. Near the center row of the frequency domain image, define the vertical range of the filter by the row range from crow-maskwidth to crow+maskwidth; to the right of the center column of the frequency domain image, define the horizontal range of the filter by the column range from ccol+masklengtha to ccol+masklengthb; similarly, to the left of the center column of the frequency domain image, define the horizontal range of the filter by the column range from ccol-masklengthb to ccol-masklengtha; set the values ​​in the mask within the above ranges to 0 to construct the required filter mask.

[0025] 4.4 Apply the filter mask constructed in step 4.3 to the centered frequency domain image fshift. Specifically, multiply fshift element-wise with the filter mask constructed in step 4.3 to obtain the filtered frequency domain image fshiftwithMask. By multiplying element-wise, the mask is applied to the frequency domain image, filtering out specific frequency components of the wood surface texture while retaining the surface defect components.

[0026] The beneficial effects of this invention are as follows:

[0027] (1) This invention analyzes the periodic characteristics of the wood surface texture and designs a corresponding filter to effectively filter out texture information and highlight defect features. While weakening the texture details of the wood surface, it retains the defect features. This makes the defects more obvious in the image, facilitating accurate identification by subsequent defect detection algorithms and improving the accuracy of defect detection.

[0028] (2) The method of the present invention is applicable to wood surface images with different textures and different defect types, and has strong versatility and adaptability. Whether it is growth rings, wood grain or other complex textures, this method can effectively process them and is suitable for various types of wood surface defect detection tasks.

[0029] (3) The method of the present invention is not only applicable to traditional image processing algorithms, but can also be used as a preprocessing step for deep learning-based target detection tasks. By improving the quality of the input image, the performance of the deep learning model is further improved, making it more accurate and efficient in detecting defects in complex texture backgrounds.

[0030] (4) The method of this invention is based on common image processing techniques and Fourier transform, and is easy to implement and integrate into existing detection systems. It does not require complex hardware or high computing costs, and has high practicality and economy.

[0031] (5) The technical problems solved by the present invention include: In the existing detection of defects on the surface of wooden boards, the surface texture of wooden boards is complex and diverse, resulting in indistinct defect features. Existing image enhancement methods have different effects on different types of defects, and may even have the opposite effect, affecting the accuracy and reliability of defect detection. In addition, although deep learning performs well in target detection tasks, its performance largely depends on the quality of the input image. Existing methods have failed to effectively improve the quality of wooden board surface defect images in the preprocessing stage, thus limiting the application effect of deep learning models in the detection of defects on the surface of wooden boards.

[0032] (6) This invention proposes an image enhancement method specifically for detecting surface defects on wooden boards. This method improves the signal-to-noise ratio and contrast of wooden board images through image enhancement techniques, making them more suitable for use as input to deep learning models, thereby achieving accurate detection of surface defects on wooden boards. Unlike traditional methods, this invention not only considers the overall contrast and brightness of the image, but also deeply analyzes the frequency domain differences between the texture and defects of the wooden board. By performing Fourier transform on the grayscale image, this invention can separate the frequency components of the image, thereby achieving precise control over texture and defects. Based on this, this invention designs an adaptive filtering mask that can dynamically adjust the filtering parameters according to the texture features of different wooden board images, thereby effectively highlighting surface defects while weakening the texture. This method not only improves the accuracy and robustness of defect detection, but also provides more valuable image information for subsequent defect classification and recognition. Attached Figure Description

[0033] Figure 1 This is a grayscale image of the original surface of a wooden board with surface defects.

[0034] Figure 2 This is the frequency domain image obtained by performing a two-dimensional fast Fourier transform on the grayscale image of the entire wooden board surface and then centering it.

[0035] Figure 3 This is a filter mask diagram.

[0036] Figure 4 This is the filtered frequency domain image.

[0037] Figure 5 This is an enhanced image of the wooden board. Detailed Implementation

[0038] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings:

[0039] In current methods for detecting surface defects on wooden boards, the complex and diverse textures of the board surface often result in unclear defect features. Existing image enhancement methods show inconsistent results for different types of defects, and may even have opposite effects, impacting the accuracy and reliability of defect detection. Furthermore, while deep learning excels in object detection tasks, its performance is heavily dependent on the quality of the input image. Current methods fail to effectively improve the quality of wooden board surface defect images during the preprocessing stage, thus limiting the application of deep learning models in wooden board surface defect detection.

[0040] To address the aforementioned issues, this embodiment proposes an image enhancement method specifically for detecting surface defects on wooden boards. This method improves the signal-to-noise ratio and contrast of wooden board images through image enhancement techniques, making them more suitable for use as input to deep learning models, thereby achieving accurate detection of surface defects. Unlike traditional methods, this embodiment not only considers basic attributes such as overall image contrast and brightness but also deeply analyzes the frequency domain differences between wooden board texture and defects. By performing Fourier transform on the grayscale image, this embodiment can separate the frequency components of the image, thus achieving precise control over texture and defects. Based on this, this embodiment designs an adaptive filtering mask that can dynamically adjust filtering parameters according to the texture features of different wooden board images, thereby effectively highlighting surface defects while weakening texture. This method not only improves the accuracy and robustness of defect detection but also provides more valuable image information for subsequent defect classification and recognition. Specifically, an image enhancement method for detecting surface defects on wooden boards includes:

[0041] Step 1: Receive the input grayscale image of the wooden board surface, img_gray (e.g., ...). Figure 1 As shown, obtain the number of rows and columns of the image (rows and cols) to provide basic data for subsequent processing.

[0042] Step 2: Automatically analyze the texture features of the wood board. Randomly select 5 rows from the image, perform a Fast Fourier Transform (FFT) on each row of data, calculate the normalized one-sided spectrum of the frequency domain signal, and find the first maximum point. Record the position of the first maximum point corresponding to each row, calculate the average of these positions, and round down to obtain the key parameter avg_floor. This parameter reflects the periodic characteristics of the wood board surface texture, providing a basis for subsequent filter design.

[0043] Step 3: Perform a two-dimensional fast Fourier transform on the grayscale image of the entire wooden board surface to obtain the frequency domain image f. Then, center the frequency domain image to obtain fshift (e.g., ...). Figure 2 (as shown), so as to facilitate subsequent automatic observation and analysis of the frequency distribution characteristics of the image, as well as the corresponding processing in the image frequency domain.

[0044] Step 4: Based on the avg_floor parameter obtained in Step 2, design a filter mask (e.g., ...) to weaken the wood texture. Figure 3(As shown). The mask is set to 0 in a specific range in the frequency domain to filter out specific frequency components of the wood surface texture, and set to 1 in other parts to retain the frequency components of defects. This weakens the texture of the wood surface, thus highlighting surface defects. The width of the filtering area is maskwidth, and the filtering areas on both sides extend from the center to the left and right by masklengtha and masklengthb pixels respectively, where masklengtha is set to the avg_floor parameter obtained in step 2, and masklengthb is a fixed value. The designed mask is multiplied by fshift to obtain the filtered frequency domain image fshiftwithMask (as shown). Figure 4 (As shown).

[0045] Step 5: Perform inverse centering on the filtered frequency domain image fshiftwithMask to obtain fishift. Perform a two-dimensional inverse fast Fourier transform on fishift to obtain the enhanced image img_back (e.g., Figure 5 (As shown). This image, while preserving texture details, highlights the defect features on the surface of the wooden board, facilitating accurate identification by subsequent defect detection algorithms.

[0046] Step 6: Return the enhanced image img_back as input for the wood board surface defect detection task to improve the performance of defect detection.

[0047] Step 2 specifically includes:

[0048] 2.1. Randomly select 5 rows from the grayscale image of the wooden board surface. The selection of these rows is random to ensure the representativeness and generalization ability of the analysis results. That is, randomly select the row index of the img_gray matrix of the grayscale image of the wooden board surface. The row index is less than the number of rows and greater than 0. Obtain all grayscale values ​​of the row containing the specified index and save them as a sequence y.

[0049] 2.2 Perform a Fast Fourier Transform (FFT) on each row of data y to convert the time-domain signal into a frequency-domain signal, obtaining the frequency-domain signal fft_y for that row. FFT is an existing, efficient algorithm used to calculate the Discrete Fourier Transform (DFT), which can quickly convert a signal from the time domain to the frequency domain, facilitating the analysis of the signal's frequency components.

[0050] 2.3 Calculate the normalized one-sided spectrum of the frequency domain signal. Specifically, calculate the absolute value of the frequency domain signal fft_y to obtain the two-sided spectrum. Then, divide the spectrum value by the total number of columns cols for normalization. Since the FFT result is symmetrical, only half of the spectrum needs to be analyzed. Taking the first half of the spectrum value yields the normalized one-sided spectrum normalizationhalf_y.

[0051] 2.4 The texture of wood surface often exhibits a certain periodicity, such as growth rings and wood grain. These periodic textures manifest as peaks at specific frequencies in the frequency domain. In the frequency domain, periodic textures typically correspond to low-frequency components. By finding the first maximum point, the dominant frequency of these periodic textures can be determined. This dominant frequency reflects the periodic characteristics of the texture, such as the spacing or repetition frequency of the texture. Therefore, finding the first maximum point of the single-sided spectrum can help subsequent steps determine the range of low-frequency components that need to be filtered out. Specifically, the steps involve finding the maximum point in the normalized single-sided spectrum normalizationhalf_y and recording the position of the first maximum point, i.e., saving the index value argrelmax_index of the normalizationhalf_y spectrum sequence corresponding to the first maximum point.

[0052] 2.5 Record the position of the first maximum point (argrelmax_index) for each of the five random rows. Calculate the average of these five argrelmax_index values ​​and round down to obtain the key parameter avg_floor. This parameter reflects the periodicity of the wood surface texture and will be used in subsequent filter design to effectively highlight defect features and improve the accuracy and reliability of defect detection.

[0053] Step 4 specifically includes:

[0054] 4.1. Create a mask of the same size as the input image, with all elements initialized to 1. This creates a two-dimensional array matrix `mask` with all elements equal to 1, `rows` rows, and `cols` columns. Subsequent steps can set specific regions of the mask to 0 to filter out frequency components in those regions, allowing for selective retention or removal of specific frequency components.

[0055] 4.2 Setting Relevant Parameters. Since the frequency domain image is centered in step 3, the center of the spectrum is moved to the center of the image. Therefore, half the number of rows (rows) is taken as crow, and half the number of columns (cols) is taken as ccol. crow and ccol represent the indices of the center row and center column of the frequency domain image, respectively. The width of the filtering region, maskwidth, is set to 5 by default; masklengtha is set to the avg_floor parameter obtained in step 2; masklengthb is set to 400 by default. The default value of 400 is considered sufficient to filter out the periodic features of the wood surface texture. maskwidth and masklengthb can be adjusted appropriately according to the actual situation.

[0056] 4.3. Near the center row of the frequency domain image, define the vertical range of the filter by the row range from crow-maskwidth to crow+maskwidth; to the right of the center column of the frequency domain image, define the horizontal range of the filter by the column range from ccol+masklengtha to ccol+masklengthb; similarly, to the left of the center column of the frequency domain image, define the horizontal range of the filter by the column range from ccol-masklengthb to ccol-masklengtha. Set the values ​​in the mask within the above ranges to 0, thereby designing the required filter mask (e.g., ...). Figure 3 (As shown).

[0057] 4.4. Apply the designed filter mask to the centered frequency domain image fshift. Specifically, fshift is multiplied element-wise with the mask to obtain the filtered frequency domain image fshiftwithMask (e.g., Figure 4 (As shown). By multiplying element-wise, the mask is applied to the frequency domain image to filter out specific frequency components of the wood surface texture while retaining the surface defect components.

[0058] The scope of protection of this invention includes, but is not limited to, the above embodiments. The scope of protection of this invention is defined by the claims. Any substitutions, modifications, or improvements to this technology that are easily conceived by those skilled in the art fall within the scope of protection of this invention.

Claims

1. An image enhancement method for detecting surface defects on wooden boards, characterized in that, include: Step 1: Receive the input grayscale image img_gray of the wooden board surface, and obtain the number of rows and columns of the image; Step 2: Analyze the texture features of the grayscale image of the wooden board surface: Randomly select several rows in the image, perform a fast Fourier transform on each row of data, calculate the normalized one-sided spectrum of the frequency domain signal, and find the first maximum point; record the position of the first maximum point corresponding to each row, calculate the average value of all the positions of the first maximum point, and round down to obtain the key parameter avg_floor; Step 3: Perform a two-dimensional fast Fourier transform on the grayscale image of the wooden board surface to obtain the frequency domain image; center the frequency domain image to obtain fshift; Step 4: Based on the avg_floor parameter obtained in Step 2, design a filter mask to weaken the wood texture; The mask is set to 0 in a specific range in the frequency domain and 1 in other parts; the designed mask is multiplied by fshift to obtain the filtered frequency domain image fshiftwithMask; Step 5: Perform inverse centering on the filtered frequency domain image fshiftwithMask to obtain fishift; perform two-dimensional inverse fast Fourier transform on fishift to obtain the enhanced image img_back; Step 6: Return the enhanced image img_back as input for the wood board surface defect detection task.

2. The image enhancement method for detecting surface defects on wooden boards according to claim 1, characterized in that, Step 2 specifically includes: 2.1 Randomly select the row index of the img_gray matrix of the grayscale image of the wooden board surface. The row index is less than the number of rows and greater than 0. Obtain all grayscale values ​​of the row containing the specified index and save them as a sequence y. 2.2 Perform a Fast Fourier Transform on each row of data y to convert the time-domain signal into a frequency-domain signal, and obtain the corresponding frequency-domain signal fft_y for each row; 2.3 Calculate the normalized one-sided spectrum of the frequency domain signal, specifically as follows: Calculate the absolute value of the frequency domain signal fft_y to obtain the two-sided spectrum; then divide the spectrum value by the total number of columns cols for normalization; since the FFT result is symmetrical, only half of the spectrum needs to be analyzed. Take the spectrum value of the first half to obtain the normalized one-sided spectrum normalizationhalf_y. 2.4 Find the maximum point in the normalized one-sided spectrum normalizationhalf_y and record the position of the first maximum point, that is, save the index value argrelmax_index of the normalizationhalf_y spectrum sequence corresponding to the first maximum point; 2.5 Record the position of the first maximum point corresponding to the row where the randomly selected row index is located, argrelmax_index. Calculate the average of all argrelmax_index and round down to obtain the key parameter avg_floor.

3. The image enhancement method for detecting surface defects on wooden boards according to claim 1, characterized in that, Step 4 specifically includes: 4.

1. Create a mask with the same size as the input image, with all its elements initialized to 1. That is, create a two-dimensional array matrix mask with all elements equal to 1, rows of 1, and columns of 1. 4.2 Setting relevant parameters: Since the frequency domain image is centered in step 3, the center of the spectrum is moved to the center of the image. Therefore, half of the number of rows (rows) is taken as crow, and half of the number of columns (cols) is taken as ccol. crow and ccol represent the indices of the center row and center column of the frequency domain image, respectively. The width of the filtering region is maskwidth; masklengtha is set to the avg_floor parameter obtained in step 2; masklengthb is a fixed value. 4.

3. Near the center row of the frequency domain image, define the vertical range of the filter by the row range from crow-maskwidth to crow+maskwidth; to the right of the center column of the frequency domain image, define the horizontal range of the filter by the column range from ccol+masklengtha to ccol+masklengthb; similarly, to the left of the center column of the frequency domain image, define the horizontal range of the filter by the column range from ccol-masklengthb to ccol-masklengtha; set the values ​​in the mask within the above ranges to 0, thereby designing the required filter mask. 4.4 Apply the filter mask designed in step 4.3 to the centered frequency domain image fshift. Specifically, multiply fshift element-wise with the filter mask constructed in step 4.3 to obtain the filtered frequency domain image fshiftwithMask.