A text compliance detection method based on image semantic segmentation

By constructing a topological gravitational potential energy field and calculating the adhesion blocking coefficient, the problems of edge drift and topological adhesion in text compliance detection are solved, and high-precision text detection in complex backgrounds is achieved.

CN122290127APending Publication Date: 2026-06-26SHANGHAI XINGYUANHUI HEALTH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI XINGYUANHUI HEALTH TECH CO LTD
Filing Date
2026-03-12
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing text compliance detection methods are prone to edge semantic drift and false edges in complex backgrounds, leading to errors in geometric feature extraction and difficulty in handling stroke topological adhesion caused by ink diffusion, thus affecting detection accuracy.

Method used

By constructing a topological gravitational potential energy field, calculating the dynamic search bandwidth and adhesion blocking coefficient, extracting the topological gravitational potential energy maxima, extracting the orthogonal projection section along the potential surface normal, calculating the equivalent stroke width, and combining the global drift mean to determine compliance.

Benefits of technology

Accurately extracts the true physical stroke width against complex backgrounds, reducing errors, improving detection accuracy, and lowering false positive and false negative rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122290127A_ABST
    Figure CN122290127A_ABST
Patent Text Reader

Abstract

This invention relates to the field of vision and image processing technology, and discloses a text compliance detection method based on image semantic segmentation. The method acquires and grayscales a text image, obtains an initial mask through semantic segmentation, calculates the local pixel mean drift coefficient, and determines the dynamic edge search bandwidth accordingly. Within the bandwidth, it statistically analyzes the magnitude and distribution characteristics of the first-order spatial gradient, calculates the rectified edge probability score of the target pixel, constructs a topological gravitational potential energy using the probability score as the gravity source, calculates the adhesion blocking coefficient by solving the Hessian matrix determinant and combining it with the global drift variance, then extracts the potential energy maximum point as the stroke center, extracts the cross-section along the potential surface normal, performs weighted integration, and calculates the equivalent stroke width. Finally, it calculates the width dispersion and combines it with the global drift mean to calculate the compliance discrimination coefficient, outputting the detection result. This technical solution effectively overcomes semantic drift and false edge traps, and accurately decouples local ink topological adhesion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vision and image processing technology, specifically to a text compliance detection method based on image semantic segmentation. Background Technology

[0002] In the field of computer vision and automated defect detection, text recognition and quality inspection technology based on image semantic segmentation is widely used in various industrial manufacturing, metal packaging, and printing production line scenarios. In practical applications, the printed text to be inspected is often affected by objective factors such as uneven lighting in the acquisition environment and complex background textures. Currently, conventional text compliance detection methods usually rely directly on the binary mask output by the semantic segmentation model to extract text geometric features and make compliance judgments. However, this method of directly using masks has extremely hidden technical defects. Under low contrast or complex backgrounds, the text boundaries output by the model are prone to irregular jagged edges, or phenomena of outward expansion and inward contraction, which is known in the industry as edge semantic drift. Since the continuity of stroke thickness is the core indicator for judging whether text is compliant, inaccurate mask edge positioning will directly lead to serious calculation errors in the extracted geometric features, thereby causing misjudgment of compliance. To correct the aforementioned edge localization errors, existing improvement techniques typically attempt to introduce first-order gradient information from the local image to perform secondary correction of text edges. However, under the interference of high-frequency background noise, conventional gradient correction algorithms are extremely sensitive and easily misidentify noise-induced local pixel mutations as real physical edges. This results in a large number of singular points on the corrected boundary, forming noise-induced pseudo-edges that are difficult to eliminate. This severely damages the original topological coherence of text strokes, causing compliance detection to completely fail when processing high-noise images. Furthermore, when detecting inkjet-printed or ink-printed text, the phenomenon of physical topological adhesion between adjacent strokes often occurs due to excessive local ink diffusion. Existing geometric feature extraction algorithms such as orthogonal projection lack effective spatial blocking mechanisms when encountering such ink adhesion defects. When calculating the equivalent width of a stroke along the normal, the measured projection ray will directly penetrate the physically adhered area, incorrectly merging and accumulating the widths of multiple adjacent strokes. This causes a multiple-level jump in the local width index, completely destroying the objective authenticity of feature extraction and the stability of the final compliance judgment system. Therefore, how to break through the theoretical limitations of conventional semantic segmentation, effectively overcome semantic drift and pseudo-edge traps while avoiding interference from complex background noise, and accurately decouple the topological interference caused by local ink adhesion, so as to extract the high-precision text stroke equivalent width that conforms to the real physical meaning and achieve accurate compliance quantitative detection, is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0003] This invention provides a text compliance detection method based on image semantic segmentation, which helps to solve the problems mentioned in the background art above.

[0004] This invention provides the following technical solution: a text compliance detection method based on image semantic segmentation, comprising: The text image is acquired and converted to grayscale. An initial mask is obtained through semantic segmentation, and the local pixel mean drift coefficient of the pixels within the mask is calculated. The global drift mean and global drift variance of the mask region are statistically analyzed, and the dynamic search bandwidth of the edge pixels is calculated based on the drift coefficient of the local pixel mean. Calculate the first-order spatial gradient magnitude of the pixel within the dynamic search bandwidth, and statistically analyze the local average gradient magnitude and the local gradient magnitude variance. The rectified edge probability score of the target pixel is calculated by combining the first-order spatial gradient magnitude, the average gradient magnitude, and the gradient magnitude variance. Using the rectified edge probability score as the gravity source and combining it with the dynamic search bandwidth, the topological gravitational potential energy of pixels within the text region is calculated. Calculate the second-order spatial difference partial derivative of the topological gravitational potential energy and obtain the determinant of the Hessian matrix, and calculate the adhesion blocking coefficient by combining the global drift variance. Extract the maximum point of topological gravitational potential energy as the center of the stroke, extract the orthogonal projection section along the normal of the potential surface, and calculate the equivalent stroke width by weighted integration. Calculate the dispersion of the equivalent stroke width, combine it with the global drift mean to calculate the compliance discrimination coefficient, and output the text compliance detection result.

[0005] Optionally, the steps of acquiring the text image and converting it to grayscale, obtaining an initial mask through semantic segmentation, and calculating the local pixel mean shift coefficient of the pixels within the mask include: Set up the image acquisition device and acquire the color image matrix of the text to be tested; Convert the color image matrix into the original grayscale image; The original grayscale image is input into a preset semantic segmentation network to extract the initial binary mask region pixel set of the target text; For any target pixel within the mask area, a square sliding window with a preset size as its side length and centered on that pixel is created. Calculate the average gray value of all pixels within the sliding window; Calculate the absolute value of the difference between the original grayscale value and the average grayscale value of each pixel within the sliding window; The absolute values ​​within the sliding window are summed, and the sum is divided by the total number of pixels within the sliding window to obtain the local pixel mean drift coefficient corresponding to the target pixel. The side length of the sliding window is an odd number between 3 and 7.

[0006] Optionally, the global drift mean and global drift variance of the statistical mask region are used to calculate the dynamic search bandwidth of edge pixels based on the local pixel mean drift coefficient, including: The local pixel mean drift coefficients of all pixels within the mask area are summed and divided by the total number of pixels within the mask area to obtain the global drift mean. Calculate the square of the difference between the local pixel mean drift coefficient of each pixel in the mask area and the global drift mean, sum all the squared values ​​and divide by the total number of pixels in the mask area to obtain the global drift variance. Extract the outer contour pixels of the mask region to form an initial edge pixel set; For each edge pixel in the initial set of edge pixels, obtain the maximum value among the mean drift coefficients of all local pixels within the mask region; The base quotient is obtained by dividing the local pixel mean drift coefficient corresponding to the edge pixel by the sum of the maximum value and the preset minimum constant. Multiply the base quotient by the preset maximum search span constant, round the result to the nearest integer, and add one to the rounded result to obtain the edge dynamic search bandwidth corresponding to the edge pixel. The maximum search span constant is between 5 and 9.

[0007] Optionally, the step of calculating the first-order spatial gradient magnitude of a pixel within the dynamic search bandwidth and statistically analyzing the local average gradient magnitude and the local gradient magnitude variance includes: The corresponding pixel search region is determined based on the edge dynamic search bandwidth of edge pixels. For any target pixel within the pixel search area, obtain the grayscale difference between its two adjacent pixels in the horizontal direction; Obtain the grayscale difference between two adjacent pixels in the vertical direction of the target pixel; Calculate the squares of the gray-level difference in the horizontal direction and the gray-level difference in the vertical direction respectively. Add the two squared values ​​and then take the square root to obtain the first-order spatial gradient magnitude of the target pixel. The first-order spatial gradient magnitudes of all pixels within the pixel search area are summed and divided by the total number of pixels in the area to obtain the local average gradient magnitude. Calculate the square of the difference between the first-order spatial gradient magnitude and the local average gradient magnitude for each pixel within the pixel search region; The local gradient magnitude variance is obtained by summing all the squared values ​​within the region and dividing by the total number of pixels in the region.

[0008] Optionally, the step of calculating the rectified edge probability score of the target pixel by combining the first-order spatial gradient magnitude, the average gradient magnitude, and the gradient magnitude variance includes: The square of the difference between the first-order spatial gradient magnitude and the corresponding local average gradient magnitude of the target pixel is calculated and used as the molecular feature. Multiply the corresponding local gradient magnitude variance by two and add a preset minimum constant as the denominator feature; Divide the numerator feature by the denominator feature to obtain the distribution quotient; Using the natural constant as the base and the negative of the distribution quotient as the exponent, the value of the exponential function is calculated to obtain the rectified edge probability score of the target pixel.

[0009] Optionally, the step of calculating the topological gravitational potential energy of pixels within a text region by using the rectified edge probability score as the gravity source and combining it with the dynamic search bandwidth includes: For any internal pixel to be calculated within the text area, determine the valid edge pixels that are within its corresponding pixel search area and belong to the initial edge pixel set; Calculate the square of the physical spatial distance between the internal pixel to be calculated and each effective edge pixel, and use it as the squared distance value; Multiply the square of the edge dynamic search bandwidth corresponding to the effective edge pixel by two to obtain the bandwidth squared feature; Divide the negative of the squared distance value by the squared bandwidth feature to obtain the potential energy decay index; The exponential function value is calculated by taking the natural constant as the base and the potential energy decay index as the exponent. The exponential function value is then multiplied by the rectified edge probability score of the effective edge pixel to obtain the single-point gravitational potential energy. The topological gravitational potential energy of the internal pixel to be calculated is obtained by summing the single-point gravitational potential energy of all valid edge pixels corresponding to the internal pixel to be calculated.

[0010] Optionally, the calculation of the second-order spatial difference partial derivative of the topological gravitational potential energy and the determination of the Hessian matrix determinant, combined with the global drift variance, to calculate the adhesion blocking coefficient includes: Calculate the second partial derivatives of the topological gravitational potential field in the horizontal direction, the vertical direction, and the diagonal direction, respectively. Multiply the second-order partial derivative in the horizontal direction by the second-order partial derivative in the vertical direction to obtain the product in the first direction. Calculate the square of the second partial derivative in the diagonal direction to obtain the product in the second direction; Subtracting the product of the second direction from the product of the first direction yields the determinant of the Hessian matrix of the potential energy field; Extract the minimum value between the value of the determinant and zero, and use it as a topological penalty term; The dynamic scaling factor is obtained by adding the global drift variance to a preset minimum constant. Dividing the topological penalty term by the dynamic scaling factor yields the blocking index term; Using the natural constant as the base and the blocking index term as the exponent, the value of the exponential function is calculated to obtain the adhesion blocking coefficient of the corresponding pixel.

[0011] Optionally, the step of extracting the maximum point of the topological gravitational potential energy as the center of the stroke, extracting the orthogonal projection section along the normal of the potential surface, and calculating the equivalent stroke width by weighted integration includes: In the topological gravitational potential field, local maxima points that satisfy the condition that the first derivative is zero and all eigenvalues ​​of the Hessian matrix are negative are extracted and used as reference points for the center of the stroke. Along the potential surface normal of the potential energy surface corresponding to the reference point at the center of the stroke, extract the pixel line segment as the pixel set of the effective stroke section; For each cross-sectional pixel in this pixel set, calculate its physical distance to the stroke center reference point; The single-point weighted molecular feature is obtained by multiplying the rectified edge probability score, adhesion blocking coefficient, and physical distance of the pixel point in the cross section. The total weighted numerator is obtained by summing up all the single-point weighted numerator features in the pixel set. The product of the rectified edge probability score and the adhesion blocking coefficient of all cross-sectional pixels in the pixel set is accumulated, and a preset minimum constant is added to obtain the total weighted denominator. Divide the total weighted numerator by the total weighted denominator, and multiply the resulting quotient by two to obtain the equivalent stroke width of the stroke corresponding to the stroke center reference point.

[0012] Optionally, the step of calculating the dispersion of the equivalent stroke width, combining it with the global drift mean to calculate the compliance discrimination coefficient, and outputting the text compliance detection result includes: Calculate the arithmetic mean of the equivalent stroke widths corresponding to all extracted valid stroke cross-sections, and calculate the square of the difference between each equivalent stroke width and the arithmetic mean. Sum all the squared values ​​and divide by the total number of effective stroke sections. Take the square root of the division result to obtain the dispersion of the equivalent stroke width. The arithmetic mean is added to the global drift mean to obtain the compensation baseline value; Divide the dispersion of the equivalent stroke width by the compensation benchmark value to obtain the normalized deviation; Subtract the normalization bias from the numerical value to obtain the final compliance discrimination coefficient; If the compliance discrimination coefficient is greater than or equal to the given compliance threshold, the text compliance detection result is output. If the compliance discrimination coefficient is less than the given compliance threshold, the detection result of text non-compliance is output; The compliance threshold ranges from 0.80 to 0.95.

[0013] The present invention has the following beneficial effects: 1. This technical solution addresses text printing detection environments with severe ink diffusion, dense text, and complex background interference. When performing text compliance detection based on image semantic segmentation, conventional masks are easily affected by "semantic drift," producing false edges, and struggle to handle the physical topological adhesion of strokes caused by ink fading, leading to complete failure of geometric feature extraction. To address this, this solution, based on pixel spatial gradient extraction, constructs a topological gravitational potential energy field and solves the Hessian matrix to calculate the dynamic search bandwidth and adhesion blocking coefficient, thereby accurately determining the equivalent stroke width along the potential surface normal. In such high-noise and easily adhered low-quality printing environments, this technical solution can adaptively filter gradient interference terms introduced by disordered background textures and accurately block the erroneous propagation and penetration of projection measurement rays between adjacent adhered strokes, ensuring that the final extracted feature indicators can strictly restore the true physical span. This fundamentally eliminates the size multiplication and distortion errors caused by physical adhesion or false edges, effectively avoiding excessively high false positive and false negative rates in compliance judgment systems. 2. By setting a sliding window of a specific size within the initial mask area and calculating the local pixel mean drift coefficient, the degree of drastic gray-level changes in the local background of the image can be accurately captured. Using a window of a specific odd size effectively avoids the problem of excessive averaging of gray-level changes caused by an excessively large receptive field, preventing the loss of local detail representation ability. At the same time, it avoids the problem of being unable to extract neighborhood contrast features due to an excessively small window, thus providing an accurate and reliable local background smoothness benchmark for subsequent adaptive algorithms. 3. By combining global drift features and local pixel mean drift coefficients to calculate the dynamic search bandwidth of edge pixels, adaptive physical search radius allocation for backgrounds of different complexity is realized. Setting a maximum search span constant effectively limits the upper limit of bandwidth, avoiding gradient interference from adjacent strokes or complex background textures when crossing the current stroke boundary in dense text areas. At the same time, it prevents the problem of not being able to touch the real physical edge when encountering severe ink diffusion due to excessively narrow bandwidth, and greatly improves the robustness of edge positioning. 4. By calculating the first-order spatial gradient magnitude of pixels within the dynamic search bandwidth and further statistically analyzing the local average gradient magnitude and local gradient magnitude variance, the underlying physical pixel difference can be transformed into a statistical feature reflecting the local gradient field aggregation degree. This effectively eliminates the random error caused by single pixel mutations and provides data support for the subsequent identification of real text physical edges and high-frequency noise pseudo edges induced by complex backgrounds. 5. By combining the first-order spatial gradient magnitude with the statistically obtained local average gradient magnitude and gradient magnitude variance to calculate the rectified edge probability score, the scores of high-frequency noise points that deviate from the local gradient backbone can be exponentially attenuated, making the probability score of the real physical edge approach the extreme value, thereby effectively suppressing the pseudo-edge induced by complex background and achieving accurate rectification and locking of high-confidence physical text edges. 6. By using the calculated rectified edge probability score as the gravitational source and combining it with the dynamic search bandwidth in space for exponential superposition calculation, the discrete edge probability distribution can be transformed into a continuous topological gravitational potential energy field within the text region. This causes the central region of normal strokes to form a local maximum potential energy peak, while the physical adhesion caused by stroke intersections or ink diffusion forms a saddle-shaped potential energy surface. This lays the physical field foundation for the subsequent accurate positioning of the stroke center and the topological adhesion region. 7. By calculating the second-order spatial difference partial derivative of the topological gravitational potential energy and obtaining the determinant of the Hessian matrix, the saddle point feature on the potential energy surface can be accurately located using the multivariate calculus topological analysis rule. Then, combined with the global drift variance, an adhesion blocking coefficient is generated, so that the blocking coefficient in the normal region remains constant, while the blocking coefficient in the adhesion region exhibits a cliff-like decay, thus achieving efficient identification and quantitative isolation of local ink topological adhesion. 8. By extracting local maxima points that satisfy specific derivative and matrix eigenvalue conditions from the topological gravitational potential energy field as reference points for the stroke center, and extracting orthogonal projection sections along the potential surface normal, the true stroke skeleton and normal direction can be spontaneously found directly from the constructed physical field. This eliminates the dependence on external traditional morphological thinning algorithms and ensures that the extracted section direction is absolutely perpendicular to the true physical extension direction of the text stroke, thus eliminating extraction errors caused by visual deformation. By using the rectified edge probability score and adhesion blocking coefficient to perform weighted integration calculation on the orthogonal projection section to calculate the equivalent stroke width, the true physical span can be accumulated along the normal direction while the adhesion blocking coefficient, which tends to be minimal, directly cuts off the error propagation and penetration of the integral measurement ray to adjacent strokes. This fundamentally decouples the topological interference of adjacent strokes and effectively eliminates the multiple-level jumps and distortions in local width indicators caused by ink adhesion. 9. By calculating the dispersion of all extracted equivalent stroke widths and combining it with the global drift mean to calculate the final compliance discrimination coefficient, the physical span consistency characteristics of global strokes can be integrated. The global drift mean is introduced as a compensation factor, which effectively eliminates the overall width fluctuation error caused by high noise background or systematic deviation, so that the final output discrimination coefficient can objectively and truthfully reflect the standardization degree of text printing quality and structural proportion. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the basic process of the present invention. Detailed Implementation

[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] Example 1, refer to Figure 1 A text compliance detection method based on image semantic segmentation includes: The text image is acquired and converted to grayscale. An initial mask is obtained through semantic segmentation, and the local pixel mean drift coefficient of the pixels within the mask is calculated. The global drift mean and global drift variance of the mask region are statistically analyzed, and the dynamic search bandwidth of the edge pixels is calculated based on the drift coefficient of the local pixel mean. Calculate the first-order spatial gradient magnitude of the pixel within the dynamic search bandwidth, and statistically analyze the local average gradient magnitude and the local gradient magnitude variance. The rectified edge probability score of the target pixel is calculated by combining the first-order spatial gradient magnitude, the average gradient magnitude, and the gradient magnitude variance. Using the rectified edge probability score as the gravity source and combining it with the dynamic search bandwidth, the topological gravitational potential energy of pixels within the text region is calculated. Calculate the second-order spatial difference partial derivative of the topological gravitational potential energy and obtain the determinant of the Hessian matrix, and calculate the adhesion blocking coefficient by combining the global drift variance. Extract the maximum point of topological gravitational potential energy as the center of the stroke, extract the orthogonal projection section along the normal of the potential surface, and calculate the equivalent stroke width by weighted integration. Calculate the dispersion of the equivalent stroke width, combine it with the global drift mean to calculate the compliance discrimination coefficient, and output the text compliance detection result.

[0017] The steps of acquiring the text image and converting it to grayscale, obtaining an initial mask through semantic segmentation, and calculating the local pixel mean shift coefficient of the pixels within the mask include: Set up the image acquisition device and acquire the color image matrix of the text to be tested; Convert the color image matrix into the original grayscale image; The original grayscale image is input into a preset semantic segmentation network to extract the initial binary mask region pixel set of the target text; For any target pixel within the mask area, a square sliding window with a preset size as its side length and centered on that pixel is created. Calculate the average gray value of all pixels within the sliding window; Calculate the absolute value of the difference between the original grayscale value and the average grayscale value of each pixel within the sliding window; The absolute values ​​within the sliding window are summed, and the sum is divided by the total number of pixels within the sliding window to obtain the local pixel mean drift coefficient corresponding to the target pixel. The side length of the sliding window is an odd number between 3 and 7.

[0018] The global drift mean and global drift variance of the statistical mask region are used to calculate the dynamic search bandwidth of edge pixels based on the local pixel mean drift coefficient, including: The local pixel mean drift coefficients of all pixels within the mask area are summed and divided by the total number of pixels within the mask area to obtain the global drift mean. Calculate the square of the difference between the local pixel mean drift coefficient of each pixel in the mask area and the global drift mean, sum all the squared values ​​and divide by the total number of pixels in the mask area to obtain the global drift variance. Extract the outer contour pixels of the mask region to form an initial edge pixel set; For each edge pixel in the initial set of edge pixels, obtain the maximum value among the mean drift coefficients of all local pixels within the mask region; The base quotient is obtained by dividing the local pixel mean drift coefficient corresponding to the edge pixel by the sum of the maximum value and the preset minimum constant. Multiply the base quotient by the preset maximum search span constant, round the result to the nearest integer, and add one to the rounded result to obtain the edge dynamic search bandwidth corresponding to the edge pixel. The maximum search span constant is between 5 and 9.

[0019] The calculation of the first-order spatial gradient magnitude of a pixel within the dynamic search bandwidth, and the statistical analysis of the local average gradient magnitude and the local gradient magnitude variance, include: The corresponding pixel search region is determined based on the edge dynamic search bandwidth of edge pixels. For any target pixel within the pixel search area, obtain the grayscale difference between its two adjacent pixels in the horizontal direction; Obtain the grayscale difference between two adjacent pixels in the vertical direction of the target pixel; Calculate the squares of the gray-level difference in the horizontal direction and the gray-level difference in the vertical direction respectively. Add the two squared values ​​and then take the square root to obtain the first-order spatial gradient magnitude of the target pixel. The first-order spatial gradient magnitudes of all pixels within the pixel search area are summed and divided by the total number of pixels in the area to obtain the local average gradient magnitude. Calculate the square of the difference between the first-order spatial gradient magnitude and the local average gradient magnitude for each pixel within the pixel search region; The local gradient magnitude variance is obtained by summing all the squared values ​​within the region and dividing by the total number of pixels in the region.

[0020] The calculation of the rectified edge probability score of the target pixel by combining the first-order spatial gradient magnitude, the average gradient magnitude, and the gradient magnitude variance includes: The square of the difference between the first-order spatial gradient magnitude and the corresponding local average gradient magnitude of the target pixel is calculated and used as the molecular feature. Multiply the corresponding local gradient magnitude variance by two and add a preset minimum constant as the denominator feature; Divide the numerator feature by the denominator feature to obtain the distribution quotient; Using the natural constant as the base and the negative of the distribution quotient as the exponent, the value of the exponential function is calculated to obtain the rectified edge probability score of the target pixel.

[0021] The calculation of the topological gravitational potential energy of pixels within a text region, using the rectified edge probability score as the gravity source and combined with the dynamic search bandwidth, includes: For any internal pixel to be calculated within the text area, determine the valid edge pixels that are within its corresponding pixel search area and belong to the initial edge pixel set; Calculate the square of the physical spatial distance between the internal pixel to be calculated and each effective edge pixel, and use it as the squared distance value; Multiply the square of the edge dynamic search bandwidth corresponding to the effective edge pixel by two to obtain the bandwidth squared feature; Divide the negative of the squared distance value by the squared bandwidth feature to obtain the potential energy decay index; The exponential function value is calculated by taking the natural constant as the base and the potential energy decay index as the exponent. The exponential function value is then multiplied by the rectified edge probability score of the effective edge pixel to obtain the single-point gravitational potential energy. The topological gravitational potential energy of the internal pixel to be calculated is obtained by summing the single-point gravitational potential energy of all valid edge pixels corresponding to the internal pixel to be calculated.

[0022] The calculation of the second-order spatial difference partial derivative of the topological gravitational potential energy and the determination of the Hessian matrix determinant, combined with the global drift variance, to calculate the adhesion blocking coefficient includes: Calculate the second partial derivatives of the topological gravitational potential field in the horizontal direction, the vertical direction, and the diagonal direction, respectively. Multiply the second-order partial derivative in the horizontal direction by the second-order partial derivative in the vertical direction to obtain the product in the first direction. Calculate the square of the second partial derivative in the diagonal direction to obtain the product in the second direction; Subtracting the product of the second direction from the product of the first direction yields the determinant of the Hessian matrix of the potential energy field; Extract the minimum value between the value of the determinant and zero, and use it as a topological penalty term; The dynamic scaling factor is obtained by adding the global drift variance to a preset minimum constant. Dividing the topological penalty term by the dynamic scaling factor yields the blocking index term; Using the natural constant as the base and the blocking index term as the exponent, the value of the exponential function is calculated to obtain the adhesion blocking coefficient of the corresponding pixel.

[0023] The extraction of the maximum point of topological gravitational potential energy is taken as the center of the stroke. An orthogonal projection section is extracted along the normal of the potential surface, and the equivalent stroke width is calculated by weighted integration, including: In the topological gravitational potential field, local maxima points that satisfy the condition that the first derivative is zero and all eigenvalues ​​of the Hessian matrix are negative are extracted and used as reference points for the center of the stroke. Along the potential surface normal of the potential energy surface corresponding to the reference point at the center of the stroke, extract the pixel line segment as the pixel set of the effective stroke section; For each cross-sectional pixel in this pixel set, calculate its physical distance to the stroke center reference point; The single-point weighted molecular feature is obtained by multiplying the rectified edge probability score, adhesion blocking coefficient, and physical distance of the pixel point in the cross section. The total weighted numerator is obtained by summing up all the single-point weighted numerator features in the pixel set. The product of the rectified edge probability score and the adhesion blocking coefficient of all cross-sectional pixels in the pixel set is accumulated, and a preset minimum constant is added to obtain the total weighted denominator. Divide the total weighted numerator by the total weighted denominator, and multiply the resulting quotient by two to obtain the equivalent stroke width of the stroke corresponding to the stroke center reference point.

[0024] The dispersion of the equivalent stroke width is calculated, and the compliance discrimination coefficient is calculated by combining it with the global drift mean. The text compliance detection result is then output, including: Calculate the arithmetic mean of the equivalent stroke widths corresponding to all extracted valid stroke cross-sections, and calculate the square of the difference between each equivalent stroke width and the arithmetic mean. Sum all the squared values ​​and divide by the total number of effective stroke sections. Take the square root of the division result to obtain the dispersion of the equivalent stroke width. The arithmetic mean is added to the global drift mean to obtain the compensation baseline value; Divide the dispersion of the equivalent stroke width by the compensation benchmark value to obtain the normalized deviation; Subtract the normalization bias from the numerical value to obtain the final compliance discrimination coefficient; If the compliance discrimination coefficient is greater than or equal to the given compliance threshold, the text compliance detection result is output. If the compliance discrimination coefficient is less than the given compliance threshold, the detection result of text non-compliance is output; The compliance threshold ranges from 0.80 to 0.95. This technical solution addresses text printing detection environments characterized by severe ink diffusion, dense text, and complex background interference. When performing text compliance detection based on image semantic segmentation, conventional masks are highly susceptible to "semantic drift," producing false edges, and struggle to handle the physical topological adhesion of strokes caused by ink fading, leading to complete failure of geometric feature extraction. Therefore, this solution, based on pixel spatial gradient extraction, constructs a topological gravitational potential energy field and solves the Hessian matrix to calculate the dynamic search bandwidth and adhesion blocking coefficient, thereby accurately determining the equivalent stroke width along the potential surface normal. In such high-noise and easily adhered low-quality printing environments, this solution adaptively filters gradient interference introduced by disordered background textures and precisely blocks the erroneous propagation and penetration of projection measurement rays between adjacent adhered strokes, ensuring that the final extracted feature indicators strictly reproduce the true physical span. This fundamentally eliminates the size multiplication and distortion errors caused by physical adhesion or false edges, effectively avoiding excessively high false positive and false negative rates in compliance judgment systems. Example 2, a text compliance detection method based on image semantic segmentation, further includes: The steps of acquiring the text image and converting it to grayscale, obtaining an initial mask through semantic segmentation, and calculating the local pixel mean shift coefficient of the pixels within the mask include: Configure the CMOS image sensor so that its photosensitive plane is parallel to the plane of the text to be measured. Acquire the RGB image matrix of the text to be measured through the sensor and convert it to grayscale to the original grayscale image. Input a pre-defined semantic segmentation network to obtain the initial set of binary mask regions for the target text. The semantic segmentation network can be a pre-trained U-Net or Mask. Existing fully convolutional neural networks such as R-CNN; Calculate coordinates Local pixel mean shift coefficient at:

[0025] In the formula: :coordinate The original pixel grayscale value at that location; :by Centered on Average pixel value within the window; The sliding window size is an odd number between 3 and 7. Larger values ​​result in an excessively large receptive field covered by the local window, causing the calculation window to span both the text foreground and background. This over-averages abrupt changes in grayscale values, smoothing out the true intensity of local grayscale variations and leading to inaccurate calculated drift coefficients. Losing the ability to represent "local" details, it becomes a regional average feature. The smaller the value, the better: The lower limit of the window size is theoretically 3, that is, including the target pixel and its eight nearest neighbors. If the value is even smaller, such as the limit of 1, the physical meaning of "window moving average" is lost, and the system is completely unable to extract neighborhood contrast features, causing the drift coefficient to... If the value is always 0, the logic chain of the solution breaks directly. : Drift coefficient characterizing local background smoothness. By setting a sliding window of a specific size within the initial mask area and calculating the local pixel mean drift coefficient of each pixel, the degree of drastic gray-level changes in the local background of the image can be accurately captured. Using a window of a specific odd size effectively avoids the problem of excessive averaging of gray-level changes caused by an excessively large receptive field, preventing the loss of local detail representation ability. At the same time, it avoids the problem of being unable to extract neighborhood contrast features due to an excessively small window, thus providing an accurate and reliable local background smoothness benchmark for subsequent adaptive algorithms. The global drift mean and global drift variance of the statistical mask region are used to calculate the dynamic search bandwidth of edge pixels based on the local pixel mean drift coefficient, including: Based on all drift coefficients Calculate the global drift mean and global drift variance:

[0026] In the formula: The set of valid pixels within the initially acquired binary mask region; :gather The total number of pixels in; Global drift mean; Global drift variance; Extracting sets The outer contour pixels constitute the initial edge pixel set And for the initial set of edge pixels For each pixel in the image, calculate the edge dynamic search bandwidth:

[0027] In the formula: Corresponding coordinates The local pixel mean drift coefficient; :all The maximum value in; : Prevent zero constant, take a fixed value ; : Maximum search span constant, ranging from 5 to 9. The larger the value, the wider the generated dynamic search bandwidth. In areas with dense text or closely spaced strokes, an excessively large search radius will cross the current stroke boundary, encompassing the physical edges of adjacent strokes or complex textures of the background into the computational domain. This will introduce a large number of erroneous gradient interference terms, destroying the accuracy of Gaussian rectification and causing the computational cost to increase exponentially. The smaller the value, the narrower the generated dynamic search bandwidth. When the actual image is severely affected by ink diffusion or the model has serious defects, causing the physical deviation pixel distance of "semantic drift" (e.g., 6 pixels away from the real edge) to be greater than the search bandwidth, the rectification algorithm can only blindly calculate near the erroneous false edges, completely failing to touch the real physical edges, causing the entire rectification step to fail. The obtained search bandwidth radius. By combining global drift features and local pixel mean drift coefficients to calculate the dynamic search bandwidth of edge pixels, adaptive physical search radius allocation for backgrounds of different complexity is achieved. Setting a maximum search span constant effectively limits the upper limit of bandwidth, avoiding gradient interference from adjacent strokes or complex background textures when crossing the current stroke boundary in dense text areas. At the same time, it prevents the problem of not being able to touch the real physical edge when encountering severe ink diffusion due to excessively narrow bandwidth, and greatly improves the robustness of edge localization. The calculation of the first-order spatial gradient magnitude of a pixel within the dynamic search bandwidth, and the statistical analysis of the local average gradient magnitude and the local gradient magnitude variance, include: Calculate pixels First-order spatial gradient magnitude at:

[0028] In the formula: Pixel The grayscale value at the coordinates; First-order spatial gradient magnitude; In search bandwidth Within this context, calculate the local average gradient magnitude and gradient variance:

[0029] In the formula: : The calculated search bandwidth region; The total number of pixels within the bandwidth area; : Mean value of local gradient magnitude; Local gradient magnitude variance. By calculating the first-order spatial gradient magnitude of pixels within the dynamic search bandwidth and further statistically analyzing the local average gradient magnitude and local gradient magnitude variance, the underlying physical pixel differences can be transformed into statistical features reflecting the local gradient field aggregation degree. This effectively eliminates the random errors caused by single pixel mutations and provides data support for subsequent identification of real text physical edges and high-frequency noise pseudo edges induced by complex backgrounds. The calculation of the rectified edge probability score of the target pixel by combining the first-order spatial gradient magnitude, the average gradient magnitude, and the gradient magnitude variance includes: The rectified edge probability score of the target pixel is calculated as follows:

[0030] In the formula: First-order spatial gradient magnitude; : Mean value of local gradient magnitude; Local gradient magnitude variance; : Prevent zero constant, take a fixed value ; : Rectified edge probability score. By combining the first-order spatial gradient magnitude and the statistically obtained local average gradient magnitude and gradient magnitude variance to calculate the rectified edge probability score, the scores of high-frequency noise points that deviate from the local gradient backbone can be exponentially attenuated, so that the probability score of the real physical edge approaches the extreme value, thereby effectively suppressing the false edges induced by complex backgrounds and achieving accurate rectification and locking of high-confidence physical text edges; The calculation of the topological gravitational potential energy of pixels within a text region, using the rectified edge probability score as the gravity source and combined with the dynamic search bandwidth, includes: For any pixel within the text area Calculate its topological gravitational potential energy:

[0031] In the formula: The pixel coordinates to be calculated within the text region; Calculated bandwidth The range and belongs to the initial edge pixel set The coordinates; : The obtained marginal probability score; The obtained search bandwidth radius; The obtained topological gravitational potential energy value. By using the calculated rectified edge probability score as the gravitational source and combining it with the dynamic search bandwidth in space for exponential superposition calculation, the discrete edge probability distribution can be transformed into a continuous topological gravitational potential energy field inside the text region. This causes the central region of normal strokes to form a local maximum potential energy peak ridge, while the physical adhesion caused by stroke intersections or ink diffusion forms a saddle-shaped potential energy surface. This lays the physical field foundation for the subsequent accurate positioning of the stroke center and the topological adhesion region. The calculation of the second-order spatial difference partial derivative of the topological gravitational potential energy and the determination of the Hessian matrix determinant, combined with the global drift variance, to calculate the adhesion blocking coefficient includes: Calculate the second-order spatial difference partial derivative of the potential energy field and the determinant of the Hessian matrix, and combine this with the global drift variance to calculate the adhesion blocking coefficient:

[0032] In the formula: : respectively potential energy field Second-order partial derivatives in the horizontal, vertical, and diagonal directions; The determinant of the Hessian matrix of the potential energy field; The obtained global drift variance; : Prevent zero constant, take a fixed value ; : Adhesion blocking coefficient. By calculating the second-order spatial difference partial derivative of the topological gravitational potential energy and obtaining the determinant of the Hessian matrix, the saddle point features on the potential energy surface can be accurately located using the topological analysis rules of multivariate calculus. Then, combined with the global drift variance, the adhesion blocking coefficient is generated, so that the blocking coefficient in the normal region remains constant, while the blocking coefficient in the adhesion region exhibits a cliff-like decay, realizing efficient identification and quantitative isolation of local ink topological adhesion; The extraction of the maximum point of topological gravitational potential energy is taken as the center of the stroke. An orthogonal projection section is extracted along the normal of the potential surface, and the equivalent stroke width is calculated by weighted integration, including: Setting to meet Furthermore, the local maximum point of the potential field where all matrix eigenvalues ​​are negative is taken as the central reference point. Pixel line segments are extracted along the principal curvature direction of that point as orthogonal projection cross sections. Calculate the equivalent stroke width:

[0033] In the formula: : Extracted stroke center point; : The set of pixels extracted along the normal of the potential energy surface; : Calculated marginal probability score; : Calculated adhesion blocking coefficient; : No. The final equivalent width of a stroke. By extracting local maxima points that satisfy specific derivative and matrix eigenvalue conditions from the topological gravitational potential energy field as stroke center reference points, and extracting orthogonal projection sections along the potential surface normal, the true stroke skeleton and normal direction can be spontaneously found directly from the constructed physical field. This eliminates the dependence on external traditional morphological thinning algorithms and ensures that the extracted section direction is absolutely perpendicular to the true physical extension direction of the text stroke, eliminating extraction errors caused by visual deformation. By using the rectified edge probability score and adhesion blocking coefficient to perform weighted integration on the orthogonal projection section to calculate the equivalent stroke width, the true physical span can be accumulated along the normal direction. At the same time, the adhesion blocking coefficient, which tends to be minimal, can directly cut off the error propagation and penetration of the integral measurement ray to adjacent strokes, fundamentally decoupling the topological interference of adjacent strokes and effectively eliminating the multiple-level jumps and distortions in local width indicators caused by ink smearing and adhesion. The dispersion of the equivalent stroke width is calculated, and the compliance discrimination coefficient is calculated by combining it with the global drift mean. The text compliance detection result is then output, including: The final compliance discrimination coefficient is calculated based on the dispersion of the equivalent stroke width and the global drift mean. :

[0034] In the formula: : Calculated precise equivalent width of strokes; : The arithmetic mean of the equivalent width of each stroke; : Total number of valid stroke sections extracted; The calculated global drift mean; The final text compliance coefficient is determined by a value close to 1, indicating compliant text. A value below a given threshold indicates non-compliant text. This threshold can be set between 0.80 and 0.95; a higher value indicates a more stringent compliance standard. Even minute jagged edges, slight ink unevenness, or extremely small width variance can lead to non-compliant text. If the threshold cannot be reached, a high "false positive rate" will occur, classifying qualified text that does not actually affect readability as non-compliant. A smaller value indicates that the system's compliance criteria are too lenient, tolerating significant ink diffusion, deformation, or stroke defects, resulting in a high "false negative rate." This allows substandard text with obvious defects to pass detection, defeating the purpose of compliance testing. By calculating the dispersion of all extracted equivalent stroke widths and combining it with the global drift mean to calculate the final compliance discrimination coefficient, the physical span consistency characteristics of global strokes can be integrated. Introducing the global drift mean as a compensation factor effectively eliminates the overall width fluctuation error caused by high-noise backgrounds or systematic biases, ensuring that the final output discrimination coefficient objectively and truthfully reflects the standardization of text printing quality and structural proportions.

[0035] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0036] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A text compliance detection method based on image semantic segmentation, characterized in that, include: The text image is acquired and converted to grayscale. An initial mask is obtained through semantic segmentation, and the local pixel mean drift coefficient of the pixels within the mask is calculated. The global drift mean and global drift variance of the mask region are statistically analyzed, and the dynamic search bandwidth of the edge pixels is calculated based on the drift coefficient of the local pixel mean. Calculate the first-order spatial gradient magnitude of the pixel within the dynamic search bandwidth, and statistically analyze the local average gradient magnitude and the local gradient magnitude variance. The rectified edge probability score of the target pixel is calculated by combining the first-order spatial gradient magnitude, the average gradient magnitude, and the gradient magnitude variance. Using the rectified edge probability score as the gravity source and combining it with the dynamic search bandwidth, the topological gravitational potential energy of pixels within the text region is calculated. Calculate the second-order spatial difference partial derivative of the topological gravitational potential energy and obtain the determinant of the Hessian matrix, and calculate the adhesion blocking coefficient by combining the global drift variance. Extract the maximum point of topological gravitational potential energy as the center of the stroke, extract the orthogonal projection section along the normal of the potential surface, and calculate the equivalent stroke width by weighted integration. Calculate the dispersion of the equivalent stroke width, combine it with the global drift mean to calculate the compliance discrimination coefficient, and output the text compliance detection result.

2. The text compliance detection method based on image semantic segmentation according to claim 1, characterized in that, The steps of acquiring the text image and converting it to grayscale, obtaining an initial mask through semantic segmentation, and calculating the local pixel mean shift coefficient of the pixels within the mask include: Set up the image acquisition device and acquire the color image matrix of the text to be tested; Convert the color image matrix into the original grayscale image; The original grayscale image is input into a preset semantic segmentation network to extract the initial binary mask region pixel set of the target text; For any target pixel within the mask area, a square sliding window with a preset size as its side length and centered on that pixel is created. Calculate the average gray value of all pixels within the sliding window; Calculate the absolute value of the difference between the original grayscale value and the average grayscale value of each pixel within the sliding window; The absolute values ​​within the sliding window are summed, and the sum is divided by the total number of pixels within the sliding window to obtain the local pixel mean drift coefficient corresponding to the target pixel. The side length of the sliding window is an odd number between 3 and 7.

3. The text compliance detection method based on image semantic segmentation according to claim 1, characterized in that, The global drift mean and global drift variance of the statistical mask region are used to calculate the dynamic search bandwidth of edge pixels based on the local pixel mean drift coefficient, including: The local pixel mean drift coefficients of all pixels within the mask area are summed and divided by the total number of pixels within the mask area to obtain the global drift mean. Calculate the square of the difference between the local pixel mean drift coefficient of each pixel in the mask area and the global drift mean, sum all the squared values ​​and divide by the total number of pixels in the mask area to obtain the global drift variance. Extract the outer contour pixels of the mask region to form an initial edge pixel set; For each edge pixel in the initial set of edge pixels, obtain the maximum value among the mean drift coefficients of all local pixels within the mask region; The base quotient is obtained by dividing the local pixel mean drift coefficient corresponding to the edge pixel by the sum of the maximum value and the preset minimum constant. Multiply the base quotient by the preset maximum search span constant, round the result to the nearest integer, and add one to the rounded result to obtain the edge dynamic search bandwidth corresponding to the edge pixel. The maximum search span constant is between 5 and 9.

4. The text compliance detection method based on image semantic segmentation according to claim 1, characterized in that, The calculation of the first-order spatial gradient magnitude of a pixel within the dynamic search bandwidth, and the statistical analysis of the local average gradient magnitude and the local gradient magnitude variance, include: The corresponding pixel search region is determined based on the edge dynamic search bandwidth of edge pixels. For any target pixel within the pixel search area, obtain the grayscale difference between its two adjacent pixels in the horizontal direction; Obtain the grayscale difference between two adjacent pixels in the vertical direction of the target pixel; Calculate the squares of the gray-level difference in the horizontal direction and the gray-level difference in the vertical direction respectively. Add the two squared values ​​and then take the square root to obtain the first-order spatial gradient magnitude of the target pixel. The first-order spatial gradient magnitudes of all pixels within the pixel search area are summed and divided by the total number of pixels in the area to obtain the local average gradient magnitude. Calculate the square of the difference between the first-order spatial gradient magnitude and the local average gradient magnitude for each pixel within the pixel search region; The local gradient magnitude variance is obtained by summing all the squared values ​​within the region and dividing by the total number of pixels in the region.

5. The text compliance detection method based on image semantic segmentation according to claim 1, characterized in that, The calculation of the rectified edge probability score of the target pixel by combining the first-order spatial gradient magnitude, the average gradient magnitude, and the gradient magnitude variance includes: The square of the difference between the first-order spatial gradient magnitude and the corresponding local average gradient magnitude of the target pixel is calculated and used as the molecular feature. Multiply the corresponding local gradient magnitude variance by two and add a preset minimum constant as the denominator feature; Divide the numerator feature by the denominator feature to obtain the distribution quotient; Using the natural constant as the base and the negative of the distribution quotient as the exponent, the value of the exponential function is calculated to obtain the rectified edge probability score of the target pixel.

6. The text compliance detection method based on image semantic segmentation according to claim 1, characterized in that, The calculation of the topological gravitational potential energy of pixels within a text region, using the rectified edge probability score as the gravity source and combined with the dynamic search bandwidth, includes: For any internal pixel to be calculated within the text area, determine the valid edge pixels that are within its corresponding pixel search area and belong to the initial edge pixel set; Calculate the square of the physical spatial distance between the internal pixel to be calculated and each effective edge pixel, and use it as the squared distance value; Multiply the square of the edge dynamic search bandwidth corresponding to the effective edge pixel by two to obtain the bandwidth squared feature; Divide the negative of the squared distance value by the squared bandwidth feature to obtain the potential energy decay index; The exponential function value is calculated by taking the natural constant as the base and the potential energy decay index as the exponent. The exponential function value is then multiplied by the rectified edge probability score of the effective edge pixel to obtain the single-point gravitational potential energy. The topological gravitational potential energy of the internal pixel to be calculated is obtained by summing the single-point gravitational potential energy of all valid edge pixels corresponding to the internal pixel to be calculated.

7. The text compliance detection method based on image semantic segmentation according to claim 1, characterized in that, The calculation of the second-order spatial difference partial derivative of the topological gravitational potential energy and the determination of the Hessian matrix determinant, combined with the global drift variance, to calculate the adhesion blocking coefficient includes: Calculate the second partial derivatives of the topological gravitational potential field in the horizontal direction, the vertical direction, and the diagonal direction, respectively. Multiply the second-order partial derivative in the horizontal direction by the second-order partial derivative in the vertical direction to obtain the product in the first direction. Calculate the square of the second partial derivative in the diagonal direction to obtain the product in the second direction; Subtracting the product of the second direction from the product of the first direction yields the determinant of the Hessian matrix of the potential energy field; Extract the minimum value between the value of the determinant and zero, and use it as a topological penalty term; The dynamic scaling factor is obtained by adding the global drift variance to a preset minimum constant. Dividing the topological penalty term by the dynamic scaling factor yields the blocking index term; Using the natural constant as the base and the blocking index term as the exponent, the value of the exponential function is calculated to obtain the adhesion blocking coefficient of the corresponding pixel.

8. The text compliance detection method based on image semantic segmentation according to claim 1, characterized in that, The extraction of the maximum point of topological gravitational potential energy is taken as the center of the stroke. An orthogonal projection section is extracted along the normal of the potential surface, and the equivalent stroke width is calculated by weighted integration, including: In the topological gravitational potential field, local maxima points that satisfy the condition that the first derivative is zero and all eigenvalues ​​of the Hessian matrix are negative are extracted and used as reference points for the center of the stroke. Along the potential surface normal of the potential energy surface corresponding to the reference point at the center of the stroke, extract the pixel line segment as the pixel set of the effective stroke section; For each cross-sectional pixel in this pixel set, calculate its physical distance to the stroke center reference point; The single-point weighted molecular feature is obtained by multiplying the rectified edge probability score, adhesion blocking coefficient, and physical distance of the pixel point in the cross section. The total weighted numerator is obtained by summing up all the single-point weighted numerator features in the pixel set. The product of the rectified edge probability score and the adhesion blocking coefficient of all cross-sectional pixels in the pixel set is accumulated, and a preset minimum constant is added to obtain the total weighted denominator. Divide the total weighted numerator by the total weighted denominator, and multiply the resulting quotient by two to obtain the equivalent stroke width of the stroke corresponding to the stroke center reference point.

9. The text compliance detection method based on image semantic segmentation according to claim 1, characterized in that, The dispersion of the equivalent stroke width is calculated, and the compliance discrimination coefficient is calculated by combining it with the global drift mean. The text compliance detection result is then output, including: Calculate the arithmetic mean of the equivalent stroke widths corresponding to all extracted valid stroke cross-sections, and calculate the square of the difference between each equivalent stroke width and the arithmetic mean. Sum all the squared values ​​and divide by the total number of effective stroke sections. Take the square root of the division result to obtain the dispersion of the equivalent stroke width. The arithmetic mean is added to the global drift mean to obtain the compensation baseline value; Divide the dispersion of the equivalent stroke width by the compensation benchmark value to obtain the normalized deviation; Subtract the normalization bias from the numerical value to obtain the final compliance discrimination coefficient; If the compliance discrimination coefficient is greater than or equal to the given compliance threshold, the text compliance detection result is output. If the compliance discrimination coefficient is less than the given compliance threshold, the detection result of text non-compliance is output; The compliance threshold ranges from 0.80 to 0.95.