Periodic texture smoothing method and system combining adaptive threshold and position form constraint, computer readable storage medium and computer program product

By using the method of adaptive threshold and position morphological constraints, combined with frequency domain processing and morphological operations, the periodic texture features in the image are automatically removed, which solves the problems of poor adaptability and high computing power in the existing technology and achieves efficient texture smoothing effect.

CN120807339APending Publication Date: 2025-10-17GUANGDONG AOPUTE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510873959.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing technologies have poor adaptability when removing periodic texture features in images and are prone to mistakenly removing non-texture structures in the image. They also require high computing power and have poor adaptability, making it impossible to automatically and efficiently remove periodic texture features without losing image structure.

Method used

Adopting the method of adaptive threshold and position morphological constraint, periodic texture features are identified through frequency domain processing. Morphological operations and filtering techniques are combined to automatically remove non-texture related frequency components, generate a mask image for selective frequency suppression or extraction, and finally reconstruct the spatial domain image through inverse transformation.

Benefits of technology

It can effectively identify periodic texture features of different intensities and scales, avoid accidental deletion of non-texture structures in the image, and ensure the integrity and quality of the main content of the image without the need to obtain texture prior information in advance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807339A_ABST
    Figure CN120807339A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a periodic texture smoothing method and system in combination with an adaptive threshold and a position form constraint, a computer readable storage medium and a computer program product. The method comprises the following steps: carrying out adaptive threshold processing on a frequency domain image to obtain a binary image; performing morphological opening operation on the binary image to obtain a de-noised binary image; performing connected domain analysis on the de-noised binary image, and identifying a set of frequency regions representing texture features; based on the spatial position and geometric morphology characteristics, performing double screening on the identified frequency regions to obtain a screening region set; and combining the screening region set to generate a mask image, and performing selective frequency suppression / extraction on the frequency domain image subjected to the centralization processing according to the mask image to obtain a target image. According to the method, frequency domain analysis and image segmentation are combined, the texture is automatically removed by setting related parameters without losing an image structure, and prior information of the texture does not need to be acquired in advance.
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 in particular to a method, system, computer readable storage medium and computer program product for periodic texture smoothing combined with adaptive threshold and position morphology constraint. BACKGROUND

[0002] With the rapid development of computer vision technology, the ability of visual processing system to analyze and process image data by computer has been significantly improved in various different tasks. Under the background of significant improvement in image information acquisition efficiency, the images obtained in various visual tasks often exhibit significant periodic texture features. These periodic texture features may be derived from regular and repetitive patterns or structures on product surfaces, or may be generated by electronic noise of image acquisition devices. The human visual system can directly distinguish image structures from texture features, but computers still face certain challenges in extracting image significant structures from texture images. Periodic texture features often belong to interfering information components in images, which need to be removed by image periodic texture smoothing algorithms.

[0003] For periodic texture smoothing, the existing technology mainly uses frequency domain method, translation subtraction method and deep learning method for periodic texture smoothing. The frequency domain method generally converts the original image to the frequency domain space by using Fourier transform, processes the frequency domain image, and then uses Fourier inverse transform to obtain the image after texture removal. However, the frequency domain method has poor adaptability, and in different scenarios, it may cause false elimination of non-texture structures in the image, leading to unsatisfactory texture removal effect, image blur and other problems, which will have different degrees of impact on subsequent image processing. For the translation subtraction method, it removes texture by translation subtraction. In the implementation process, the period of the pattern needs to be manually measured for translation elimination. This method has poor adaptability, is time-consuming, and also has the problem of false elimination of non-texture structures in the image. The deep learning method needs a large amount of manual annotation of data in the early stage, has high requirements for computing power, and needs to re-annotate and train the network for different image periodic texture types, which has poor adaptability. Therefore, how to automatically and efficiently remove image periodic texture features without losing and retaining image structures is still a challenging and practical task in the field of computer vision. SUMMARY

[0004] The present application aims to provide a method, system, computer readable storage medium and computer program product for periodic texture smoothing combined with adaptive threshold and position morphology constraint, to solve or at least partially solve the technical problems mentioned in the background.

[0005] To achieve this purpose, the present application adopts the following technical solutions:

[0006] In a first aspect, the present application provides a method for periodic texture smoothing combining adaptive threshold and position morphology constraint, comprising:

[0007] mapping the input gray image from spatial domain to frequency domain to obtain a frequency domain image and applying centering processing, and then calculating a frequency spectrum according to the frequency domain image after the centering processing;

[0008] applying mean filtering to the frequency spectrum after the smoothing processing to obtain a local mean image;

[0009] calculating a difference image of the smoothed frequency spectrum and the local mean image, performing binary filtering on the difference image to obtain a binary image, and performing an opening operation on the binary image to obtain a denoised binary image;

[0010] performing connected domain analysis on the denoised binary image to identify a set of frequency regions representing texture features;

[0011] performing double screening on the identified frequency regions based on spatial position and geometric morphology characteristics to remove non-texture-related frequency components, and obtaining a set of screened regions;

[0012] merging the set of screened regions to generate a mask image, and performing selective frequency suppression / extraction on the frequency domain image after the centering processing according to the mask image to obtain a target image;

[0013] reconstructing a spatial domain image through inverse transformation on the target image to obtain a final result image.

[0014] Optionally, the mapping of the input gray image from spatial domain to frequency domain to obtain a frequency domain image and applying centering processing, and then calculating a frequency spectrum according to the frequency domain image after the centering processing specifically comprises:

[0015] applying two-dimensional discrete Fourier transform to the input image I(x, y) according to the formula:

[0016] u∈[0,W-1],v∈[0,H-1],j represents an imaginary unit, W is the image width, and H is the image height;

[0017] applying centering processing to the frequency domain image F(u, v) to obtain F'(u, v), and using quadrant exchange method to move the frequency spectrum zero point to the center position according to the row and column parity of the frequency domain image, and calculating the center point coordinates (c x ,c y ) of the frequency domain image; wherein c x =W / 2 and c y =H / 2;

[0018] calculating a frequency spectrum according to the frequency domain image after the centering processing according to the formula:

[0019] Re represents the real part of the frequency domain graph, and Im represents the imaginary part.

[0020] Optionally, the spectrum graph is smoothed and then mean filtering is applied to obtain a local mean image, specifically including:

[0021] A Gaussian kernel is applied to the spectrum graph M(u,v) for smoothing filtering to obtain a smoothed spectrum graph M'(u,v);

[0022] A mean filter is constructed, defined as a m x m matrix, and each element value is 1 / m 2 The mean filtering is applied to the spectrum graph M'(u,v) to obtain a local mean image M''(u,v), and the formula is:

[0023]

[0024] Optionally, the difference graph of the smoothed spectrum graph and the local mean image is calculated, the difference graph is binarized to obtain a binary graph, and morphological opening operation is performed on the binary graph to obtain a denoising binary graph, specifically including:

[0025] The difference graph is calculated to highlight the frequency components that are locally higher than the average value, and the formula is:

[0026] D(u,v) = M'(u,v) - M''(u,v);

[0027] A threshold T is applied for binarization processing, and the formula is:

[0028]

[0029] Morphological opening operation is applied to the binary graph B(u,v) to remove small noise to obtain a denoising binary graph B'(u,v), and the method is:

[0030] B'(u,v) = max(minB(u+e+g,v+f+h)), where (e,f) ∈ S, (g,h) ∈ S, and S is a predefined structure element.

[0031] Optionally, connected domain analysis is performed on the denoising binary graph to identify a set of frequency regions representing texture features, specifically including:

[0032] A method based on run-length coding is used to scan the binary graph B'(u,v) to identify all pixel segments that are continuous 1, denoted as a run set R = {r1,r2,...,r m} Each run r i contains a starting position (x i ,y i ) and a length l i ;

[0033] The connectivity analysis of the run-encoding sequence by eight-neighborhood obtains a set of frequency regions C = {c1, c2,..., c n};

[0034] The identified frequency regions are double-filtered based on spatial position and geometric morphology characteristics to remove non-texture-related frequency components, obtaining a set of filtered regions, specifically including:

[0035] For each connected region c k , a spectrum center inclusion determination function is executed to filter out a set of regions C' that do not contain a center point, with the function expression being:

[0036]

[0037] where c k is the kth connected region, c x and c y are the x and y coordinates of the spectrum center point, r i is the i-th run belonging to the connected region c k , x i is the starting x coordinate of the run r i , y i is the y coordinate where the run r i is located, and l i is the length of the run r i .

[0038] Optionally, the double filtering of the identified frequency regions based on spatial position and geometric morphology characteristics to remove non-texture-related frequency components to obtain a set of filtered regions further includes:

[0039] For each region c k ∈ C', the minimum circumscribed rectangle parameters (width k , height k , angle k ) are calculated, where angle k is the principal axis direction, width k is the rectangle width, and height k is the rectangle height.

[0040] The morphology ratio index WHRatio k = max(height k / width k , width k / height k ) of each region is calculated.

[0041] Apply the ratio threshold WHRatioTH to perform secondary screening, and obtain the screening area set C" = {c k |WHRatio k <WHRatioTH,c k ∈C'}.

[0042] Optionally, the minimum bounding rectangle parameters are calculated as follows:

[0043] Using principal component analysis, we calculated the area c k The covariance matrix of all pixels in Σk;

[0044] Perform eigenvalue decomposition on the covariance matrix Σk to obtain the eigenvalue λ1 k ,λ2 k and the corresponding eigenvector v1 k 、v2 k ;

[0045] According to the feature vector v1 k Determine the first principal axis direction of the rectangle and the eigenvector v2 k Determine the second principal axis direction of the rectangle; wherein the first principal axis direction is denoted as anglek1, and the second principal axis direction is denoted as anglek2, which are respectively expressed as anglek1=arctan(v1 k .y,v1 k .x), anglek2=arctan(v2 k .y,v2 k .x); ".y" represents the component of the vector in the y direction, and ".x" represents the component of the vector in the x direction;

[0046] According to area c k Calculate the rectangle width width from the projection range in the first principal axis direction k , and according to the area c k Calculate the height of the rectangle within the projection range in the direction of the second principal axis. k .

[0047] Optionally, merging the set of screening regions to generate a mask image, and performing selective frequency suppression / extraction on the centered frequency domain image according to the mask image to obtain a target image specifically includes:

[0048] Create a blank binary mask image O(u,v) of the same size as the spectrogram; merge all regions in the filter region set C' into the mask image:

[0049]

[0050] Constructing a rectangular structuring element SE for dilation, applying dilation operation to the mask image O(u,v) to expand the region boundary to obtain O'(u,v), the method is:

[0051] O'(u,v)=max(O(u-a,v-b)), (a,b)∈SE;

[0052] Applying frequency domain filtering to the centering processed frequency domain graph F'(u,v), the method is:

[0053] If texture removal is performed, the target image F''(u,v)=F'(u,v)·O'(u,v)

[0054] If texture extraction is performed, first invert O'(u,v) to obtain O''(u,v), and the obtained target image F''(u,v)=F'(u,v)·O''(u,v).

[0055] Optionally, the target image is reconstructed into a spatial domain image through inverse transformation to obtain a final result image, specifically comprising:

[0056] Applying inverse centering operation to the filtered frequency domain graph F''(u,v) to restore the image space position to obtain F'''(u,v);

[0057] Applying two-dimensional discrete inverse Fourier transform to obtain the final result image I'(x,y), the formula is:

[0058] x∈[0,W-1], y∈[0,H-1].

[0059] Optionally, the threshold T is an integer multiple of .

[0060] The second aspect, the present application provides a kind of periodic texture smoothing of combination adaptive threshold and position morphological constraint, comprising:

[0061] Image pre-processing module, for the input gray image from spatial domain is mapped to frequency domain, obtains frequency domain graph and applies centering processing, then according to the frequency spectrum diagram calculated after centering processing;

[0062] Denoising module, electric connection image pre-processing module, for the frequency spectrum diagram is applied mean filter after smoothing processing, obtains local mean image;

[0063] Binary image acquisition module, electric connection denoising module, for the difference graph of smoothed frequency spectrum diagram and local mean image is calculated, the difference graph is binarized and filtered to obtain binary image, also for the binary image is opened and operated morphologically, obtains denoising binary image;

[0064] A connected domain analysis module is electrically connected to the binary image acquisition module, configured to perform connected domain analysis on the denoised binary image, and identify a set of frequency regions representing texture features;

[0065] A region screening module is electrically connected to the connected domain analysis module, configured to perform double screening on the identified frequency regions based on spatial position and geometric morphology characteristics, remove non-texture-related frequency components, and obtain a set of screened regions;

[0066] An inhibition / extraction module is electrically connected to the region screening module, configured to combine the set of screened regions to generate a mask image, and perform selective frequency inhibition / extraction on the centering-processed frequency domain image according to the mask image, to obtain a target image;

[0067] An image output module is electrically connected to the inhibition / extraction module, configured to reconstruct a spatial domain image by inverse transformation on the target image, to obtain a final result image.

[0068] Optionally, the image preprocessing module is specifically configured to:

[0069] Apply a two-dimensional discrete Fourier transform to the input image I(x, y), with the formula being:

[0070] u∈[0,W-1],v∈[0,H-1],j represents an imaginary unit, W is the image width, and H is the image height;

[0071] Apply centering processing to the frequency domain image F(u, v) to obtain F'(u, v), and according to the row and column parity of the frequency domain image, use the quadrant exchange method to move the spectral zero frequency point to the center position, and calculate the center point coordinates (c x ,c y ) of the frequency domain image; wherein c x =W / 2 and c y =H / 2;

[0072] Calculate the spectral image according to the centering-processed frequency domain image, with the formula being:

[0073] Re represents the real part of the frequency domain image, and Im represents the imaginary part.

[0074] Optionally, the denoising module is specifically configured to:

[0075] Apply Gaussian kernel smoothing filtering processing to the spectral image M(u, v) to obtain a smoothed spectral image M'(u, v);

[0076] Construct a mean filter defined as a m×m matrix, with each element value being 1 / m2, and apply mean filtering to the spectral image M'(u, v) to obtain a local mean image M''(u, v), with the formula being:

[0077]

[0078] Optionally, the binary map obtaining module is specifically configured to:

[0079] calculate a difference map highlighting the frequency components that are locally higher than the average, according to the formula:

[0080] D(u, v) = M'(u, v) - M"(u, v);

[0081] apply a threshold value T for binary processing, according to the formula:

[0082]

[0083] apply a morphological opening operation to the binary map B(u, v) to remove small noise and obtain a denoised binary map B'(u, v), according to the method:

[0084] B'(u, v) = max(min B(u+e+g, v+f+h)), where (e, f) ∈ S and (g, h) ∈ S, and S is a predefined structure element.

[0085] Optionally, the connected domain analysis module is specifically configured to:

[0086] scan the binary map B'(u, v) using a run-length coding-based method to identify all pixel segments that are continuous 1, denoted as a run set R = {r1, r2,..., r m}, where each run r i contains a starting position (x i , y i ) and a length l i ;

[0087] perform connectivity analysis on the run-length coding sequence using eight-neighborhood to obtain a set of frequency regions C = {c1, c2,..., c n};

[0088] The region screening module is specifically configured to:

[0089] execute a spectrum map center inclusion determination function on each connected region c k to screen out a set of regions C' that do not contain a center point, according to the function expression:

[0090]

[0091] where c k represents the kth connected region, c x and c y represent the x-coordinate and y-coordinate of the spectrum center point, respectively, and r irepresents the i-th run belonging to the connected region c k represents the starting x coordinate of the run r i represents the starting x coordinate of the run r i represents the y coordinate where the run r i represents the y coordinate where the run r i represents the length of the run r i represents the length of the run r i .

[0092] Optionally, the region screening module is further configured to:

[0093] calculate a minimum bounding rectangle parameter (width k , height k , angle k ) for each region c k ∈C'; wherein angle k is a principal axis direction, width k is a rectangle width, and height k is a rectangle height;

[0094] calculate a shape ratio index WHRatio k of each region, wherein WHRatio k = max (height k / width k , width k / height k ) ;

[0095] apply a ratio threshold WHRatioTH to perform secondary screening to obtain the screened region set C'' = {c k | WHRatio k < WHRatioTH, c k ∈C'}.

[0096] Optionally, the method for calculating the minimum bounding rectangle parameter is specifically:

[0097] perform principal component analysis to calculate a covariance matrix Σk of all pixel points in the region c k ;

[0098] perform eigenvalue decomposition on the covariance matrix Σk to obtain eigenvalues λ1 k , λ2 k and corresponding eigenvectors v1 k , v2 k ;

[0099] determine a first principal axis direction of the rectangle according to the eigenvector v1 k , and determine a second principal axis direction of the rectangle according to the eigenvector v2determining a second principal axis direction of the rectangle; wherein the first principal axis direction is denoted as anglek1, and the second principal axis direction is denoted as anglek2, and are respectively expressed as anglek1=arctan(v1 k .y, v1 k .x), and anglek2=arctan(v2 k .y, v2 k .x); ".y" represents a component in the direction of vector y, and ".x" represents a component in the direction of vector x;

[0100] according to the region c k a projection range in the first principal axis direction is calculated as a rectangle width width k , and according to the region c k a projection range in the second principal axis direction is calculated as a rectangle height height k .

[0101] Optionally, the suppression / extraction module is specifically configured to:

[0102] a blank binary mask image O(u, v) of the same size as the spectrum graph is created; all regions in the set of screening regions C" are merged into the mask image:

[0103]

[0104] a rectangular structural element SE for expansion is constructed, and an expansion operation is applied to the mask image O(u, v) to expand the region boundary to obtain O'(u, v), and the method is as follows:

[0105] O'(u, v)=max(O(u-a, v-b)), (a, b)∈SE;

[0106] a frequency domain filtering is applied to the centralized frequency domain graph F'(u, v), and the method is as follows:

[0107] if texture removal is performed, the target image F"(u, v)=F'(u, v)·O'(u, v)

[0108] if texture extraction is performed, O'(u, v) is inverted to obtain O"(u, v), and the obtained target image F"(u, v)=F'(u, v)·O"(u, v).

[0109] Optionally, the image output module is specifically configured to:

[0110] an inverse centralization operation is applied to the filtered frequency domain graph F"(u, v) to restore the image space position, and F'"(u, v) is obtained;

[0111] The two-dimensional discrete inverse Fourier transform is applied to obtain a final result image I'(x, y), and the formula is:

[0112] x∈[0,W-1],y∈[0,H-1]。

[0113] Optionally, the threshold T is an integer multiple of .

[0114] In a third aspect, the present application also provides a computer readable storage medium, wherein the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to implement the method for periodic texture smoothing combined with adaptive threshold and position morphology constraint as described above.

[0115] In a fourth aspect, the present application also provides a computer program product, which comprises a computer program / instruction, and when the computer program / instruction is executed by a processor, the method for periodic texture smoothing combined with adaptive threshold and position morphology constraint as described above is implemented.

[0116] Compared with the prior art, the present application has the following beneficial effects:

[0117] The present application identifies the significant frequency points by comparing the difference between the pixel points and the average value of the local neighborhood on the spectrum graph, and extracts the high-intensity frequency components representing the periodic texture from the smoothed spectrum by combining with the morphological operation, effectively identifies the periodic texture features of different intensity and scale, and has a certain robustness to complex scenes; the high-intensity frequency region is screened based on the spatial position and geometric morphological characteristics, effectively avoiding the false deletion of non-texture structures in the image, and ensuring the integrity and quality of the main content of the processed image; the frequency domain analysis and image segmentation are combined, and the related parameters are set to automatically remove the texture without losing the image structure, and the prior information of the texture does not need to be obtained in advance. BRIEF DESCRIPTION OF DRAWINGS

[0118] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0119] Figure 1 A flowchart of a method for periodic texture smoothing combined with adaptive threshold and position morphology constraint is provided for the embodiments of the present application.

[0120] Figure 2 An input image is provided for the embodiments of the present application.

[0121] Figure 3 A smoothed spectrum diagram provided by an embodiment of the present invention.

[0122] Figure 4 Based on Figure 3 A binary image.

[0123] Figure 5 Based on Figure 4 A denoised binary image.

[0124] Figure 6 A schematic diagram of a set of frequency regions for characterizing texture features provided by an embodiment of the present invention.

[0125] Figure 7 The embodiment of the present invention provides Figure 6 The resulting target image.

[0126] Figure 8 This is a final result image after periodic texture removal processing provided by an embodiment of the present invention.

[0127] Figure 9 This is a final result image after completing periodic texture extraction processing provided by an embodiment of the present invention.

[0128] Figure 10 Another input image provided by an embodiment of the present invention.

[0129] Figure 11 Another smoothed spectrum diagram provided by an embodiment of the present invention.

[0130] Figure 12 Based on Figure 11 A denoised binary image.

[0131] Figure 13 Another final result image after periodic texture removal processing is provided in an embodiment of the present invention.

[0132] Figure 14 Another final result image of completing the periodic texture extraction process provided by an embodiment of the present invention.

[0133] Figure 15 A schematic diagram of the architecture of a system for periodic texture smoothing that combines adaptive thresholding and position morphology constraints, provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0134] In order to make the application purposes, features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the following described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0135] Embodiment one:

[0136] The scheme proposed in this embodiment first calculates a frequency spectrum graph by using Fourier transform and performs smoothing processing, then identifies a high-frequency region containing periodic texture from the frequency domain graph by using an adaptive threshold and morphological operation; then, the region is screened in terms of spatial position and geometric shape to remove structural frequency regions irrelevant to the texture; selective frequency suppression is realized by morphological operation and filtering method; finally, the spatial domain image is reconstructed by using inverse Fourier transform to achieve the purpose of smoothing the periodic texture. This method can automatically and efficiently remove the periodic texture features of the image without losing and retaining the structure of the image.

[0137] Specifically, refer to Figure 1 , Figure 1 A flowchart of a method for smoothing periodic texture combining adaptive threshold and position and shape constraints according to an embodiment of the present application is provided, and the method specifically includes:

[0138] Step 110: mapping the input grayscale image from the spatial domain to the frequency domain to obtain a frequency domain graph and applying centering processing, and then calculating a frequency spectrum graph according to the frequency domain graph after the centering processing.

[0139] Step 110 specifically includes:

[0140] Step 111: applying two-dimensional discrete Fourier transform to the input image I(x, y).

[0141] In this embodiment, the two-dimensional discrete Fourier transform formula is:

[0142] u∈[0,W-1],v∈[0,H-1],j represents an imaginary unit, W is the width of the image, and H is the height of the image.

[0143] Step 112: applying centering processing to the frequency domain graph F(u, v) to obtain F'(u, v), and using the quadrant exchange method to move the zero frequency point of the frequency spectrum to the center position according to the row and column parity of the frequency domain graph, and calculating the center point coordinates of the frequency domain graph.

[0144] Let the center point coordinates of the frequency domain graph be (c x ,c y ), wherein c xW / 2, c y H / 2.

[0145] Step 113, calculate the frequency spectrum graph according to the centralized frequency domain graph.

[0146] Specifically, in this embodiment, the frequency spectrum graph calculation formula is:

[0147] Re represents the real part of the frequency domain graph, and Im represents the imaginary part.

[0148] Step 120, after smoothing the frequency spectrum graph, apply mean filtering to obtain a local mean image.

[0149] Step 120 specifically includes:

[0150] Step 121, apply Gaussian kernel smoothing filtering to the frequency spectrum graph M(u, v) to obtain the smoothed frequency spectrum graph M'(u, v).

[0151] Step 122, construct a mean filter defined as an m x m matrix, each element value is 1 / m2, apply mean filtering to the frequency spectrum graph M'(u, v) to obtain a local mean image M''(u, v), the formula is:

[0152]

[0153] Step 130, calculate the difference graph of the smoothed frequency spectrum graph and the local mean image, apply binaryzation filtering to the difference graph to obtain a binary graph, and perform morphological opening operation on the binary graph to obtain a denoising binary graph.

[0154] Step 130 specifically includes:

[0155] Step 131, calculate the difference graph to highlight the frequency components that are locally higher than the average value.

[0156] In this embodiment, the difference graph calculation formula is:

[0157] D(u, v) = M'(u, v) - M''(u, v);

[0158] Step 132, apply threshold T for binaryzation processing.

[0159] In this embodiment, the binaryzation formula is:

[0160]

[0161] Wherein, the threshold T is an integer multiple of , such as , etc.

[0162] Step 133, apply morphological opening operation to the binary image B(u, v) to remove small noise and obtain a denoised binary image B'(u, v).

[0163] The opening operation method is:

[0164] B'(u, v) = max(min B(u+e+g, v+f+h));

[0165] Wherein, min represents the erosion operation, (e, f) is the parameter of the erosion operation, max represents the dilation operation, (g, h) is the parameter of the dilation operation, (e, f) ∈ S, (g, h) ∈ S, S is a predefined structure element.

[0166] Step 140, perform connected component analysis on the denoised binary image to identify a set of frequency regions representing texture features.

[0167] Step 140 specifically includes:

[0168] Step 141, scan the binary image B'(u, v) using a run-length coding based method to identify all pixel segments that are continuous 1, denoted as a run set R = {r1, r2,..., r m}.

[0169] Each run r i in the run set R contains a starting position (x i , y i ) and a length l i .

[0170] Step 142, perform connectivity analysis on the run-length coding sequence using eight-neighborhood to obtain a set of frequency regions C = {c1, c2,..., c n}.

[0171] Step 150, based on spatial position and geometric morphological characteristics, double-screen the identified frequency regions to remove non-texture related frequency components and obtain a screened region set.

[0172] Step 150 specifically includes:

[0173] Step 151, perform a spectrum graph center inclusion decision function on each connected region c k to screen out a set of regions C' that do not contain a center point.

[0174] The function expression in step 151 is:

[0175]

[0176] Wherein, c k represents the kth connected region, c x and cy Represents the x-coordinate and y-coordinate of the center point of the spectrum, r i Indicates that it belongs to the connected area c k The i-th run, x i Represents run length r i The starting x coordinate, y i Represents run length r i The y coordinate of the location, l i Represents run length r i length.

[0177] Step 152: For each region c k ∈C', calculate its minimum bounding rectangle parameters.

[0178] In this step, the minimum bounding rectangle parameter is expressed as (width k ,height k ,angle k ); where angle k The main axis direction, width k is the rectangle width, height k is the height of the rectangle;

[0179] More specifically, the calculation process of the minimum bounding rectangle parameters includes:

[0180] Step 1521: Use principal component analysis to calculate the region c k The covariance matrix Σk of all pixels in .

[0181] Step 1522: Perform eigenvalue decomposition on the covariance matrix Σk to obtain the eigenvalue λ1 k ,λ2 k and the corresponding eigenvector v1 k 、v2 k .

[0182] Step 1523: According to the feature vector v1 k Determine the first principal axis direction of the rectangle and the eigenvector v2 k Determines the orientation of the rectangle's second principal axis.

[0183] In this embodiment, the first principal axis direction is denoted as anglek1, and the second principal axis direction is denoted as anglek2, which are respectively expressed as anglek1=arctan(v1 k .y,v1 k .x), anglek2=arctan(v2 k .y,v2 k .x);

[0184] In the above expression, ".y" represents the component in the direction of vector y, and ".x" represents the component in the direction of vector x.

[0185] Step 1524, according to the region c k The projection range in the first principal axis direction calculates the rectangular width width k , and according to the region c k The projection range in the second principal axis direction calculates the rectangular height height k .

[0186] Step 153, calculate the shape ratio index of each region, apply the ratio threshold WHRatioTH for secondary screening to obtain a screening region set.

[0187] In this step, the shape ratio index WHRatio k = max(height k / width k , width k / height k ), and the screening region set C" = {c k | WHRatio k < WHRatioTH, c k ∈ C'}.

[0188] Step 160, merge the screening region set to generate a mask image, and perform selective frequency suppression / extraction on the centering processed frequency domain graph according to the mask image to obtain a target image.

[0189] Step 160 specifically includes:

[0190] Step 161, create a blank binary mask image O(u,v) with the same size as the spectrum graph.

[0191]

[0192] Step 162, merge all regions in the screening region set C" to the mask image.

[0193] Step 163, construct a rectangular structure element SE for expansion, apply the expansion operation to the mask image O(u,v) to expand the region boundary to obtain O'(u,v), and the method is:

[0194] O'(u,v) = max(O(u-a,v-b)), (a,b) ∈ SE;

[0195] Step 163, apply frequency domain filtering to the centering processed frequency domain graph F'(u,v) to obtain a target image.

[0196] In step 163, the application method of frequency domain filtering is:

[0197] If texture removal is performed, the target image F''(u,v) = F'(u,v) O'(u,v)

[0198] If texture extraction is performed, first, O'(u,v) is inverted to obtain O''(u,v), and the obtained target image F''(u,v) = F'(u,v) O''(u,v).

[0199] Step 170, reconstructing a spatial domain image by inverse transformation on the target image to obtain a final result image.

[0200] Step 170 specifically includes:

[0201] Step 171, applying an inverse centering operation on the filtered frequency domain image F''(u,v) to restore the image spatial position to obtain F'''(u,v);

[0202] Step 172, applying a two-dimensional discrete inverse Fourier transform to obtain a final result image I'(x,y).

[0203] In this step, the transformation formula is as follows:

[0204] x∈[0,W-1],y∈[0,H-1]。

[0205] For ease of understanding, two specific examples are also given below.

[0206] Example 1:

[0207] As shown in the accompanying Figure 2 , an input image provided by an embodiment of the present application is required to remove fabric texture while ensuring the main structure of the image. Figure 2

[0208] Specifically, a two-dimensional discrete Fourier transform is applied to the input image to obtain a frequency domain image, wherein the frequency domain image has a height H = 384, a width W = 384, and a center point coordinate (192, 192).

[0209] Subsequently, the image is subjected to centering processing, that is, the pixels in the first quadrant rectangular range (0-191 rows, 192-383 columns) are exchanged with the pixels in the third quadrant rectangular range (192-383 rows, 0-191 columns) as a whole, and the pixels in the second quadrant rectangular range (0-191 rows, 0-191 columns) are exchanged with the pixels in the fourth quadrant rectangular range (192-383 rows, 192-383 columns) as a whole, to obtain a centered frequency domain image F'(u,v).

[0210] ​Then the spectrum amplitude map is calculated and a Gaussian kernel is applied for smoothing filtering, where the size of the Gaussian kernel is 3*3 and sigma=0.8. The smoothed spectrum amplitude map M'(u,v) is shown in Figure 3 .

[0211] Further, mean filtering is applied to M'(u,v), where the filtering kernel is rectangular and the size is 127*127.

[0212] The difference map is obtained by subtracting the mean filtered map from M'(u,v), and the binary map is obtained by binarizing the difference map, where the binarization threshold is The binary map is shown in Figure 4 .

[0213] Finally, the morphological opening operation is applied to the binary map to obtain B'(u,v), where the morphological kernel is rectangular and the size is 3*3 (the size and shape of the structure element S need to be set). The binary map B'(u,v) after the opening operation is shown in the attached Figure 5 .

[0214] Further, the connected component analysis based on run-length encoding is performed on B'(u,v) to obtain the region set C={c1, c2,..., c 17}, and the center inclusion judgment of the spectrum map is performed on each connected region, where the C9 region containing the image center is excluded, as shown in Figure 6 .

[0215] The width-height ratio of the minimum bounding rectangle of the remaining regions is calculated, and the result is:

[0216] [1.4, 2.0, 1.2, 2.0, 1.8, 1.9, 2.3, 1.9, 2.3, 1.8, 2.0, 1.2, 2.0, 1.1, 1.1, 1.4], and the width-height ratio threshold is set to 3. In this example, no region is excluded.

[0217] Further, a blank binary mask image of the same size as the spectrum map is created, and the initial value is 1;

[0218] All regions in the final filtered region set are merged into the mask image, i.e. the pixels at the positions belonging to the region set are set to 0;

[0219] The dilation operation is applied to the mask image to obtain O'(u,v), where the morphological kernel is rectangular and the size is 5*5. The inverse of O'(u,v) is obtained as O"(u,v);

[0220] The frequency domain filtering is applied to the centered frequency domain image F'(u,v) and O'(u,v), and the corresponding pixel values are multiplied to obtain F"(u,v), and the result is shown in Figure 7 .

[0221] Finally, frequency domain filtering is applied to F'(u,v) and O″(u,v) to obtain F″′(u,v).

[0222] Furthermore, an inverse centering operation is applied to the filtered frequency domain image F″(u,v) to restore the image spatial position, and then a two-dimensional discrete inverse Fourier transform is applied to output the final result image.

[0223] like Figure 8 As shown, the periodic texture removal process is completed; at the same time, the same operation is performed on F″′(u,v) to obtain the extracted fringe image as shown in Figure 9 As shown, the image is highlighted to maximize contrast.

[0224] Example 2:

[0225] like Figure 10 As shown, Figure 10 This is another input image provided by an embodiment of the present invention. This example requires removing oblique stripes while maintaining the main structure of the image.

[0226] The operation is basically the same as in Example 1. In this example, the spectrum graph has a height of H = 1034, a width of W = 750, and a center coordinate of (517, 375). The Gaussian kernel size is 9*9, sigma = 1.7, and the smoothed spectrum amplitude graph M′(u,v) is as follows Figure 11 shown.

[0227] The binarization threshold is changed to The binary graph B'(u,v) after the opening operation is as follows Figure 12 shown.

[0228] Then perform run-length coding connected domain analysis on B'(u,v) to obtain a region set, and obtain a region set C = {c1,c2,...,c 35}, and perform the spectrum center inclusion judgment for each connected region, where C 20 Regions containing the image center are excluded, e.g. Figure 12 Shown in the middle area.

[0229] Calculate the minimum aspect ratio of the bounding rectangle of the remaining area, and the result is:

[0230] [1.0,1.2,1.0,1.0,1.5,1.1,1.0,1.4,1.0,1.2,1.1,1.1,1.0,3.0,1.0,6.0,6.0,3.0,3.0,3.0,1.1,1.1,1.1,1.0,1.4,1.0,1.5,1.0,1.0,1.1,1.2,1.3,1.3,1.0], set the aspect ratio threshold to 3, C 14 , C 16 , C 17C 18 C 19 C 20 The region is excluded, as shown by the red region outside the intermediate region. Figure 12 The intermediate region is shown in the red region.

[0231] The mask image is recalculated, and frequency filtering and other operations are applied, which will not be described here. The final result image is shown in Figs. Figure 13 and Figure 14 , and the periodic texture removal and extraction process is completed.

[0232] In summary, compared with the prior art, the present application has at least the following beneficial effects:

[0233] First, by comparing the difference between the pixel point and its local neighborhood average value on the spectrum graph, the significant frequency points are identified, and combined with morphological operation, the high-intensity frequency components representing periodic texture are extracted from the smoothed spectrum, effectively identifying periodic texture features of different intensity and scale, and having certain robustness to complex scenes.

[0234] Second, by center point exclusion and morphological proportion constraint, the high-intensity frequency region is screened, effectively avoiding the deletion of non-texture structure in the image, and ensuring the integrity and quality of the main content of the processed image.

[0235] Third, by expanding the shielding range of the texture frequency component through dilation operation, the diffusion area of the texture in the frequency domain is effectively covered, ensuring that the related components are completely removed or extracted.

[0236] Fourth, by combining frequency domain analysis with image segmentation, the texture is automatically removed or extracted by setting relevant parameters without prior information of the texture.

[0237] Embodiment two:

[0238] Please refer to Figure 15 , Figure 15 for the architecture principle diagram of a periodic texture smoothing system combining adaptive threshold and position morphological constraint provided by the embodiment of the present application. The system specifically includes:

[0239] An image preprocessing module 10 is used to map the input grayscale image from the spatial domain to the frequency domain, obtain the frequency domain graph and apply the centering process, and then calculate the frequency spectrum graph according to the frequency domain graph after the centering process;

[0240] A denoising module 20 is electrically connected to the image preprocessing module 10, which is used to smooth the frequency spectrum graph and then apply mean filtering to obtain a local mean image;

[0241] The binary image acquisition module 30 is electrically connected to the denoising module 20, configured to calculate a difference image of the smoothed frequency spectrum image and the local mean image, perform binary filtering on the difference image to obtain a binary image, and perform morphological opening operation on the binary image to obtain a denoised binary image.

[0242] The connected domain analysis module 40 is electrically connected to the binary image acquisition module 30, configured to perform connected domain analysis on the denoised binary image to identify a set of frequency regions representing texture features.

[0243] The region screening module 50 is electrically connected to the connected domain analysis module 40, configured to perform double screening on the identified frequency regions based on spatial position and geometric morphological characteristics, remove non-texture-related frequency components, and obtain a set of screened regions.

[0244] The suppression / extraction module 60 is electrically connected to the region screening module 50, configured to combine the set of screened regions to generate a mask image, and perform selective frequency suppression / extraction on the centering processed frequency domain image according to the mask image to obtain a target image.

[0245] The image output module 70 is electrically connected to the suppression / extraction module 60, configured to reconstruct a spatial domain image from the target image through inverse transformation to obtain a final result image.

[0246] Specifically, the image preprocessing module 10 is specifically configured to:

[0247] apply a two-dimensional discrete Fourier transform to the input image I(x, y) according to the formula:

[0248] u∈[0,W-1],v∈[0,H-1],j represents the imaginary unit, W is the image width, and H is the image height.

[0249] apply centering processing to the frequency domain image F(u, v) to obtain F'(u, v), and according to the row and column parity of the frequency domain image, use the quadrant exchange method to move the frequency spectrum zero point to the center position, and calculate the center point coordinates (c x ,c y ) of the frequency domain image; wherein c x =W / 2, c y =H / 2.

[0250] According to the centering processed frequency domain image, a frequency spectrum image is calculated according to the formula:

[0251] Re represents the real part of the frequency domain image, and Im represents the imaginary part.

[0252] The denoising module 20 is specifically configured to:

[0253] Smooth the spectrum graph M(u,v) by applying a Gaussian kernel to obtain a smoothed spectrum graph M'(u,v);

[0254] Construct a mean filter defined as a m x m matrix with each element value being 1 / m2, and apply the mean filter to the spectrum graph M'(u,v) to obtain a local mean image M''(u,v), with the formula being:

[0255]

[0256] The binary graph obtaining module 30 is specifically configured to:

[0257] Calculate a difference graph to highlight the frequency components that are locally higher than the average, with the formula being:

[0258] D(u,v) = M'(u,v) - M''(u,v);

[0259] Apply a threshold value T for binaryzation, with the formula being:

[0260] The threshold value T is an integer multiple of ;

[0261] Apply a morphological opening operation to the binary graph B(u,v) to remove small noise to obtain a denoised binary graph B'(u,v), with the method being:

[0262] B'(u,v) = max(min B(u+e+g,v+f+h)), where (e,f)∈S, (g,h)∈S, and S is a predefined structure element.

[0263] The connected domain analysis module 40 is specifically configured to:

[0264] Scan the binary graph B'(u,v) using a method based on run-length coding to identify all pixel segments that are continuous 1, denoted as a run set R = {r1,r2,...,r m}, where each run r i contains a starting position (x i ,y i ) and a length l i ;

[0265] Perform connectivity analysis on the run-length coding sequence through eight-neighborhood to obtain a set of frequency regions C = {c1,c2,...,c n};

[0266] The region screening module is specifically configured to:

[0267] Perform a spectrum graph center inclusion determination function on each connected region c k to screen out a set of regions C' that do not contain a center point, with the function expression being:

[0268]

[0269] Among them, c k represents the kth connected region, c x and c y Represents the x-coordinate and y-coordinate of the center point of the spectrum, r i Indicates that it belongs to the connected area c k The i-th run, x i Represents run length r i The starting x coordinate, y i Represents run length r i The y coordinate of the location, l i Represents run length r i length.

[0270] The region screening module 50 is further configured to:

[0271] For each region c k ∈C', calculate its minimum bounding rectangle parameters (width k ,height k ,angle k ); where angle k The main axis direction, width k is the rectangle width, height k is the height of the rectangle;

[0272] Calculate the morphological ratio index WHRatio of each area k =max(height k / width k ,width k / height k );

[0273] Apply the ratio threshold WHRatioTH to perform secondary screening and obtain the screening area set C" = {c k |WHRatio k <WHRatioTH,c k ∈C'}.

[0274] Specifically, in this embodiment, the method for calculating the minimum bounding rectangle parameters is as follows:

[0275] Using principal component analysis, we calculated the area c k The covariance matrix of all pixels in Σk;

[0276] Perform eigenvalue decomposition on the covariance matrix Σk to obtain the eigenvalue λ1 k ,λ2 kand the corresponding eigenvector v1 k 、v2 k ;

[0277] According to the feature vector v1 k Determine the first principal axis direction of the rectangle and the eigenvector v2 k Determine the second principal axis direction of the rectangle; wherein the first principal axis direction is denoted as anglek1, and the second principal axis direction is denoted as anglek2, which are respectively expressed as anglek1=arctan(v1 k .y,v1 k .x), anglek2=arctan(v2 k .y,v2 k .x); ".y" represents the component of the vector in the y direction, and ".x" represents the component of the vector in the x direction;

[0278] According to area c k Calculate the rectangle width width in the projection range in the direction of the first principal axis k , and according to the area c k Calculate the height of the rectangle within the projection range in the direction of the second principal axis k .

[0279] The suppression / extraction module 60 is specifically configured to:

[0280] Create a blank binary mask image O(u,v) of the same size as the spectrogram; merge all regions in the filter region set C' into the mask image:

[0281]

[0282] Construct a dilation rectangular structure element SE, apply the dilation operation to the mask image O(u,v), and expand the region boundary to obtain O'(u,v) as follows:

[0283] O′(u, v)=max(O(ua, vb)), (a, b)∈SE;

[0284] Apply frequency domain filtering to the centered frequency domain image F'(u,v) using the following method:

[0285] If texture removal is performed, the target image F" (u, v) = F' (u, v) · O' (u, v)

[0286] If texture extraction is performed, O'(u,v) is first inverted to obtain O"(u,v), and the obtained target image F"(u,v)=F'(u,v)·O"(u,v).

[0287] The image output module 70 is specifically used for:

[0288] An inverse centering operation is applied to the filtered frequency domain map F"(u,v) to recover the image spatial position, resulting in F'"(u,v);

[0289] A two-dimensional inverse discrete Fourier transform is applied, resulting in the final result map I'(x,y), according to the formula:

[0290] x∈[0,W-1],y∈[0,H-1].

[0291] The system for periodic texture smoothing combining adaptive threshold and position morphology constraint provided in the embodiment combines frequency domain analysis and image segmentation, automatically removes texture by setting relevant parameters, and does not lose image structure, without the need to obtain prior information of the texture in advance.

[0292] Embodiment three:

[0293] The embodiment further provides a computer readable storage medium, and at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the method for periodic texture smoothing combining adaptive threshold and position morphology constraint as in the embodiment one.

[0294] Since the method for periodic texture smoothing combining adaptive threshold and position morphology constraint has been described in detail in the embodiment one, no longer description is given in the embodiment.

[0295] Embodiment four:

[0296] The application further provides a computer program product, comprising a computer program / instruction, when the computer program / instruction is executed by a processor, a method for periodic texture smoothing combining adaptive threshold and position morphology constraint as in the embodiment one is implemented.

[0297] Since the method for periodic texture smoothing combining adaptive threshold and position morphology constraint has been described in detail in the embodiment one, no longer description is given in the embodiment.

[0298] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Based on such understanding, the technical solutions of the present application, or the entire or part of the technical solutions which essentially contribute to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0299] The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features. Such modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for periodic texture smoothing combining adaptive thresholding and position morphology constraints, characterized in that: include: The input grayscale image is mapped from the spatial domain to the frequency domain to obtain a frequency domain graph and apply centralization processing, and then the spectrum graph is calculated based on the centralized frequency domain graph; After smoothing the spectrum graph, mean filtering is applied to obtain a local mean image; Calculating a difference image between the smoothed spectrum image and the local mean image, performing binarization filtering on the difference image to obtain a binary image, and performing a morphological opening operation on the binary image to obtain a denoised binary image; Performing connected domain analysis on the denoised binary image to identify a set of frequency regions representing texture features; Based on the spatial position and geometric morphological characteristics, the identified frequency regions are double-screened to remove non-texture related frequency components and obtain a set of screened regions; The screening area sets are combined to generate a mask image, and selective frequency suppression / extraction is performed on the centered frequency domain image according to the mask image to obtain a target image; The spatial domain image is reconstructed by inverse transforming the target image to obtain the final result image.

2. A method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 1, characterized in that: The step of mapping the input grayscale image from the spatial domain to the frequency domain to obtain a frequency domain graph and applying a centering process thereto, and then calculating a spectrum graph based on the centering frequency domain graph, specifically includes: Apply a two-dimensional discrete Fourier transform to the input image I(x,y), the formula is: u∈[0,W-1], v∈[0,H-1], j represents the imaginary unit, W is the image width, and H is the image height; Apply centralization to the frequency domain graph F(u,v) to obtain F'(u,v), and according to the parity of the rows and columns of the frequency domain graph, use the quadrant exchange method to move the zero frequency point of the spectrum to the center position, and calculate the coordinates of the center point of the frequency domain graph (c x ,c y ); where c x =W / 2,c y =H / 2; The spectrum is calculated based on the centralized frequency domain graph. The formula is: Re represents the real part of the frequency domain graph, and Im represents the imaginary part.

3. The method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 2, characterized in that: The method of smoothing the spectrum graph and then applying mean filtering to obtain a local mean image specifically includes: Applying Gaussian kernel to smooth the spectrum M(u,v) to obtain the smoothed spectrum M′(u,v); Construct a mean filter, defined as a matrix of size m×m, where each element value is 1 / m 2 , apply mean filtering to the spectrum map M′(u,v) to obtain the local mean image M”(u,v), the formula is:

4. The method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 3, characterized in that: The step of calculating a difference image between the smoothed spectrum image and the local mean image, performing binarization filtering on the difference image to obtain a binary image, and performing a morphological opening operation on the binary image to obtain a denoised binary image specifically includes: Calculate the difference map to highlight the frequency components that are locally higher than the average value. The formula is: D(u,v)=M′(u,v)-M"(u,v); Apply the threshold T for binarization, the formula is: Apply morphological opening operation to the binary image B(u,v) to remove small noise and obtain the denoised binary image B'(u,v). The method is: B'(u,v)=max(min B(u+e+g,v+f+h)), where (e,f)∈S, (g,h)∈S, and S is a predefined structural element.

5. The method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 4, characterized in that: The performing of connected domain analysis on the denoised binary image to identify a set of frequency regions representing texture features specifically includes: The run-length coding method is used to scan the binary image B'(u,v) and identify all the consecutive pixel segments that are 1, which are recorded as the run-length set R = {r1,r2,...,r m }, each run r i Contains the starting position (x i ,y i ) and length l i ; The run-length coded sequence is subjected to connectivity analysis through eight neighborhoods, and the set of frequency regions C = {c1, c2, ..., c n }; Based on the spatial position and geometric morphological characteristics, the identified frequency regions are double-screened to remove non-texture related frequency components to obtain a set of screened regions, specifically including: For each connected region c k Execute the spectrum center inclusion judgment function to filter out the area set C' that does not contain the center point. The function expression is: Among them, c k represents the kth connected region, c x and c y Represents the x-coordinate and y-coordinate of the center point of the spectrum, r i Indicates that it belongs to the connected area c k The i-th run, x i Represents run length r i The starting x coordinate, y i Represents run length r i The y coordinate of the location, l i Represents run length r i length.

6. The method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 5, characterized in that: The method further includes: performing double screening on the identified frequency regions based on spatial position and geometric morphological characteristics, removing non-texture related frequency components, and obtaining a set of screening regions; For each region c k ∈C', calculate its minimum bounding rectangle parameters (width k ,height k ,angle k ); where angle k The main axis direction, width k is the rectangle width, height k is the height of the rectangle; Calculate the morphological ratio index WHRatio of each area k =max(height k / width k ,width k / height k ); Apply the ratio threshold WHRatioTH to perform secondary screening, and obtain the screening area set C" = {c k |WHRatio k <WHRatioTH,c k ∈C'}.

7. The method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 6, characterized in that: The calculation method of the minimum bounding rectangle parameters is as follows: Using principal component analysis, we calculated the area c k The covariance matrix of all pixels in Σk; Perform eigenvalue decomposition on the covariance matrix Σk to obtain the eigenvalue λ1 k ,λ2 k and the corresponding eigenvector v1 k 、v2 k ; According to the feature vector v1 k Determine the first principal axis direction of the rectangle and the eigenvector v2 k Determine the second principal axis direction of the rectangle; wherein the first principal axis direction is denoted as anglek1, and the second principal axis direction is denoted as anglek2, which are respectively expressed as anglek1=arctan(v1 k .y,v1 k .x), anglek2=arctan(v2 k .y,v2 k .x); ".y" represents the component of the vector in the y direction, and ".x" represents the component of the vector in the x direction; According to area c k Calculate the rectangle width width from the projection range in the first principal axis direction k , and according to the area c k Calculate the height of the rectangle within the projection range in the direction of the second principal axis. k .

8. The method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 6, characterized in that: The step of merging the screening area sets to generate a mask image, and performing selective frequency suppression / extraction on the centered frequency domain image according to the mask image to obtain a target image specifically includes: Create a blank binary mask image O(u,v) of the same size as the spectrogram; merge all regions in the filter region set C' into the mask image: Construct a dilation rectangular structure element SE, apply the dilation operation to the mask image O(u,v), and expand the region boundary to obtain O'(u,v) as follows: 0'(u,v)=max(O(ua,vb)),(a,b)∈SE; Apply frequency domain filtering to the centered frequency domain image F'(u,v) using the following method: If texture removal is performed, the target image F" (u, v) = F' (u, v) · O' (u, v) If texture extraction is performed, O'(u,v) is first inverted to obtain O"(u,v), and the obtained target image F"(u,v)=F'(u,v)·O"(u,v).

9. The method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 8, characterized in that: The method of reconstructing a spatial domain image by inverse transforming the target image to obtain a final result image specifically includes: Apply the inverse centering operation to the filtered frequency domain image F”(u,v) to restore the image spatial position and obtain F”'(u,v); Applying the two-dimensional discrete inverse Fourier transform, we get the final result graph I'(x,y), which is: x∈[0,W-1],y∈[0,H-1]。 10. The method for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 4, characterized in that: The threshold T is An integer multiple of .

11. A system for periodic texture smoothing combining adaptive thresholding and position morphology constraints, characterized in that: include: The image preprocessing module is used to map the input grayscale image from the spatial domain to the frequency domain, obtain a frequency domain map and apply centralization processing, and then calculate the spectrum map based on the centralized frequency domain map; a denoising module, electrically connected to the image preprocessing module, for smoothing the spectrum graph and then applying mean filtering to obtain a local mean image; a binary image acquisition module, electrically connected to the denoising module, for calculating a difference image between the smoothed spectrum image and the local mean image, performing a binarization filter on the difference image to obtain a binary image, and further for performing a morphological opening operation on the binary image to obtain a denoised binary image; a connected domain analysis module, electrically connected to the binary image acquisition module, configured to perform connected domain analysis on the denoised binary image to identify a set of frequency regions representing texture features; a region screening module, electrically connected to the connected domain analysis module, for performing a double screening on the identified frequency region based on spatial position and geometric morphological characteristics, removing non-texture related frequency components, and obtaining a screening region set; a suppression / extraction module, electrically connected to the region screening module, configured to combine the screening region sets to generate a mask image, and perform selective frequency suppression / extraction on the centralized frequency domain image according to the mask image to obtain a target image; The image output module is electrically connected to the suppression / extraction module and is used to reconstruct a spatial domain image of the target image through inverse transformation to obtain a final result image.

12. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 11, characterized in that: The image preprocessing module is specifically used for: Apply a two-dimensional discrete Fourier transform to the input image I(x,y), the formula is: u∈[0,W-1], v∈[0,H-1], j represents the imaginary unit, W is the image width, and H is the image height; Apply centralization to the frequency domain graph F(u,v) to obtain F'(u,v), and according to the parity of the rows and columns of the frequency domain graph, use the quadrant exchange method to move the zero frequency point of the spectrum to the center position, and calculate the coordinates of the center point of the frequency domain graph (c x ,c y ); where c x =W / 2,c y =H / 2; The spectrum is calculated based on the centralized frequency domain graph. The formula is: Re represents the real part of the frequency domain graph, and Im represents the imaginary part.

13. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 12, characterized in that: The denoising module is specifically used for: Applying Gaussian kernel to smooth the spectrum M(u,v) to obtain the smoothed spectrum M′(u,v); Construct a mean filter, defined as a matrix of size m×m, where each element value is 1 / m2, and apply the mean filter to the spectrum map M′(u,v) to obtain the local mean image M”(u,v). The formula is:

14. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 13, characterized in that: The binary image acquisition module is specifically used for: Calculate the difference map to highlight the frequency components that are locally higher than the average value. The formula is: D(u,v)=M'(u,v)-M"(u,v); Apply the threshold T for binarization, the formula is: Apply morphological opening operation to the binary image B(u,v) to remove small noise and obtain the denoised binary image B'(u,v). The method is: B'(u,v)=max(min B(u+e+g,v+f+h)), where (e,f)∈S, (g,h)∈S, and S is a predefined structural element.

15. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 14, characterized in that: The connected domain analysis module is specifically used for: The run-length coding method is used to scan the binary image B'(u,v) and identify all the consecutive pixel segments that are 1, which are recorded as the run-length set R = {r1,r2,...,r m }, each run r i Contains the starting position (x i ,y i ) and length l i ; The run-length coded sequence is subjected to connectivity analysis through eight neighborhoods, and the set of frequency regions C = {c1, c2, ..., c n }; The area screening module is specifically used for: For each connected region c k Execute the spectrum center inclusion judgment function to filter out the area set C' that does not contain the center point. The function expression is: Among them, c k represents the kth connected region, c x and c y Represents the x-coordinate and y-coordinate of the center point of the spectrum, r i Indicates that it belongs to the connected area c k The i-th run, x i Represents run length r i The starting x coordinate, y i Represents run length r i The y coordinate of the location, l i Represents run length r i length.

16. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 15, characterized in that: The area screening module is also used for: For each region c k ∈C', calculate its minimum bounding rectangle parameters (width k ,height k ,angle k ); where angle k The main axis direction, width k is the rectangle width, height k is the height of the rectangle; Calculate the morphological ratio index WHRatio of each area k =max(height k / width k ,width k / height k ); Apply the ratio threshold WHRatioTH to perform secondary screening, and obtain the screening area set C" = {c k |WHRatio k <WHRatioTH,c k ∈C'}.

17. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 16, characterized in that: The calculation method of the minimum bounding rectangle parameters is as follows: Using principal component analysis, we calculated the area c k The covariance matrix of all pixels in Σk; Perform eigenvalue decomposition on the covariance matrix Σk to obtain the eigenvalue λ1 k ,λ2 k and the corresponding eigenvector v1 k 、v2 k ; According to the feature vector v1 k Determine the first principal axis direction of the rectangle and the eigenvector v2 k Determine the second principal axis direction of the rectangle; wherein the first principal axis direction is denoted as anglek1, and the second principal axis direction is denoted as anglek2, which are respectively expressed as anglek1=arctan(v1 k .y,v1 k .x), anglek2=arctan(v2 k .y,v2 k .x); ".y" represents the component of the vector in the y direction, and ".x" represents the component of the vector in the x direction; According to area c k Calculate the rectangle width width from the projection range in the first principal axis direction k , and according to the area c k Calculate the height of the rectangle within the projection range in the direction of the second principal axis. k .

18. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 16, characterized in that: The suppression / extraction module is specifically used for: Create a blank binary mask image O(u,v) of the same size as the spectrogram; merge all regions in the filter region set C' into the mask image: Construct a dilation rectangular structure element SE, apply the dilation operation to the mask image O(u,v), and expand the region boundary to obtain O'(u,v) as follows: O'(u,v)=max(O(ua,vb)),(a,b)∈SE; Apply frequency domain filtering to the centered frequency domain image F'(u,v) using the following method: If texture removal is performed, the target image F" (u, v) = F' (u, v) · O' (u, v) If texture extraction is performed, O'(u,v) is first inverted to obtain O"(u,v), and the obtained target image F"(u,v)=F'(u,v)·O"(u,v).

19. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 18, characterized in that: The image output module is specifically used for: Apply the inverse centering operation to the filtered frequency domain image F”(u,v) to restore the image spatial position and obtain F”'(u,v); Applying the two-dimensional discrete inverse Fourier transform, we get the final result graph I'(x,y), which is: x∈[0,W-1],y∈[0,H-1]。 20. The system for periodic texture smoothing combining adaptive threshold and position morphology constraint according to claim 14, characterized in that: The threshold T is An integer multiple of .

21. A computer-readable storage medium, wherein at least one instruction is stored in the storage medium, characterized in that: The instructions are loaded and executed by the processor to implement the method for periodic texture smoothing combined with adaptive threshold and position morphology constraint as described in any one of claims 1 to 10.

22. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, a method for periodic texture smoothing combining adaptive threshold and position morphology constraint as described in any one of claims 1 to 10 is implemented.