A method of completing a knitted label scan image

By combining frequency domain transformation and phase angle analysis with comprehensive guide vector field and text stroke information, the problems of texture phase misalignment and text breakage in the restoration of knitted label scanned images in the prior art have been solved, realizing the coherent restoration of texture and text and ensuring the quality of the restored image.

CN121544502BActive Publication Date: 2026-03-27泉州职业技术大学
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing knitted label scanning image restoration technology ignores the unique periodic weaving pattern and yarn topology of knitted fabrics. This makes it easy to produce phase misalignment when repairing broken areas of complex textures, which disrupts the original warp and weft continuity field, resulting in blurred textures or obvious splicing artifacts in the repaired area. It is impossible to truly restore the natural undulation of the knitted texture and the integrity of the text content.

Method used

By acquiring scanned images of knitted labels, segmenting them into multiple locally overlapping regions, performing frequency domain transformation, generating complex spectral distribution data, calculating the energy intensity of each frequency point, and using the coordinates of the maximum energy as the fundamental frequency reference, a set of texture protection regions is generated; abnormal frequency points are screened and inverse frequency-to-spatial domain transformation is performed to generate denoised local image data; the latitudinal and longitudinal phase angle maps are analyzed to generate completed latitudinal and longitudinal phase angle distribution maps; gradient change vectors are calculated and a comprehensive guiding vector field is synthesized; text pixels are detected; a multi-state discrete association network is constructed; color data is filled in; and the completed knitted label image is output.

Benefits of technology

It achieves smooth reconstruction of texture manifold, eliminates phase misalignment, ensures that the repaired yarn texture follows the original weaving direction, and guarantees the continuity of text strokes and edge sharpness, truly restoring the natural form of knitted texture and text content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544502B_ABST
    Figure CN121544502B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of digital image processing, in particular to a kind of knitted label scanning image completion operation method, comprising the following steps: acquisition knitted label image and conversion to frequency domain, based on energy distribution locking texture base frequency, execute protective denoising, repair texture phase flow field, extract text stroke skeleton in conjunction with gradient analysis, fill in missing pixels, output knitted label completion image, in the present application, by transforming image to frequency domain and locking texture base frequency energy, separate and protect knitted fabric periodic structure characteristics, utilize to phase field is carried out continuity solution, realize warp and weft texture manifold smooth reconstruction, eliminate the phase misplacement drawbacks caused by local pixel matching, combined with orthogonal gradient synthesis generates comprehensive guiding vector field and text stroke skeleton path, introduce strong geometric constraint in the process of pixel filling, ensure that the yarn texture after repair follows original weaving direction, and ensure text stroke coherence and edge sharpness.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of digital image processing, in particular to a knitted label scanning image completion operation method. BACKGROUND

[0002] The technical field of digital image processing covers a comprehensive technical system that uses computer software and hardware systems to collect, quantize, encode, enhance, restore and analyze image signals. The core matters of this field include converting optical images into digital matrices through sensors, using discrete mathematical transformations, frequency domain filtering, mathematical morphological operations and gray scale transformations to process pixel data, and achieving visual improvement or machine recognition preparation of image information.

[0003] Among them, the traditional knitted label scanning image completion operation method refers to the technology for repairing the image local pixel loss or texture break phenomenon caused by physical wear, wrinkles or scanner lighting problems during the scanning digitization process of knitted product labels. The existing processing method usually uses a repair algorithm based on diffusion mechanism or a texture synthesis method based on sample blocks. Specifically, a gray scale threshold is set to traverse the image pixel matrix to calibrate the damaged area mask, and then the pixel information of the surrounding intact area is extended and filled inward according to the pixel gradient direction of the damaged edge, or the image block with the most similar boundary features to the to-be-repaired area is searched in the known intact area of the image, and the matched pixel block is directly copied and filled to the missing position of the label image.

[0004] The existing traditional knitted label repair method simply relies on gray scale threshold to calibrate the damaged area, and only uses local pixel gradient extension or sample block matching logic when performing texture synthesis, ignoring the periodic knitting rules and yarn topological structure specific to knitted fabrics, which leads to phase misplacement phenomenon when repairing complex texture breaks, destroys the original warp and weft continuity field, causes texture blur or obvious splicing artifacts in the repaired area. For the area containing fine text labels, there is a lack of global constraint on the geometric trend of stroke skeleton, which leads to layout disorder or stroke break, and cannot truly restore the natural undulating form of knitted texture and the integrity of the text content. SUMMARY

[0005] In order to achieve the above purpose, the present application adopts the following technical scheme, a knitted label scanning image completion operation method, comprising the following steps:

[0006] S1: Collect the knitted label scanning image, divide it into multiple local overlapping areas, perform frequency domain conversion, generate complex frequency spectrum distribution data, calculate the energy intensity of each frequency point and take the maximum energy coordinate as the base frequency reference, and generate a texture protection area set;

[0007] S2: Filter out abnormal frequency points in the complex spectral distribution data that exceed the noise benchmark and do not belong to the texture protection region set, replace the abnormal frequency points based on the neighborhood average intensity, perform the inverse conversion from the frequency domain to the spatial domain, generate denoised local image data and stitch them together to generate a preprocessed texture image.

[0008] S3: Analyze the preprocessed texture image to obtain the latitudinal and longitudinal phase angle maps, substitute the known phases into the second-order partial differential continuity equation and solve it to generate the completed latitudinal and longitudinal phase angle distribution maps;

[0009] S4: Calculate the gradient change vector of the phase angle distribution map of the completed latitudinal and longitudinal directions at each pixel position, synthesize and generate a comprehensive guiding vector field, detect the text pixels of the preprocessed texture image, analyze the gradient change direction of the geometric distance, extract the center line path and tangent direction vector of the text strokes, and generate a stroke information dataset.

[0010] S5: For the missing pixel regions of the preprocessed texture image, construct a multi-state discrete association network, calculate the dot product similarity between the connection vectors between adjacent nodes and the corresponding position vectors and tangent direction vectors of the comprehensive guiding vector field, introduce the stroke information dataset as a constraint, solve the multi-state discrete association network, fill in the color data, and output the knitted label complete image.

[0011] As a further embodiment of the present invention, the texture protection region set includes harmonic center frequency coordinates, frequency domain circular mask radius, and protection region binary index map; the preprocessed texture image includes a denoised full-image pixel matrix, a local sub-block stitching weight map, and brightness channel data without moiré interference; the completed latitudinal and longitudinal phase angle distribution map includes latitudinal phase values ​​in the missing region, longitudinal phase values ​​in the missing region, and phase field smooth transition parameters; the stroke information dataset includes the Euclidean distance field from the text pixel to the background, the scalar width of the text stroke center line, and the foreground text region binary mask; and the knitted label completed image includes a repaired pixel color value matrix, reconstructed texture topological features, and complete foreground character shape.

[0012] As a further aspect of the present invention, the step of obtaining the texture protection region set specifically includes:

[0013] S101: Acquire scanned images of knitted labels, divide the scanned images of knitted labels into multiple locally overlapping regions according to preset window parameters, perform discrete orthogonal transformation from spatial domain to frequency domain on the locally overlapping regions, calculate the real and imaginary part values ​​of the corresponding coordinate points in the frequency domain plane, and generate complex spectrum distribution data containing amplitude and phase information.

[0014] S102: Call the complex spectrum distribution data, calculate the sum of squares of the real and imaginary parts of each frequency point, obtain the spectrum energy intensity, traverse the spectrum energy intensity, perform numerical sorting, filter the frequency point coordinates with the maximum energy intensity, mark them as the fundamental wave center of the texture structure, and use them as the fundamental frequency reference.

[0015] S103: Based on the fundamental frequency reference, perform frequency multiplication operation, calculate the coordinates of multiple integer multiple harmonic positions on the frequency domain plane, set the frequency bandwidth range with the harmonic position coordinates as the center, delineate the circular mask area, and generate a texture protection region set.

[0016] As a further aspect of the present invention, the step of obtaining the preprocessed texture image specifically includes:

[0017] S201: Call the complex spectrum distribution data, calculate the amplitude intensity value of each frequency point in the spectrum plane, compare the amplitude intensity value with the preset noise reference standard, detect the positional relationship of the spatial coordinates of the frequency point relative to the texture protection region set, filter out abnormal frequency points whose amplitude intensity exceeds the noise reference standard and whose spatial coordinates do not belong to the texture protection region set, and generate an abnormal frequency point coordinate index.

[0018] S202: Based on the coordinate index of the abnormal frequency point, locate the frequency point to be processed in the complex spectrum distribution data, obtain the amplitude intensity values ​​in the neighborhood of the frequency point to be processed and calculate the arithmetic mean, replace the original amplitude data of the frequency point to be processed with the arithmetic mean, perform amplitude attenuation and smooth replacement processing, perform inverse discrete orthogonal transformation from frequency domain to spatial domain on the corrected spectrum data, and generate denoised local image data.

[0019] S203: Call the denoised local image data, calculate the linear weighting coefficient of the pixels in the overlapping area based on the spatial coordinates of each local image in the original scanned image, perform a weighted average operation on the pixel brightness values ​​of multiple denoised local image data in the overlapping area based on the linear weighting coefficient, stitch together each local image data and reconstruct the full-frame image structure to generate a preprocessed texture image.

[0020] As a further aspect of the present invention, the process of comparing the amplitude intensity value with a preset noise benchmark standard is specifically as follows:

[0021] Extract pixel data from the four vertices of the frequency domain rectangular plane of the complex spectrum distribution data to construct a high-frequency background noise sampling sample set, and calculate the arithmetic mean and standard deviation of the amplitude intensity of all pixels in the high-frequency background noise sampling sample set.

[0022] Retrieve the preset standard deviation weighting coefficient, calculate the product of the standard deviation value and the standard deviation weighting coefficient, perform linear addition operation on the product and the arithmetic mean to generate a statistical upper limit value reflecting the current image noise level, and set the statistical upper limit value as the preset noise benchmark standard;

[0023] Establish a full coordinate traversal loop for the complex spectral distribution data, read the amplitude intensity value at each frequency point, and compare the amplitude intensity value with the preset noise benchmark.

[0024] When the amplitude intensity value is greater than the preset noise reference standard, it is determined that the current frequency point contains a valid texture signal, and a determination result that the amplitude intensity exceeds the preset noise reference standard is generated.

[0025] When the amplitude intensity value is less than or equal to the preset noise reference standard, the current frequency point is determined to be invalid background noise, and no judgment result exceeding the standard is generated.

[0026] As a further aspect of the present invention, the steps for obtaining the completed latitudinal and meridional phase angle distribution map are as follows:

[0027] S301: Call the preprocessed texture image, construct a directional filter bank containing passband characteristics in the horizontal and vertical directions, perform convolution filtering operation on the image data, extract local frequency response complex data, calculate the arctangent function value of the complex data, parse the phase angle information of the texture in the latitudinal and longitudinal directions, and generate latitudinal phase angle distribution map and longitudinal phase angle distribution map.

[0028] S302: Detect pixel missing regions in the preprocessed texture image and mark the spatial mask range, construct a smooth constraint relationship based on the second derivative inside the missing region, establish a second-order partial differential continuity equation, extract the known phase angle values ​​at the edge of the missing region and map them as boundary constraints for solving the equation, and generate phase field boundary constraint data.

[0029] S303: Call the latitudinal phase angle distribution map and the meridional phase angle distribution map, substitute the phase field boundary constraint data into the second-order partial differential continuity equation, and solve the harmonic phase distribution solution inside the missing region through iterative numerical operation to generate the completed latitudinal and meridional phase angle distribution maps.

[0030] As a further aspect of the present invention, the steps for obtaining the stroke information dataset are specifically as follows:

[0031] S401: Call the completed latitudinal and longitudinal phase angle distribution map, perform differential operation on each pixel position in the image plane, calculate the spatial derivative components of the latitudinal and longitudinal phase values ​​on the horizontal and vertical coordinate axes respectively, and perform vector synthesis on the two sets of spatial derivative components according to the texture orthogonality characteristics to construct a two-dimensional vector matrix of the local extension direction of the texture and generate a comprehensive guiding vector field.

[0032] S402: Call the preprocessed texture image, identify the foreground text pixel units and background pixel units in the intact area by determining the pixel grayscale threshold, perform Euclidean distance transformation on each text pixel unit, calculate the spatial geometric distance value from the pixel point to the nearest background pixel unit, construct a distance value matrix that maps the thickness features of the text strokes, and generate a stroke width distribution map.

[0033] S403: Call the stroke width distribution map, calculate the spatial gradient direction of each pixel position in the distance value matrix, search for local maxima along the gradient direction and connect them, construct the stroke skeleton trajectory, calculate the tangent angle values ​​of each discrete point on the stroke skeleton trajectory, extract the tangent direction vector, combine it with the comprehensive guiding vector field, and output the stroke information dataset.

[0034] As a further aspect of the present invention, the process of identifying foreground text pixel units and background pixel units within a intact area by determining pixel grayscale thresholds specifically comprises:

[0035] Extract the brightness channel data of the intact region in the preprocessed texture image, count the pixel frequency of different gray levels appearing in the intact region, construct a gray level probability distribution histogram, and calculate the gray level range of the entire region;

[0036] An adaptive threshold optimization operation based on maximum inter-class variance is performed. An iterative loop is established within the gray level range. The gray level value of the current iteration is set as a temporary segmentation point. The pixel data of the intact region is divided into background candidate group and foreground candidate group according to the temporary segmentation point.

[0037] Calculate the proportion coefficient of the background candidate group and the foreground candidate group in the total pixels, and the average gray value within the two candidate groups respectively. Calculate the squared difference between the average gray values ​​of the two candidate groups, and perform a weighted product operation on the proportion coefficient and the squared difference to generate the inter-class variance value corresponding to the current temporary segmentation point.

[0038] Compare the inter-class variance values ​​generated by all iterations, filter out the maximum value in the numerical sequence, extract the temporary segmentation point value corresponding to the maximum value, and set it as the pixel grayscale threshold.

[0039] Traverse each pixel position within the intact area and compare the grayscale value of the pixel position with the pixel grayscale threshold.

[0040] When the grayscale value is less than the pixel grayscale threshold, it is determined that the current pixel belongs to the character stroke, and a recognition mark is generated for the foreground character pixel unit;

[0041] When the grayscale value is greater than or equal to the pixel grayscale threshold, it is determined that the current pixel belongs to the fabric background color, and an identification mark is generated for the background pixel unit.

[0042] As a further aspect of the present invention, the step of obtaining the knitted label completion image specifically includes:

[0043] S501: For the preprocessed texture image, mark the missing pixel region, establish a discrete node set corresponding to the pixel coordinates and define the neighborhood connection relationship, call the tangent direction vector in the integrated guide vector field and the stroke information dataset, calculate the dot product value of the connection vector between adjacent nodes and the guide vector and the tangent vector, set the strength parameter of the interaction between nodes according to the magnitude of the dot product value, construct the numerical matrix of the correlation strength between nodes, and generate the node energy transfer weight matrix.

[0044] S502: Call the node energy transfer weight matrix, set the node candidate state space and corresponding pixel color value, introduce the stroke width and center line path data in the stroke information dataset, set state consistency constraints for nodes located on the stroke path, calculate the matching degree between the node's own state and the constraints and quantify it into a single node potential energy value, combine the paired node potential energy values ​​defined by the weight matrix, construct a network structure containing node potential energy definitions, and generate a multi-state discrete association network model.

[0045] S503: Perform message passing iterative operation on the multi-state discrete association network model, exchange state probability distribution data between node neighborhoods and update the local confidence value of the node, calculate the cumulative energy function value of the entire network state configuration and search for the minimum energy state combination, extract the optimal state value corresponding to the minimum energy configuration and convert it into pixel color data, fill the missing pixel area with the color data, and generate a knitted label completion image.

[0046] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0047] In this invention, by transforming the image to the frequency domain and locking the fundamental frequency energy of the texture, the periodic structural features of the knitted fabric are separated and protected. By continuously solving the phase field, the warp and weft texture manifold is smoothly reconstructed, eliminating the phase misalignment caused by local pixel matching. Combined with orthogonal gradient synthesis to generate a comprehensive guiding vector field and text stroke skeleton path, strong geometric constraints are introduced during the pixel filling process to ensure that the repaired yarn texture follows the original weaving direction and to guarantee the continuity of text strokes and edge sharpness. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 This is a schematic diagram of the steps of the present invention;

[0050] Figure 2 This is a detailed schematic diagram of S1 of the present invention;

[0051] Figure 3 This is a detailed schematic diagram of S2 of the present invention;

[0052] Figure 4 This is a detailed schematic diagram of S3 of the present invention;

[0053] Figure 5 This is a detailed schematic diagram of S4 of the present invention;

[0054] Figure 6 This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation

[0055] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0056] In embodiments of the present invention, words such as "example" and "for example" are used to indicate that something is used as an example, illustration, or explanation.

[0057] Any embodiment or design described as "example" in this invention should not be construed as being more preferred or advantageous than other embodiments or designs.

[0058] To be precise, the use of the word "example" is intended to present the concept in a concrete way.

[0059] Furthermore, in embodiments of the present invention, the meaning of "and / or" can be both, or either one of them.

[0060] In the embodiments of the present invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that when the distinction is not emphasized, their intended meanings are consistent.

[0061] The words “of,” “corresponding,” and “corresponding” can sometimes be used interchangeably. It should be noted that when their distinction is not emphasized, they convey the same meaning.

[0062] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0063] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0064] Please see Figure 1 This invention provides a method for completing a scanned image of a knitted label, comprising the following steps:

[0065] S1: Acquire scanned images of knitted labels, segment them into multiple locally overlapping regions, perform frequency domain transformation, generate complex spectral distribution data, calculate the energy intensity of each frequency point, and use the maximum energy coordinate as the fundamental frequency reference to generate a set of texture protection regions;

[0066] S2: Filter out abnormal frequency points in the complex spectral distribution data that exceed the noise baseline and do not belong to the texture protection region set. Replace the abnormal frequency points based on the neighborhood average intensity, perform the inverse transformation from the frequency domain to the spatial domain, generate denoised local image data and stitch them together to generate a preprocessed texture image.

[0067] S3: Analyze the preprocessed texture image, obtain the latitudinal and longitudinal phase angle maps, substitute the known phases into the second-order partial differential continuity equation and solve it to generate the completed latitudinal and longitudinal phase angle distribution maps;

[0068] S4: Calculate the gradient change vector of the phase angle distribution map of the latitudinal and longitudinal directions at each pixel position after completion, and synthesize it to generate a comprehensive guiding vector field. Detect the text pixels in the preprocessed texture image, analyze the gradient change direction of the geometric distance, and extract the center line path and tangent direction vector of the text strokes to generate a stroke information dataset.

[0069] S5: For the missing pixel regions of the preprocessed texture image, a multi-state discrete association network is constructed. The dot product similarity between the connection vectors between adjacent nodes and the corresponding position vectors and tangent direction vectors of the comprehensive guiding vector field is calculated. The stroke information dataset is introduced as a constraint to solve the multi-state discrete association network, fill in the color data, and output the knitted label complete image.

[0070] The texture protection region set includes harmonic center frequency coordinates, frequency domain circular mask radius, and protection region binary index map. The preprocessed texture image includes the denoised full-image pixel matrix, local sub-block stitching weight map, and brightness channel data without moiré interference. The completed latitudinal and longitudinal phase angle distribution map includes latitudinal phase values ​​in the missing region, longitudinal phase values ​​in the missing region, and phase field smooth transition parameters. The stroke information dataset includes the Euclidean distance field from the text pixel to the background, the width scalar of the text stroke center line, and the foreground text region binary mask. The knitted label completed image includes the repaired pixel color value matrix, reconstructed texture topology features, and complete foreground character shape.

[0071] Please see Figure 2 The specific steps for obtaining the texture protection region set are as follows:

[0072] S101: Acquire scanned images of knitted labels, divide the scanned images of knitted labels into multiple locally overlapping regions according to preset window parameters, perform discrete orthogonal transformation from spatial domain to frequency domain on the locally overlapping regions, calculate the real and imaginary part values ​​of the corresponding coordinate points in the frequency domain plane, and generate complex spectrum distribution data containing amplitude and phase information.

[0073] Start the scanner and set the scan resolution to [value]. For physical dimensions of The knitted label samples were digitally collected.

[0074] According to the resolution conversion formula The number of horizontal pixels in the image matrix is ​​calculated to be Pixels, vertical pixel count is pixels, thus generating a resolution of A matrix of pixel-based knitted label scan images.

[0075] The system sets the sliding window size according to preset window parameters. pixels, step size set to Pixels, that is, the distance between adjacent windows The overlap ratio cuts the original large-size image matrix into approximately Sub-images of locally overlapping regions.

[0076] For each number In the locally overlapping region, the Fast Fourier Transform (FFT) algorithm module is invoked to construct a two-dimensional discrete orthogonal transform operator.

[0077] For size (Right now The input matrix of ) Perform transformation operations to calculate the corresponding coordinates of the points in the frequency domain plane. Complex results .

[0078] During this process, the system extracts the real part of the complex number result. With the imaginary part The data is stored according to the frequency domain coordinate system to generate complex spectral distribution data containing amplitude and phase information.

[0079] To eliminate the DC component offset caused by spectrum centering, a quadrant diagonal swap operation is performed on the spectrum matrix after the FFT transform, shifting the zero-frequency component to the geometric center of the spectrum plane. This ensures the consistency of coordinate references for subsequent low-frequency and high-frequency analyses.

[0080] The complex spectral distribution data produced by this process provides an accurate frequency domain data foundation for subsequent texture feature extraction, with each set of data strictly corresponding to local texture details in the original spatial domain.

[0081] S102: Call the complex spectral distribution data, calculate the sum of squares of the real and imaginary parts of each frequency point, obtain the spectral energy intensity, traverse the spectral energy intensity, perform numerical sorting, filter the frequency point coordinates with the maximum energy intensity, mark them as the fundamental wave center of the texture structure, and use them as the fundamental frequency reference.

[0082] Retrieve the complex spectral distribution data stored in memory, for each local window. Spectrum matrix, establish a full pixel traversal loop.

[0083] At each frequency point coordinate At that point, read its corresponding real part value. With the imaginary part Using the formula Calculate the energy intensity value at this frequency point.

[0084] After the calculation is completed, the system generates an energy distribution map and removes the center coordinates. The DC component at that location is used to prevent its high energy from interfering with the determination of the texture fundamental frequency.

[0085] The system performs a numerical descending sorting algorithm on the energy intensity of the remaining frequency points to select the coordinates of the frequency point with the largest energy intensity value.

[0086] For example, in a certain calculation, after excluding the DC component, the coordinates were detected. The energy intensity value at that location is This value is significantly higher than the average level of the surrounding background noise (approximately). It also conforms to the fundamental frequency characteristics of the knitted fabric coil structure.

[0087] The system will use this coordinate The fundamental frequency center of the texture structure is marked and established as the fundamental frequency reference.

[0088] The physical meaning of this fundamental frequency reference corresponds to the spatial frequency of the yarn cycle arrangement in the knitted fabric, and it is the core positioning point for subsequent identification of texture protection areas.

[0089] For complex twill or jacquard weaves, the system selects the first three energy extreme points as multiple fundamental frequency references. However, in this embodiment, for standard plain knitted labels, locking only a single maximum energy peak is sufficient to meet the needs of subsequent harmonic positioning.

[0090] S103: Based on the fundamental frequency reference, perform frequency multiplication operation, calculate the coordinates of multiple integer multiple harmonic positions on the frequency domain plane, set the frequency bandwidth range and delineate the circular mask area with the harmonic position coordinates as the center, and generate a set of texture protection areas.

[0091] Based on the established fundamental frequency reference coordinates Combined with the spectrum center Calculate the fundamental frequency vector .

[0092] Based on this fundamental frequency vector, the system performs frequency doubling operations to locate higher-order harmonics. The calculation formula is as follows: ,in Integer order (e.g.) ).

[0093] The system calculates the coordinates of the first harmonic sequentially. Second harmonic coordinates and the negative first harmonic coordinates on the symmetrical side wait.

[0094] For each calculated harmonic location coordinate, the system sets a frequency bandwidth range parameter. Pixel.

[0095] Subsequently, on the frequency domain plane, circles are defined with each harmonic coordinate as the center and a radius of [missing information]. A circular mask area for pixels.

[0096] The set of coordinates covered by these circular masks constitutes the texture protection region set.

[0097] As shown in Table 1 below, the system records some of the calculated harmonic center coordinates and their corresponding protection radii.

[0098] Table 1 Harmonic Coordinates and Parameter Settings for Texture Protection Area

[0099]

[0100] Referring to Table 1, the data clearly demonstrates the energy distribution pattern of the knitted texture in the frequency domain: with increasing harmonic order... The increase (from) arrive The frequency energy intensity shows a clear order-of-magnitude decreasing trend (from...). Down to ).

[0101] This attenuation characteristic is consistent with the physical characteristics of natural textures, where energy is mainly concentrated in the low-frequency fundamental wave and its lower harmonics.

[0102] At the same time, the symmetrical fundamental wave ( It has the same energy intensity as the fundamental wave, verifying the central symmetry of the Fourier spectrum.

[0103] The frequency components within this region are identified as the core information constituting the image texture features, and a unified standard is established. The pixel protection radius effectively covers the main energy lobe of each order harmonic, ensuring that the texture skeleton information is completely preserved in the subsequent denoising steps without amplitude attenuation.

[0104] Please see Figure 3 The specific steps for obtaining the preprocessed texture image are as follows:

[0105] S201: Call the complex spectrum distribution data, calculate the amplitude intensity value of each frequency point in the spectrum plane, compare the amplitude intensity value with the preset noise benchmark, detect the positional relationship of the spatial coordinates of the frequency point relative to the texture protection region set, filter out abnormal frequency points whose amplitude intensity exceeds the noise benchmark and whose spatial coordinates do not belong to the texture protection region set, and generate an abnormal frequency point coordinate index.

[0106] To retrieve complex spectral distribution data, first extract the four vertex regions (e.g., coordinate range) of the frequency domain rectangular plane. Pixel data (including its symmetrical corners) are used to construct a structure containing A high-frequency background noise sampling sample set at each sampling point.

[0107] The arithmetic mean of the intensity values ​​of all pixels in this sample set is calculated as follows: The standard deviation is .

[0108] The system retrieves the preset standard deviation weighting coefficient. Calculate the upper limit of statistics .

[0109] This value It was established as the preset noise benchmark standard.

[0110] Subsequently, the system establishes a full-coordinate traversal loop to read the amplitude of each frequency point one by one.

[0111] For example, reading coordinates The amplitude intensity at that point is .

[0112] System comparison found The frequency point was determined to be outside the noise reference.

[0113] Next, the system detects the coordinates. To determine whether the point belongs to the texture protection area set in Table 1, the distance from the point to the nearest harmonic center was calculated. After comparison, it was found that the coordinates were not within any preserved circle.

[0114] Therefore, the system identified this point as an abnormal frequency point (usually caused by scanning dust or scratches) and assigned its coordinates. Record the coordinate index of the abnormal frequency point.

[0115] If another coordinate Amplitude Although much larger However, because it is located within the fundamental wave protection radius, the system does not mark it as an anomaly.

[0116] S202: Based on the coordinate index of the abnormal frequency point, locate the frequency point to be processed in the complex spectrum distribution data, obtain the amplitude intensity values ​​in the neighborhood of the frequency point to be processed and calculate the arithmetic mean, replace the original amplitude data of the frequency point to be processed with the arithmetic mean, perform amplitude attenuation and smooth replacement processing, perform inverse discrete orthogonal transformation from frequency domain to spatial domain on the corrected spectrum data, and generate denoised local image data.

[0117] Based on the coordinate index of the abnormal frequency points, locate the frequency points to be processed in the complex spectral distribution data. .

[0118] The system defines a Extract the neighboring window, excluding the center point. The amplitude values ​​of adjacent frequency points.

[0119] Assuming this The amplitude intensity of each neighboring point is mainly distributed in to Between, calculate their arithmetic mean as .

[0120] The system uses the calculated average value Replace the original abnormal amplitude This completes the amplitude attenuation and smooth replacement process.

[0121] This operation effectively suppresses abrupt high-frequency noise spikes while preserving local frequency continuity.

[0122] After performing the above replacement operation on all abnormal frequency points recorded in the index, the system obtains the corrected spectrum data.

[0123] Subsequently, the system calls the Inverse Fast Fourier Transform (IFFT) module to perform an inverse discrete orthogonal transform from the frequency domain to the spatial domain on the corrected complex spectral data.

[0124] During the transformation process, the system uses Euler's formula to restore the complex form to a real grayscale matrix, and then performs truncation and normalization on the values ​​(mapping to...). (Interval), generating single-block denoised local image data.

[0125] Compared to the original sub-image, this data significantly reduces random noise while fully preserving the periodic structure of the fabric texture protected by S103.

[0126] S203: Call the denoised local image data, calculate the linear weighting coefficient of the pixels in the overlapping area based on the spatial coordinates of each local image in the original scanned image, perform a weighted average operation on the pixel brightness values ​​of multiple denoised local image data in the overlapping area based on the linear weighting coefficient, stitch together each local image data and reconstruct the full-frame image structure to generate a preprocessed texture image.

[0127] Call the generated by inverse transformation A denoised local image data.

[0128] For adjacent sub-images and The overlapping area in space (width is) (pixels), the system constructs a location-based linear weighting function. ,in , The local x-coordinate within the overlapping region (from arrive ).

[0129] For each pixel within the overlapping region The system calculates the synthesized brightness value. .

[0130] For example, at the center of the overlapping area At each location, the weighting coefficients are all The system will compare the brightness values ​​at that location in both images (e.g., ...). and Averaging, we get .

[0131] This gradient weighting method effectively eliminates the block effect at image stitching points.

[0132] The system performs the weighted stitching operation on all local images sequentially according to the row and column order of the original segmentation, reconstructing an image of size [size missing]. Full-frame image structure of pixels.

[0133] The final generated image is the preprocessed texture image, which has a clear fabric texture and effectively suppresses surface noise, laying a high-quality data foundation for subsequent phase analysis.

[0134] Please see Figure 4 The specific steps for obtaining the completed latitudinal and meridional phase angle distribution map are as follows:

[0135] S301: Call the preprocessed texture image, construct a directional filter bank containing passband characteristics in the horizontal and vertical directions, perform convolution filtering operation on the image data, extract local frequency response complex data, calculate the arctangent function value of the complex data, parse the phase angle information of the texture in the latitudinal and longitudinal directions, and generate latitudinal phase angle distribution map and longitudinal phase angle distribution map.

[0136] The preprocessed texture image is called to construct two sets of Gabor directional filters.

[0137] The center frequency of the horizontal filter is set to... The direction angle is degrees; the vertical direction filter direction angle is Spend.

[0138] The system performs convolution filtering operations on the image data to extract the complex local frequency response data of the texture in two orthogonal directions. and .

[0139] For pixels Assume the complex horizontal response of the convolution output is .

[0140] The system calculates the complex arctangent function value at that point. This value represents the phase angle information of the texture in the latitudinal direction at that location.

[0141] By performing this analysis process on all pixels of the entire image, the system generates latitudinal phase angle distribution maps and meridional phase angle distribution maps.

[0142] These two distribution diagrams visually reflect the periodic fluctuation state of the knitting loops, with phase values ​​at... arrive The texture changes continuously in a sawtooth wave pattern, and any break or missing texture will appear as a sudden change or hole in the phase value in the phase map.

[0143] S302: Detect pixel missing regions in preprocessed texture images and mark the spatial mask range. Construct a smooth constraint relationship based on the second derivative inside the missing region, establish a second-order partial differential continuity equation, extract the known phase angle values ​​at the edge of the missing region and map them as boundary constraints for solving the equation, and generate phase field boundary constraint data.

[0144] The pre-defined binarized mask identifies pixel-deficient regions (such as wear holes on a label) in the pre-processed texture image, and marks the spatial mask range of these regions. .

[0145] The system extracts the edges of the missing region. The known phase angle value at that location.

[0146] For example, the left edge pixels of the missing region The latitudinal phase value is Right edge pixels The phase value is .

[0147] Within the missing region, the system is constructed based on the Laplace operator. The second-order derivative smoothing constraint relation is the second-order partial differential continuity equation.

[0148] The physical meaning of this equation is that it requires the phase field to satisfy the property of the harmonic function in the missing region, that is, the phase value at any point should be equal to the average value of the phase of its surrounding neighborhood, thereby ensuring the smooth transition of the texture manifold.

[0149] The system extracts the known phase values ​​from the edges ( The boundary conditions (etc.) are mapped to the first type of Dirichlet boundary constraints for solving the equations, generating the phase field boundary constraint data matrix, which provides definite solution conditions for subsequent numerical solutions.

[0150] S303: Call the latitudinal and meridional phase angle distribution maps, substitute the phase field boundary constraint data into the second-order partial differential continuity equation, solve the harmonic phase distribution solution inside the missing region through iterative numerical calculation, and generate the completed latitudinal and meridional phase angle distribution maps;

[0151] The above second-order partial differential continuity equation is solved using the successive over-relaxation iterative method (SOR).

[0152] The system will set the initial guess value (e.g., set to) Assign all pixels within the missing region, and then begin iterating using phase field boundary constraints on the data.

[0153] In the In the next iteration, a point within the missing region The phase value is updated to the arithmetic mean of the phase values ​​of its four neighboring pixels, and a relaxation factor is introduced. Accelerate convergence.

[0154] The system monitors the maximum error norm of two consecutive iterations and sets a convergence threshold. .

[0155] After about After several iterations, the numerical values ​​converged, and the phase distribution within the missing region showed a smooth transition from the edge to the center, successfully reconstructing the periodic variation pattern at the fracture point.

[0156] The system backfills the obtained harmonic phase distribution solution into the latitudinal and meridional phase angle distribution maps to generate a completed phase map.

[0157] At this point, the phase data in the previously missing region is filled in with continuous sinusoidal phase angles, as shown in the coordinate system. Reconstruct the phase value Furthermore, it maintains phase continuity with the surrounding texture, eliminating phase jump phenomena.

[0158] Please see Figure 5 The specific steps for obtaining the stroke information dataset are as follows:

[0159] S401: Call the completed latitudinal and longitudinal phase angle distribution map, perform differential operation on each pixel position in the image plane, calculate the spatial derivative components of the latitudinal and longitudinal phase values ​​on the horizontal and vertical coordinate axes respectively, and perform vector synthesis on the two sets of spatial derivative components according to the texture orthogonality to construct a two-dimensional vector matrix of the local extension direction of the texture and generate a comprehensive guiding vector field.

[0160] Call up the completed phase angle distribution diagrams for the latitudinal and longitudinal directions.

[0161] For pixels in the image plane The system uses the central difference method to calculate the latitudinal phase. Phase with meridional direction Partial derivatives on the horizontal and vertical coordinate axes: and .

[0162] Suppose that the latitudinal phase gradient calculated at a certain point is... The meridional phase gradient is .

[0163] Based on the orthogonality of textures, the system performs vector synthesis on these two sets of spatial derivative components to construct a two-dimensional vector matrix representing the local extension direction of the texture.

[0164] Composite vector It indicates the main direction of the fabric texture at that location (e.g., along the yarn direction).

[0165] The system iterates through all pixels in the image to generate a comprehensive guiding vector field.

[0166] Each vector in this vector field contains not only directional information, but its magnitude also reflects the clarity and intensity of the texture.

[0167] In intact regions, the vector field exhibits a neat array feature; in repaired regions, thanks to the smooth reconstruction of the phase, the vector field also exhibits a continuous manifold structure, providing directional guidance for subsequent pixel filling.

[0168] S402: Call the preprocessed texture image, identify the foreground text pixel units and background pixel units in the intact area by determining the pixel grayscale threshold, perform Euclidean distance transformation on each text pixel unit, calculate the spatial geometric distance value from the pixel point to the nearest background pixel unit, construct a distance value matrix that maps the thickness features of the text strokes, and generate a stroke width distribution map.

[0169] Perform adaptive threshold optimization based on maximum inter-class variance (Otsu).

[0170] The system first calculates the grayscale histogram of the intact region, then iterates through the grayscale levels. .

[0171] As shown in Table 2, the system calculates different temporary split points. Inter-class variance .

[0172] The formula for calculating variance is: .

[0173] Assuming in At that time, the proportion of background pixels Average gray level Foreground pixel ratio Average gray level The inter-class variance calculated at this time is .

[0174] Table 2. Data examples for the maximum inter-class variance threshold optimization process.

[0175]

[0176] The data trends in Table 2 show the inter-class variance. With the dividing point The changes exhibit typical unimodal characteristics.

[0177] exist At this point, the inter-class variance reaches its peak. This value is significantly higher than time (difference) )and time (difference) ).

[0178] This significant peak indicates that, when the threshold is set to... At this time, the grayscale statistical distribution separation between the foreground text and the background fabric is the greatest, and the segmentation effect is the best.

[0179] The system will accordingly Establishing a pixel grayscale threshold can effectively avoid issues caused by selecting an excessively low threshold. Background misjudgment caused by ) or excessively high ( This leads to the problem of broken strokes.

[0180] Subsequently, the system uses this threshold to identify text pixels and performs Euclidean distance transformation on each identified text pixel unit to generate a stroke width distribution map.

[0181] S403: Call the stroke width distribution map, calculate the spatial gradient direction of each pixel position in the distance value matrix, search for local maxima along the gradient direction and connect them, construct the stroke skeleton trajectory, calculate the tangent angle values ​​of each discrete point on the stroke skeleton trajectory, extract the tangent direction vector, combine with the comprehensive guide vector field, and output the stroke information dataset.

[0182] Call the stroke width distribution map and calculate the spatial gradient direction of each pixel in the distance value matrix.

[0183] In the stroke width graph, the gradient direction always points towards the stroke center line (i.e., the ridge line with the largest distance value).

[0184] The system searches for local maxima along the gradient direction and connects these points to construct the stroke skeleton trajectory.

[0185] For example, in the horizontal stroke area of ​​the character "T", the system extracts a series of distance values. The ridge pixel coordinates.

[0186] For each discrete point on the ridge line, the system calculates its tangent angle.

[0187] If the ridge line is determined by coordinates Extend to If the vertical line segment is such that its tangent vector is... Corresponding angle Spend.

[0188] The system extracts these tangent direction vectors and combines them with the comprehensive guide vector field generated by S401 to output a stroke information dataset.

[0189] This dataset not only contains the geometric paths of the text skeletons, but also the texture background flow information at each skeleton point, clarifying whether the text strokes are printed along the texture weaving direction or perpendicular to the texture direction, which is crucial for subsequent reconstruction of the text in the missing areas.

[0190] Please see Figure 6 The specific steps for obtaining the knitted label completion image are as follows:

[0191] S501: For the preprocessed texture image, mark the missing pixel region, establish a discrete node set with corresponding pixel coordinates and define the neighborhood connection relationship, call the tangent direction vector in the integrated guide vector field and stroke information dataset, calculate the dot product value of the connection vector between adjacent nodes with the guide vector and the tangent vector, set the strength parameter of the interaction between nodes according to the magnitude of the dot product value, construct the numerical matrix of the correlation strength between nodes, and generate the node energy transfer weight matrix.

[0192] For the missing pixel region of the marker (e.g., a region containing...) (For a circular defect of one pixel), establish a set of discrete nodes with corresponding coordinates and define the four-neighborhood connection relationship.

[0193] For adjacent nodes and The connecting vector is denoted as (Normalized unit vector).

[0194] The system calls the unit vector in the integrated guide vector field. and the unit vector of the stroke tangent (If it exists).

[0195] The system calculates the dot product similarity value. and Since all vectors are unit vectors, the absolute value of the dot product directly reflects the degree of parallelism (range) of directions. to ).

[0196] If the connecting vector With texture guide vector Parallel (i.e.) near ), indicating nodes and Arranged along the texture, they should have similar color patterns.

[0197] The system sets the energy transfer weights between nodes accordingly. ( For example, take the preset weighting coefficients. ).

[0198] The resulting node energy transfer weight matrix quantifies the strength of the mutual influence between nodes in the network, ensuring that information propagates preferentially along the texture and stroke directions.

[0199] S502: Call the node energy transfer weight matrix, set the node candidate state space and corresponding pixel color value, introduce the stroke width and center line path data in the stroke information dataset, set state consistency constraints for nodes located on the stroke path, calculate the matching degree between the node's own state and the constraints and quantify it into a single node potential energy value, combine the paired node potential energy values ​​defined by the weight matrix, construct a network structure containing node potential energy definitions, and generate a multi-state discrete correlation network model.

[0200] Construct a multi-state discrete correlation network model.

[0201] Set the node candidate state space as The grayscale value (or RGB color vector).

[0202] The system introduces a stroke information dataset and sets state consistency constraints for nodes located on the predicted stroke path.

[0203] For example, if S403 infers that there is a stroke extension of a character in a missing region, then the single-node potential function of that node is... Designed to: when state Corresponding to dark colors (text color, such as grayscale values) When the color is 0, the potential energy is extremely low; when the color is light (background color), the potential energy is extremely high.

[0204] For nodes in non-stroke regions, their potential energy is mainly determined by the paired node potential energy defined by the weight matrix in S501. The control mechanism penalizes uneven changes between adjacent nodes but allows for smooth transitions along the texture direction.

[0205] By combining single-node potential energy (from stroke constraints) and paired potential energy (from texture guidance), the system constructs a total energy of the entire network. Defined network structure.

[0206] The mathematical form of this model is a Markov random field (MRF), and its energy minimum value corresponds to the image restoration result with the most natural texture and the most coherent strokes.

[0207] S503: Perform message passing iterative operation on the multi-state discrete association network model, exchange state probability distribution data between node neighborhoods and update the local confidence value of the node, calculate the cumulative energy function value of the state configuration of the entire network and search for the minimum energy state combination, extract the optimal state value corresponding to the minimum energy configuration and convert it into pixel color data, fill the missing pixel area with the color data, and generate a knitted label completion image.

[0208] The Belief Propagation algorithm is used to perform message-passing iterative computation on multi-state discrete association networks.

[0209] As shown in Table 3, the system exchanges state probability distribution data among node neighborhoods. .

[0210] Table 3 Iterative process for energy minimization in multi-state discrete association networks.

[0211]

[0212] The convergence characteristics of network optimization can be analyzed from the iterative process data in Table 3: In the initial stage (the... to In the next iteration, the cumulative energy of the entire network decreased significantly (from...). Down to The state update rate is as high as This indicates that the algorithm is rapidly adjusting the random initial states of the nodes to adapt to the texture constraints; as the iteration progresses to the [number]th ... Next, the rate of energy decrease slowed, entering a fine-tuning phase; until the... In the next iteration, the change in average confidence level was only The state update rate is lower than And the overall network energy is stable at This indicates that the system has converged to the global minimum energy configuration.

[0213] At this point, the state value with the highest confidence for each node is extracted as the optimal color for that pixel.

[0214] For example, in areas where character strokes are missing, pixels are filled with dark gray (grayscale). In the background fabric area, pixels are filled with a light gray (grayscale) with periodic variations in brightness. It perfectly reproduces the knitted texture, achieving precise restoration of both fabric texture and text content simultaneously.

[0215] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

[0216] Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A method for completing scanned images of knitted labels, characterized in that, Includes the following steps: S1: Acquire scanned images of knitted labels, segment them into multiple locally overlapping regions, perform frequency domain transformation, generate complex spectral distribution data, calculate the energy intensity of each frequency point, and use the maximum energy coordinate as the fundamental frequency reference to generate a set of texture protection regions; S2: Filter out abnormal frequency points in the complex spectral distribution data that exceed the noise benchmark and do not belong to the texture protection region set, replace the abnormal frequency points based on the neighborhood average intensity, perform the inverse conversion from the frequency domain to the spatial domain, generate denoised local image data and stitch them together to generate a preprocessed texture image. S3: Analyze the preprocessed texture image to obtain the latitudinal and longitudinal phase angle maps, substitute the known phases into the second-order partial differential continuity equation and solve it to generate the completed latitudinal and longitudinal phase angle distribution maps; S4: Calculate the gradient change vector of the phase angle distribution map of the completed latitudinal and longitudinal directions at each pixel position, synthesize and generate a comprehensive guiding vector field, detect the text pixels of the preprocessed texture image, analyze the gradient change direction of the geometric distance, extract the center line path and tangent direction vector of the text strokes, and generate a stroke information dataset. S5: For the missing pixel regions of the preprocessed texture image, construct a multi-state discrete association network, calculate the dot product similarity between the connection vectors between adjacent nodes and the corresponding position vectors and tangent direction vectors of the comprehensive guiding vector field, introduce the stroke information dataset as a constraint, solve the multi-state discrete association network, fill in the color data, and output the knitted label complete image. The specific steps for obtaining the knitted label completion image are as follows: S501: For the preprocessed texture image, mark the missing pixel region, establish a discrete node set corresponding to the pixel coordinates and define the neighborhood connection relationship, call the tangent direction vector in the integrated guide vector field and the stroke information dataset, calculate the dot product value of the connection vector between adjacent nodes and the guide vector and the tangent vector, set the strength parameter of the interaction between nodes according to the magnitude of the dot product value, construct the numerical matrix of the correlation strength between nodes, and generate the node energy transfer weight matrix. S502: Call the node energy transfer weight matrix, set the node candidate state space and corresponding pixel color value, introduce the stroke width and center line path data in the stroke information dataset, set state consistency constraints for nodes located on the stroke path, calculate the matching degree between the node's own state and the constraints and quantify it into a single node potential energy value, combine the paired node potential energy values ​​defined by the weight matrix, construct a network structure containing node potential energy definitions, and generate a multi-state discrete association network model. S503: Perform message passing iterative operation on the multi-state discrete association network model, exchange state probability distribution data between node neighborhoods and update the local confidence value of the node, calculate the cumulative energy function value of the entire network state configuration and search for the minimum energy state combination, extract the optimal state value corresponding to the minimum energy configuration and convert it into pixel color data, fill the missing pixel area with the color data, and generate a knitted label completion image.

2. The method for completing scanned images of knitted labels according to claim 1, characterized in that, The texture protection region set includes harmonic center frequency coordinates, frequency domain circular mask radius, and protection region binary index map. The preprocessed texture image includes a denoised full-image pixel matrix, a local sub-block stitching weight map, and brightness channel data without moiré interference. The completed latitudinal and longitudinal phase angle distribution map includes latitudinal phase values ​​in the missing region, longitudinal phase values ​​in the missing region, and phase field smooth transition parameters. The stroke information dataset includes the Euclidean distance field from the text pixel to the background, the width scalar of the text stroke center line, and the foreground text region binary mask. The knitted label completed image includes a repaired pixel color value matrix, reconstructed texture topology features, and complete foreground character shape.

3. The method for completing scanned images of knitted labels according to claim 1, characterized in that, The specific steps for obtaining the texture protection region set are as follows: S101: Acquire scanned images of knitted labels, divide the scanned images of knitted labels into multiple locally overlapping regions according to preset window parameters, perform discrete orthogonal transformation from spatial domain to frequency domain on the locally overlapping regions, calculate the real and imaginary part values ​​of the corresponding coordinate points in the frequency domain plane, and generate complex spectrum distribution data containing amplitude and phase information. S102: Call the complex spectrum distribution data, calculate the sum of squares of the real and imaginary parts of each frequency point, obtain the spectrum energy intensity, traverse the spectrum energy intensity, perform numerical sorting, filter the frequency point coordinates with the maximum energy intensity, mark them as the fundamental wave center of the texture structure, and use them as the fundamental frequency reference. S103: Based on the fundamental frequency reference, perform frequency multiplication operation, calculate the coordinates of multiple integer multiple harmonic positions on the frequency domain plane, set the frequency bandwidth range with the harmonic position coordinates as the center, delineate the circular mask area, and generate a texture protection region set.

4. The method for completing scanned images of knitted labels according to claim 3, characterized in that, The specific steps for obtaining the preprocessed texture image are as follows: S201: Call the complex spectrum distribution data, calculate the amplitude intensity value of each frequency point in the spectrum plane, compare the amplitude intensity value with the preset noise reference standard, detect the positional relationship of the spatial coordinates of the frequency point relative to the texture protection region set, filter out abnormal frequency points whose amplitude intensity exceeds the noise reference standard and whose spatial coordinates do not belong to the texture protection region set, and generate an abnormal frequency point coordinate index. S202: Based on the coordinate index of the abnormal frequency point, locate the frequency point to be processed in the complex spectrum distribution data, obtain the amplitude intensity values ​​in the neighborhood of the frequency point to be processed and calculate the arithmetic mean, replace the original amplitude data of the frequency point to be processed with the arithmetic mean, perform amplitude attenuation and smooth replacement processing, perform inverse discrete orthogonal transformation from frequency domain to spatial domain on the corrected spectrum data, and generate denoised local image data. S203: Call the denoised local image data, calculate the linear weighting coefficient of the pixels in the overlapping area based on the spatial coordinates of each local image in the original scanned image, perform a weighted average operation on the pixel brightness values ​​of multiple denoised local image data in the overlapping area based on the linear weighting coefficient, stitch together each local image data and reconstruct the full-frame image structure to generate a preprocessed texture image.

5. The method for completing scanned images of knitted labels according to claim 4, characterized in that, The process of comparing the amplitude intensity value with the preset noise benchmark standard is as follows: Extract pixel data from the four vertices of the frequency domain rectangular plane of the complex spectrum distribution data to construct a high-frequency background noise sampling sample set, and calculate the arithmetic mean and standard deviation of the amplitude intensity of all pixels in the high-frequency background noise sampling sample set. Retrieve the preset standard deviation weighting coefficient, calculate the product of the standard deviation value and the standard deviation weighting coefficient, perform linear addition operation on the product and the arithmetic mean to generate a statistical upper limit value reflecting the current image noise level, and set the statistical upper limit value as the preset noise benchmark standard; Establish a full coordinate traversal loop for the complex spectral distribution data, read the amplitude intensity value at each frequency point, and compare the amplitude intensity value with the preset noise benchmark. When the amplitude intensity value is greater than the preset noise reference standard, it is determined that the current frequency point contains a valid texture signal, and a determination result that the amplitude intensity exceeds the preset noise reference standard is generated. When the amplitude intensity value is less than or equal to the preset noise reference standard, the current frequency point is determined to be invalid background noise, and no judgment result exceeding the standard is generated.

6. The method for completing scanned images of knitted labels according to claim 4, characterized in that, The specific steps for obtaining the completed latitudinal and meridional phase angle distribution map are as follows: S301: Call the preprocessed texture image, construct a directional filter bank containing passband characteristics in the horizontal and vertical directions, perform convolution filtering operation on the image data, extract local frequency response complex data, calculate the arctangent function value of the complex data, parse the phase angle information of the texture in the latitudinal and longitudinal directions, and generate latitudinal phase angle distribution map and longitudinal phase angle distribution map. S302: Detect pixel missing regions in the preprocessed texture image and mark the spatial mask range, construct a smooth constraint relationship based on the second derivative inside the missing region, establish a second-order partial differential continuity equation, extract the known phase angle values ​​at the edge of the missing region and map them as boundary constraints for solving the equation, and generate phase field boundary constraint data. S303: Call the latitudinal phase angle distribution map and the meridional phase angle distribution map, substitute the phase field boundary constraint data into the second-order partial differential continuity equation, and solve the harmonic phase distribution solution inside the missing region through iterative numerical operation to generate the completed latitudinal and meridional phase angle distribution maps.

7. The method for completing scanned images of knitted labels according to claim 6, characterized in that, The specific steps for obtaining the stroke information dataset are as follows: S401: Call the completed latitudinal and longitudinal phase angle distribution map, perform differential operation on each pixel position in the image plane, calculate the spatial derivative components of the latitudinal and longitudinal phase values ​​on the horizontal and vertical coordinate axes respectively, and perform vector synthesis on the two sets of spatial derivative components according to the texture orthogonality characteristics to construct a two-dimensional vector matrix of the local extension direction of the texture and generate a comprehensive guiding vector field. S402: Call the preprocessed texture image, identify the foreground text pixel units and background pixel units in the intact area by determining the pixel grayscale threshold, perform Euclidean distance transformation on each text pixel unit, calculate the spatial geometric distance value from the pixel point to the nearest background pixel unit, construct a distance value matrix that maps the thickness features of the text strokes, and generate a stroke width distribution map. S403: Call the stroke width distribution map, calculate the spatial gradient direction of each pixel position in the distance value matrix, search for local maxima along the gradient direction and connect them, construct the stroke skeleton trajectory, calculate the tangent angle values ​​of each discrete point on the stroke skeleton trajectory, extract the tangent direction vector, combine it with the comprehensive guiding vector field, and output the stroke information dataset.

8. The method for completing scanned images of knitted labels according to claim 7, characterized in that, The process of identifying foreground text pixel units and background pixel units within a intact area by determining pixel grayscale thresholds is specifically as follows: Extract the brightness channel data of the intact region in the preprocessed texture image, count the pixel frequency of different gray levels appearing in the intact region, construct a gray level probability distribution histogram, and calculate the gray level range of the entire region; An adaptive threshold optimization operation based on maximum inter-class variance is performed. An iterative loop is established within the gray level range. The gray level value of the current iteration is set as a temporary segmentation point. The pixel data of the intact region is divided into background candidate group and foreground candidate group according to the temporary segmentation point. Calculate the proportion coefficient of the background candidate group and the foreground candidate group in the total pixels, and the average gray value within the two candidate groups respectively. Calculate the squared difference between the average gray values ​​of the two candidate groups, and perform a weighted product operation on the proportion coefficient and the squared difference to generate the inter-class variance value corresponding to the current temporary segmentation point. Compare the inter-class variance values ​​generated by all iterations, filter out the maximum value in the numerical sequence, extract the temporary segmentation point value corresponding to the maximum value, and set it as the pixel grayscale threshold. Traverse each pixel position within the intact area and compare the grayscale value of the pixel position with the pixel grayscale threshold. When the grayscale value is less than the pixel grayscale threshold, it is determined that the current pixel belongs to the character stroke, and a recognition mark is generated for the foreground character pixel unit; When the grayscale value is greater than or equal to the pixel grayscale threshold, it is determined that the current pixel belongs to the fabric background color, and an identification mark is generated for the background pixel unit.

Citation Information

Patent Citations

  • Completing an image

    CN108230268A

  • File restoration system based on image enhancement

    CN120219244A