A method for intelligent detection of blood smear quality in a clinical laboratory

By constructing continuous paths and performing grayscale gradient analysis on blood smear images, the problems of inconsistent edge recognition and uneven staining in blood smear quality detection were solved, achieving multi-dimensional intelligent quality detection.

CN121033846BActive Publication Date: 2026-02-03HANGZHOU PANORAMIC MEDICAL IMAGING DIAGNOSIS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511580149.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-02-03
Estimated Expiration
2045-10-31

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify issues such as cell edge morphology transitions, uneven staining, and cell damage in blood smear quality testing, resulting in insufficient breadth of quality control dimensions and resolution of results.

Method used

By acquiring blood cell smear images, extracting the main pixel orientation, constructing path blocks in segments, identifying boundary bends, building continuous paths, and combining grayscale gradients and directional differences, a quality intelligent detection scheme is generated to achieve comprehensive identification of morphological variations, boundary offsets, and staining abnormalities.

Benefits of technology

It improves the accuracy and intelligence of blood smear quality detection, effectively identifying areas of structural disturbance and staining abnormalities in images, and achieving multi-dimensional quality assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033846B_ABST
    Figure CN121033846B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of physical analysis, in particular to a blood smear quality intelligent detection method for clinical laboratory, comprising the following steps: extracting pixel direction and building path block, marking turning connection point as contour chain, splicing boundary to generate closed area, extracting gray gradient to label structure change, matching contour to judge offset overlap, extracting channel barycenter to compare axial difference, and positioning direction abnormal area to generate detection scheme. In the present application, the structural bending points in the image are recognized and the continuous path is constructed, the spatial expression of the shape turning area is enhanced, the accuracy of the closed boundary is improved by combining the edge head-tail coordination judgment, the structure partition identification is constructed relying on the gray gradient and the direction difference, the classification labeling of the structure disturbance area is carried out, the abnormal area is integrated based on the spatial overlap and the direction consistency, the color axial difference is judged by the channel barycenter offset, the comprehensive recognition ability for the shape variation, the boundary offset and the dyeing abnormality is improved, and the multi-dimensional intelligent judgment of the image quality is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of physical analysis technology, and in particular to an intelligent detection method for the quality of blood smears used in laboratory medicine. Background Technology

[0002] The field of physical analysis technology primarily involves analyzing and measuring the composition, structure, morphology, and properties of substances using physical methods. Its core aspects include utilizing changes in physical properties such as optics, electricity, magnetism, and heat to identify and evaluate substances. In the field of medical testing, physical analysis is widely used in the detection and analysis of samples such as blood, tissue, and urine to provide accurate diagnostic evidence. With the continuous improvement of automation in medical testing, achieving standardization and intelligentization of sample analysis without relying on subjective human judgment has become one of the key areas of technological development in this field. Traditional blood smear quality inspection refers to judging the quality of a smear by observing the distribution, staining quality, and morphological characteristics of blood cells under a manual microscope. This technique mainly addresses the detection and identification of problems such as uneven cell distribution, uneven staining, or cell damage that may occur during the blood sample smear process. Traditionally, this technique is usually solved by combining initial visual inspection with manual review under a microscope. Testing personnel need to observe each area of ​​the smear based on experience and standard atlases to determine whether the staining effect and cell morphology meet the quality requirements, thus deciding whether to proceed to the next step of the analysis process.

[0003] Existing technologies rely on single-point evaluation of static observation areas in blood cell image quality assessment, which makes it difficult to construct a continuous expression of cell boundary direction. When encountering edge morphology transitions or abrupt structural changes, they cannot effectively form a path chain description, resulting in inconsistent identification of transition areas. In terms of color channel response, they lack a quantitative discrimination mechanism. When faced with inconsistent red and blue staining channel information distribution, they cannot accurately mark the location of color anomalies. Under conditions of slight staining shifts or minor changes in cell edges, the evaluation results cannot cover microscale structural differences, limiting the breadth of quality control dimensions and the resolution of results. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and propose an intelligent detection method for blood smear quality in laboratory settings.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: an intelligent detection method for the quality of blood smears used in clinical laboratories, comprising the following steps:

[0006] S1: Obtain the blood cell smear analysis area, extract the main pixel direction, construct path blocks in segments, extract boundary bends, compare the differences in the first and last angles, determine the change in direction, mark the turning connection points, and connect them into a side-direction broken contour chain.

[0007] S2: Call the edge fracture contour chain to obtain the edge contour of the covered area, identify the first and last broken segments, determine the closure, filter out the segments with inconsistent beginning and end, splice the remaining contour to form a continuous area, and output the complete sealed boundary band.

[0008] S3: Call the complete sealed boundary band, extract the corresponding grayscale pixels, calculate the gradient direction, compare the internal gradient with the boundary direction, classify and label aggregation diffusion, direction turning point and gradient breakage, and construct a regional structural change distribution map.

[0009] S4: Call the regional construction change distribution map, extract the boundary, spatially compare the contour chain path, determine the overlap of construction anomalies and turning areas, integrate areas with consistent direction, filter the dual offset of structure and boundary, and output the construction direction enhancement area layer.

[0010] S5: Call the constructed direction enhancement area layer, extract red and blue channel pixels, calculate the vertical centroid, compare the channel axial offset, filter and locate areas with different directions, and generate a quality intelligent detection scheme.

[0011] As a further aspect of the present invention, the edge fracture contour chain includes path block division, structural turning nodes, direction change sequence, and contour chain segment linking method; the complete sealed boundary zone includes continuous edge segments, end-to-end docking structure, closed area contour, and spatial coverage range; the regional structural change distribution map includes grayscale gradient distribution, angle continuity mode, direction change annotation, and structural anomaly type; the structural orientation reinforcement region layer includes structural alignment blocks, boundary overlap positions, direction consistent regions, and double offset markers; and the quality intelligent detection scheme includes red and blue channel centroid positions, vertical offset values, channel distribution differences, and offset position records.

[0012] As a further aspect of the present invention, the aggregation diffusion refers to the gray-level gradient direction within the image area being consistent with the boundary direction and exhibiting a divergent state, reflecting the structural changes of pixels tending to concentrate and diffuse.

[0013] The directional change refers to a sudden change in the gradient direction along the path in the image, resulting in a change in direction.

[0014] The gradient break refers to the interruption of the continuity of gray-level gradient within an image region, manifested as a sudden cessation and break in gray-level changes;

[0015] The dual offset of structure and boundary refers to the simultaneous offset in position and direction of the boundary contour and the internal structure orientation in the image;

[0016] The region with dissimilar directions refers to the region where the direction of the center of gravity extracted from the red and blue channels differs axially.

[0017] The overlap of structural anomalies and turning regions refers to the spatial intersection and coincidence of the structural anomaly region in the structural path and the turning point on the edge path.

[0018] As a further aspect of the present invention, the step of obtaining the edge fracture profile chain is as follows:

[0019] S101: Based on the main structural outline of the blood cell smear image region, the pixel direction extraction algorithm is called to extract the continuous pixel arrangement path of a single structure, mark the connection sequence between all continuous pixel segments, and generate a set of pixel direction path segments.

[0020] S102: Based on the start and end positions of each pair of adjacent path segments in the pixel path segment column set, call the boundary angle measurement process, calculate the tangent direction values ​​of the start and end respectively, compare the direction angles between the two, obtain the angle difference, filter the path segment connection points whose angle difference is greater than the boundary change reference value, and generate the path bending node coordinate set.

[0021] S103: Based on the spatial sequence of the coordinate set of the path bending nodes, obtain the position difference and angle difference between adjacent points, calculate the side angle fluctuation value, then connect the node segments in sequence to obtain the connection trajectory and establish the side fracture contour chain.

[0022] The path segment whose angle difference is greater than the boundary change reference value refers to the connection position of two segments in a continuous pixel path where the direction of the first and last tangents changes and reaches a preset angle threshold.

[0023] As a further aspect of the present invention, the step of obtaining the complete sealing boundary band is as follows:

[0024] S201: Call the structural change path in the edge fracture contour chain, obtain the edge pixel sequence of the path coverage area, combine them according to connectivity to generate edge contour line segments, identify the positions of the beginning and end fractures in all boundaries, and generate a set of edge fracture fragments.

[0025] S202: Based on the starting and ending coordinates of the boundary segments in the set of edge broken segments, determine whether the spatial closure condition is met, filter out all edge segments with inconsistent starting and ending coordinates, and obtain a continuous and splicable contour set.

[0026] S203: Based on the connection relationship of the continuous splicable contour concentrated boundary segments, the first and last nodes are spliced ​​in sequence to complete the spatial position docking operation, construct a closed area, and establish a complete sealed boundary zone.

[0027] The edge contour line segment refers to a sequence of boundary pixels with directionality and spatial continuity, which is formed by combining edge pixels within the path coverage area according to connectivity.

[0028] As a further aspect of the present invention, the step of obtaining the regional tectonic change distribution map is as follows:

[0029] S301: Call the closed area in the complete sealed boundary band, extract all coordinate points of the corresponding area in the grayscale layer, obtain the grayscale value corresponding to each point and store it according to the coordinate sequence to obtain the area grayscale distribution matrix.

[0030] S302: Based on the difference in gray values ​​between adjacent coordinates in the gray distribution matrix of the region, calculate the gradient change in the corresponding direction, determine whether the angle between the gradient direction and the external tangent direction of the boundary is continuously offset, obtain the set of all points with discontinuous angle changes, and obtain the gradient direction offset mark set.

[0031] S303: Based on the spatial distribution density, offset direction pattern and fracture trend characteristics of the gradient direction offset marker set, identify three structural types: aggregation diffusion, direction turning and gradient fracture, perform pixel classification and labeling on the differentiated structural regions, and establish a regional structural change distribution map.

[0032] Whether the angle between the gradient direction and the external tangent direction of the boundary shifts continuously refers to whether the angle between the gradient direction and the boundary tangent direction in the image shows a stable and continuous trend or an abrupt jump in spatial variation.

[0033] As a further aspect of the present invention, the step of obtaining the structured enhanced region layer is as follows:

[0034] S401: Call all classified and labeled regions in the regional construction change distribution map, extract the boundary coordinate values ​​and morphological feature information of the regions, construct a spatial location index for each boundary unit, and generate a construction boundary positioning set;

[0035] S402: Based on the coordinate boundaries in the construction boundary positioning set, call the change path boundaries generated in the edge fracture contour chain, calculate the coordinate intersection in the spatial overlapping area, determine whether it is in the path turning area, and filter the construction segments with overlapping relationship and consistent direction to obtain the structural direction consistent intersection set.

[0036] S403: Based on the spatial location index in the intersection set of the structural directions, extract the overlapping area of ​​the structural offset boundary and the construction anomaly boundary, integrate the direction attributes and morphological structural parameters, calculate and obtain the boundary construction matching degree value, and uniformly classify and mark the segments with matching degree higher than the overlap threshold to establish a construction orientation enhancement region layer.

[0037] The spatial location index refers to a data structure established by constructing the coordinate values ​​of the region boundary for locating and comparing spatial location relationships;

[0038] The overlapping and oriented structural segments refer to structural segments whose boundary coordinates overlap in a spatial region and whose structural directions are the same or similar.

[0039] The overlap threshold refers to the matching standard value used to determine whether the structural boundary and the construction boundary are sufficiently close and consistent.

[0040] As a further aspect of the present invention, the steps for obtaining the intelligent quality detection scheme are as follows:

[0041] S501: Call all the located regions in the constructed direction enhancement region layer, extract the red and blue channel pixel values ​​of the image within the corresponding range, and record the spatial distribution information of all pixels under the channel respectively to generate a channel pixel extraction matrix;

[0042] S502: Based on the pixel coordinates and grayscale values ​​of the red and blue channels in the region of the channel pixel extraction matrix, calculate the weighted average value in the vertical direction, identify the spatial centroid position of the red and blue channels in the vertical direction, compare whether there is a vertical offset between the centroids of the two channels, and obtain the channel centroid offset value set.

[0043] S503: Based on the offset direction of the red and blue channels in the concentrated area of ​​the channel centroid offset value, compare whether there are opposite directions, filter out areas with different offset directions, record the image coordinate position, and establish a quality intelligent detection scheme.

[0044] The spatial centroid position refers to the average coordinate position of a certain channel pixel in the image, calculated vertically based on gray-level weighting, reflecting the concentrated distribution center of the channel pixels;

[0045] The regions with opposite offset directions refer to areas in the image where the center of gravity of the red channel and the blue channel are offset in opposite directions in the vertical direction.

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

[0047] In this invention, by identifying structural bending points in an image and constructing continuous paths, the spatial representation of morphological transition areas is enhanced. By combining edge beginning and end coordination judgment, the accuracy of closed boundaries is improved. Based on gray-level gradient and directional differences, structural partition identifiers are constructed to classify and label structural disturbance areas. Abnormal areas are integrated based on spatial overlap and directional consistency. Channel centroid shift is used to judge color axis differences, thereby improving the comprehensive recognition ability of morphological variations, boundary shifts, and coloring anomalies, and realizing multi-dimensional intelligent judgment of image quality. Attached Figure Description

[0048] Figure 1 This is a flowchart of the main steps of the present invention;

[0049] Figure 2 This is a flowchart of the present invention, S1.

[0050] Figure 3 This is a flowchart of the S2 process of the present invention;

[0051] Figure 4 This is a flowchart of the S3 process of the present invention;

[0052] Figure 5 This is a flowchart of the S4 process of the present invention;

[0053] Figure 6 This is a flowchart of the S5 process of the present invention. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0055] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0056] Please see Figure 1 A smart detection method for blood smear quality in a laboratory includes the following steps:

[0057] S1: Obtain the blood cell smear analysis area, extract the pixel direction of the main structure in the image, establish path blocks in segments, extract the boundary bending state, compare the angles of the beginning and end directions, determine whether there is a change in direction, mark the turning connection points between adjacent segments as structural change points, connect the change points to form a continuous path, and generate the edge fracture contour chain.

[0058] S2: Call the marked structural change path in the edge fracture contour chain, obtain the edge contour line of the area covered by the path, identify the boundary segments with broken ends, perform closed continuity judgment on each segment, filter out edge lines with inconsistent beginning and end coordinates, perform beginning and end splicing operation on the remaining contours to form a set of spatial continuous regions, and output a complete sealed boundary zone.

[0059] S3: Call each closed region in the complete sealed boundary zone, extract the pixel distribution under the corresponding coordinates in the grayscale layer, record the grayscale value of each pixel and calculate the gradient change direction according to the coordinates, compare whether the internal gradient direction and the boundary direction constitute a continuous angular change, classify and label the regions that present the forms of aggregation diffusion, direction turning and gradient breakage, and construct a regional structural change distribution map.

[0060] S4: Call the classified construction annotation areas in the regional construction change distribution map, extract the boundary positions, compare the spatial overlap with the change paths formed in the edge fracture contour chain, determine whether the construction anomaly fits the path turning area, spatially integrate the areas with overlapping positions and consistent structural directions, filter the areas with dual offset of structure and boundary, and output the construction direction enhancement area layer.

[0061] S5: Call the region position in the construct direction enhancement region layer, extract the pixel distribution of the red and blue channels of the image within the range, calculate the spatial centroid coordinates of the channel pixels in the vertical direction, compare whether there is an axial offset between the centroid positions of the two channels, filter the regions with different offset directions and record the image position, and generate a quality intelligent detection scheme.

[0062] The edge fracture contour chain includes path block division, structural turning nodes, direction change sequence, and contour chain segment connection method; the complete sealed boundary zone includes continuous edge segments, end-to-end docking structure, closed area contour, and spatial coverage; the regional structural change distribution map includes gray-scale gradient distribution, angle continuity mode, direction change annotation, and structural anomaly type; the structural orientation reinforcement area layer includes structural alignment blocks, boundary overlap positions, direction consistent areas, and double offset markers; the quality intelligent detection scheme includes red and blue channel centroid positions, vertical offset values, channel distribution differences, and offset position records.

[0063] Blood cell influence refers to the changes in image representation caused by physical factors (such as uneven smearing and pressure deviation) and staining processes (such as dye diffusion and differences in staining time) during the blood cell smear process. These changes manifest in three dimensions: First, at the structural level, they appear as boundary contour transitions, structural shifts, and local structural anomalies, such as aggregation diffusion, abrupt directional changes, and gradient breaks. Second, at the color level, they appear as the vertical shift and differential distribution of the red and blue channel centroids, reflecting whether the staining is uniform and whether dye penetration is consistent. Third, at the image level, they appear as quantifiable signal features such as discontinuous grayscale gradients and color axis differences. In summary, blood cell influence refers to the abnormalities in the structural morphology and color signals exhibited by blood cells in an image, serving as a core basis for intelligent image quality recognition.

[0064] The influence of blood cells is the core evaluation criterion for intelligent blood smear quality detection methods, permeating the entire image processing workflow. From structural recognition to boundary closure, from structural change classification to color channel analysis, the system focuses on identifying morphological abnormalities and staining patterns of blood cells during smear preparation. This influence directly determines image quality, thus affecting the accuracy of medical test results. Through precise detection of changes in blood cell structure (such as contour transitions and structural shifts) and differences in color distribution (such as red-blue channel centroid shifts), the method achieves intelligent identification of smear quality and automatic determination of abnormal areas, forming the foundation and core of the entire detection scheme.

[0065] Please see Figure 2 The steps for obtaining the edge fracture profile chain are as follows:

[0066] S101: Based on the main structural outline of the blood cell smear image region, the pixel direction extraction algorithm is called to extract the continuous pixel arrangement path of a single structure, mark the connection sequence between all continuous pixel segments, and generate a set of pixel direction path segments.

[0067] In the image preprocessing stage, the color channels of the blood cell smear image are first extracted, with the green channel typically chosen because it provides the best contrast for cell structures in microscopic images. The extracted green channel image is converted to grayscale and smoothed using a Gaussian filter to reduce high-frequency noise. The filter kernel size can be set to 5x5, and the standard deviation to 1.0. Next, histogram equalization is used to enhance image contrast, making cell boundaries more prominent. Then, a fixed grayscale threshold, such as 180, is set, and the image is binarized, setting pixels with values ​​greater than or equal to 180 to white and the rest to black, thus extracting the preliminary outline of the main cell structure. After the preliminary outline extraction, the outline image is filtered, retaining only closed outlines with an area greater than a certain threshold, for example, setting the minimum outline area to 500 pixels, to remove small noise points and isolated edges from the image. Choose any starting pixel from the valid contour as the path starting point, for example, the pixel with coordinates (100, 75). Following the 8-neighborhood rule in the image, find adjacent pixels with continuous direction from the current point. To ensure directional continuity, calculate the direction difference between the current pixel and its candidate adjacent pixels. Select the pixel direction with the smallest angle to the current direction from all candidate points as the next jump direction. For example, if the current direction is roughly the upper right, prioritize the upper right pixel as the next pixel. If the point has already been marked as visited, skip that direction. When at least five pixels with directional continuity and pixel connection are found consecutively, construct a path segment and record the starting coordinates, ending coordinates, and direction information of the path segment. The direction information is calculated using the coordinate difference between the first and last points of the path segment. For example, from point (100, 75) to (104, 79), the horizontal difference is 4, and the vertical difference is 4, so the direction vector is (4, 4). The next step is to repeat the above process, starting from the end of the current segment as a new starting point, to find new path segments and record their connections. For example, the first segment connects to the second, the second to the third, and so on, until all boundary pixels of the contour have been traversed. Each path segment should meet conditions such as minimum pixel count, directional continuity, and a clear connection to the previous segment. In this way, a complete set of pixel-oriented path segments can be constructed. Each path segment in the set contains structured information such as start and end positions, the number of pixels within the segment, and directional relationships, thereby achieving a complete description of a single structural region in a blood cell smear image and providing a data foundation for subsequent orientation angle determination and structural fracture analysis.

[0068] S102: Based on the start and end positions of each pair of adjacent path segments in the pixel path segment column set, call the boundary angle measurement process to calculate the tangent direction values ​​of the start and end, compare the direction angles between the two, obtain the angle difference, filter the path segment connection points whose angle difference is greater than the boundary change reference value, and generate the path bend node coordinate set.

[0069] Starting from the path segment set obtained in the first step, analyze the connection relationship of each pair of adjacent path segments one by one, and deduce their direction information through the coordinates of the start and end points of the path segments. For example, the end point of the first segment is point A, and the start point of the second segment is point B. The coordinates of the two points are exactly the same, indicating that the connection between the segments is continuous. Before comparing the directions, it is necessary to calculate the direction vectors of the two path segments separately. The direction vector is obtained based on the start and end positions of the path segments. Take the start and end points of each path segment as the two endpoints of the vector, and calculate the horizontal and vertical coordinate differences, that is, the pixel offset in the horizontal direction and the pixel offset in the vertical direction. Based on the coordinate difference, the approximate direction of the path segment can be determined. For example, if the path segment moves from point (120, 85) to (124, 88), the horizontal movement is 4 and the vertical movement is 3, and the direction is slightly to the upper right. If the next segment moves from point (124, 88) to (128, 91), the horizontal and vertical movements are both 4 and 3, respectively, indicating that the direction of the two segments does not change much. The calculation of the directional angle difference involves comparing the directional vectors of two segments and determining whether the angle between the two vectors exceeds a set angular threshold. This angular threshold serves as the baseline value for boundary changes, typically set at 10 degrees. This value is derived from statistical analysis of a large number of blood cell contour direction change samples. In the natural edges of blood cells, directional changes less than 10 degrees are relatively common, while those greater than 10 degrees usually indicate structural bends or sharp angles. In practice, each pair of adjacent path segments in the path segment set is traversed, for example, path segment 1 and path segment 2. The directional angle of segment 1 is calculated, then the directional angle of segment 2 is calculated, and the difference between the two is taken. If the difference is 9 degrees, it is less than the baseline value of 10 degrees, and no significant bend is considered. Therefore, this connection point is not included in the bend node coordinate set. If the directional angle difference between a set of segments is 13 degrees, exceeding the baseline value, it indicates a significant abrupt change in direction at the connection point between the two segments. In this case, the coordinates of the connection point are recorded and considered a path bend point. The above judgment needs to be performed on all pairs of segments in the path segment set. Assuming there are a total of 25 path segments, 24 sets of direction angle difference judgments are required. Each set determines whether a point is a bend. Connection points that meet the angle change requirements are added to the path bend node coordinate set. The final node set includes coordinate information of multiple points representing structural direction turning points, providing key data for subsequent structural change trend calculations and contour chain construction. The judgment process for each connection point is strictly based on the numerical comparison of the direction angle difference with a set benchmark value to avoid misjudgment or omission. In real-world scenarios, this method can efficiently extract potential key contour change points in images.

[0070] S103: Based on the spatial sequence of the coordinate set of the path bend nodes, obtain the positional and angular differences between adjacent points using the following formula:

[0071] ;

[0072] Calculate the edge angle fluctuation value, then connect the node segments in sequence to obtain the connection trajectory and establish the edge fracture profile chain;

[0073] in, This represents the coefficient of variation of the edge fracture profile chain. For the first The difference in the direction angle of the segment, The distance between adjacent nodes. This is the direction angle of the current segment. This indicates that the processing is accumulated across all node segments. For path segment index number, This represents the total number of segments in the set of path bend points;

[0074] Based on the spatial sequence of the coordinate set of the path bend nodes, for example, the coordinate sequence is... ;

[0075] Calculate the positional and angular differences between adjacent nodes. For example, in the first segment from (54, 125) to (59, 129), calculate the Euclidean distance. The direction angle is , and the angular difference with the next segment The sub-item for calculating angular fluctuation value is:

[0076] ;

[0077] Continue calculating the next paragraph in this manner, and finally proceed as follows:

[0078] ;

[0079] Assuming the calculated values ​​for the other two segments are 0.31 and 0.27, the final lateral fracture profile chain variation coefficient is:

[0080] ;

[0081] The parameters here are explained as follows:

[0082] For the first Segment direction angle difference, in degrees; This represents the Euclidean distance between adjacent nodes, in pixels. The direction angle of the current segment; in the denominator To prevent the denominator from being zero when the angle is zero, normalization is performed; sum range to This refers to the total number of bends; the calculation process uses the absolute value to accumulate segment by segment to prevent positive and negative values ​​from canceling each other out, thus truly reflecting the intensity of the fluctuation.

[0083] Explanation of parameter dimension normalization methods;

[0084] In the formula:

[0085] ;

[0086] The units (dimensions) of the various parameters involved are as follows:

[0087] : Direction angle difference, the unit is "degree" and the dimension is "degree (°)".

[0088] : Distance between nodes, in pixels, i.e., Euclidean distance in a two-dimensional coordinate system.

[0089] : Current segment orientation angle, in degrees (°), which is the geometric orientation angle of the segment.

[0090] Constant 1 (added to the denominator): a dimensionless term used only to prevent the denominator from being zero, and does not participate in unit conversion.

[0091] The normalization method is explained below:

[0092] Angle normalization: Since both the direction angle and the angle difference are in "degrees", they have the same dimensions when they appear in the numerator and denominator, avoiding the risk of unit mismatch.

[0093] Pixel normalization: The unit is pixels, which is the dimension of length. The denominator is in degrees, so the overall dimension of the fraction is "pixels·degrees / degrees", meaning the final result is still in pixels, thus preserving distance information.

[0094] The final normalized value C: Each term in the formula is constructed by adjusting the direction angle to the segment length, so that the path fluctuation under different directional change scales has a unified evaluation standard. The final unit of C tends to be "pixel". However, since the angle part is normalized, this value is used as a relative quantity to measure the intensity of curve fluctuation, rather than the absolute length.

[0095] Definition of lateral angle fluctuation value;

[0096] Edge angle fluctuation is a comprehensive parameter used to measure the intensity of angular changes in the image boundary contour path between multiple segments. Its core purpose is to quantify the degree to which directional continuity in the image path is disrupted. It reflects that during the path connection process, if the direction of a certain segment changes significantly and the length of the segment combining this change constitutes a significant "fluctuation," then the segment has a greater impact on the continuity of the overall curve.

[0097] The calculation of this value is based on the changes in the direction angle between path segments (i.e., the bending angle) and the actual length of the connecting segments. The direction angle is normalized to avoid the amplification effect of high-angle segments, thereby providing a balanced perspective.

[0098] Explanation of the operational principle (in plain text);

[0099] The calculation process for the lateral angle fluctuation value is as follows:

[0100] Extracting path segment sequences: Connecting the marked bends in the contour path of the blood cell image in sequence to form several continuous segments, each consisting of a pair of nodes.

[0101] Calculate the direction angle for each segment: For each path segment, calculate its direction angle θ using the arctangent function based on the coordinates of its starting and ending points, in degrees.

[0102] Calculate the direction difference between adjacent segments: For each pair of adjacent segments, take their respective direction angles, calculate the difference, and take the absolute value to obtain the angle difference ∆θ, which is used to quantify the degree of direction change at the connection point.

[0103] Calculate the distance between nodes: The actual length L of each segment is calculated using Euclidean distance, in pixels.

[0104] Normalization: The angle difference ∆θ is multiplied by the distance L to form a coarse quantitative index of the fluctuation intensity; then, the denominator is normalized by adding 1 to the direction angle θ of the current segment. The purpose of adding the constant 1 is to prevent the division by zero when the direction angle θ is 0, and also to moderately amplify the low-angle segment to maintain sensitivity.

[0105] Accumulation processing: Perform the above process on all paragraphs and sum all normalized values ​​to obtain the final fluctuation coefficient C.

[0106] Judgment criteria: If the value C exceeds the preset threshold (e.g., 1.0), it indicates that the path has drastic fluctuations in angle, that is, there are multiple obvious bending features; otherwise, it is considered that the boundary trend is stable.

[0107] This calculation principle can organically combine the degree of directional variation with the actual length of the path, preventing misjudgments caused by relying solely on angles. It also takes into account the importance of path segments, making the identification of blood cell structure and morphology more scientific and reasonable.

[0108] The results indicate that the edge fluctuation level in the current path is 0.87. If the edge fracture judgment threshold is set to 1.0, the current structure does not meet the fracture profile judgment standard. The connection trajectory can be connected in sequence according to the node order to construct a complete edge fracture profile chain.

[0109] Please see Figure 3 The steps to obtain the complete sealed boundary zone are as follows:

[0110] S201: Call the structural change path in the edge fracture contour chain, obtain the edge pixel sequence of the path coverage area, combine them according to connectivity to generate edge contour line segments, identify the positions of the beginning and end fractures in all boundaries, and generate a set of edge fracture fragments.

[0111] When calling the structural change path in the edge fracture contour chain, the path sequence information of each node in the fracture contour chain is first read, and the corresponding pixel region in the image is extracted based on the coordinate interval corresponding to the path. If the starting coordinates of the path are (50, 120) and the ending coordinates are (80, 140), the extraction range is the rectangular envelope region. Within this range, the image is scanned pixel by pixel to identify pixels with gray values ​​greater than a certain boundary recognition value, and it is determined whether they are at the edge position on the contour chain. This gray value is determined by the dynamic range of the image and is set to the 90th percentile value in the image pixel gray value distribution histogram. If the statistical image gray value range is 0–255, then the 90th percentile value is 229. Therefore, all pixels with gray values ​​≥229 are considered edge pixels. After extracting all edge pixels, it is determined whether there is a connectivity relationship between adjacent pixels based on their coordinate distribution in the image. If the difference between two pixels in the x or y direction does not exceed 1 unit pixel, and the Euclidean distance does not exceed 1.41 (i.e., ... If a pixel is found to be connected, it is considered connected. After forming multiple connected regions, the pixels within each region are sorted to generate edge contour segments. Connected pixels within the same region are connected sequentially. If the distance between two adjacent edge pixels is greater than a set break distance threshold during the connection process, it is marked as a break position. The break distance threshold is set with reference to the image resolution. If the image resolution is 0.2μm / pixel, the structural break is generally more than 3 pixels, that is, the break distance threshold is set to 3 pixels. For example, if the current point is (62, 128) and its next edge point is (66, 132), the Euclidean distance between the two points is 5.65 pixels, which is more than 3 pixels, so it is considered a break point. (62, 128) - (66, 132) is recorded as a break segment. The above process is repeated to traverse all edge segments, and finally a set of edge break segments containing the start and end points of all break regions is constructed.

[0112] S202: Based on the start and end coordinates of the boundary segments in the edge break segment set, determine whether the spatial closure condition is met, filter out all edge segments with inconsistent start and end coordinates, and obtain a continuous splicable contour set.

[0113] After constructing the set of edge fragments, it is necessary to sequentially determine whether each edge segment in the set satisfies the spatial closure condition. For each edge segment, its start and end coordinates are read, and the Euclidean distance between the two points is calculated. If this distance is less than the closure threshold, it is considered spatially closed; otherwise, the edge segment is considered unclosed and needs to be removed. This closure threshold is set based on the maximum allowable deviation of naturally closed boundaries in blood cell images. After analyzing 100 blood smear images, it was found that within the same cell edge region, the initial and final deviations usually do not exceed 2.5 pixels. Therefore, this embodiment sets the closure threshold to 2.5 pixels. In actual implementation, 2.5 is used as the judgment standard. If the start point of the line segment is (55, 120) and the end point is (56, 121), then the distance is... If the distance is less than 2.5, it is considered a closed loop; if the starting point is (60, 132) and the ending point is (63, 136), the distance is... If the distance is greater than 2.5, it is considered non-closed and is removed. The above calculation process is repeated for all line segments in the entire set of broken segments to screen out all edge segments whose distance between the first and last points exceeds the threshold. The edge segments that are finally retained form a continuous set of splicable contours. For example, if there are 12 edge line segments in the initial set of broken segments, only 8 segments that meet the first and last closure conditions are retained after screening for closure conditions, forming a set of contours that can be spliced ​​and analyzed.

[0114] S203: Based on the connection relationship of the continuous splicable contour concentrated boundary segments, the first and last nodes are spliced ​​in sequence to complete the spatial position docking operation, construct a closed area, and establish a complete sealed boundary zone.

[0115] After obtaining a continuous set of stitchable contours, it is necessary to sequentially stitch them together based on the coordinates of the beginning and end of each edge segment to construct a complete closed region. During the stitching process, starting from any segment's starting point, the coordinates of the current segment's ending point are used as the connection reference point for the next segment. The starting points of all remaining segments whose distance from the ending point is within the connection threshold range are retrieved. This connection threshold is set to 1.5 pixels, based on the edge pixel positioning accuracy and the standard of continuity of actual cell structure edges. This threshold ensures that small connection deviations are tolerated within the image error range. If the ending point of one segment is (64, 128) and the starting point of another segment is (63, 128), the distance is 1 pixel, meeting the stitching condition. These segments are then stitched together to form a path segment, denoted as "Segment A → Segment B". If multiple segments meet the connection threshold condition, the segment with the smallest distance is selected for splicing, and the connection graph record is updated simultaneously. If no segment can be found that meets the connection threshold during the splicing process, the current path is interrupted and a new path splicing process is started. The splicing operation continues until all segments have been visited. Finally, for each spliced ​​path, it is determined whether the coordinates between its first and last points meet the closure requirement. The same closure judgment threshold of 2.5 pixels as that for segment 2 is used for judgment. If the distance between the first and last points of the spliced ​​path is 2.1 pixels, a closed region is constructed. If the distance is 3.2 pixels, a closed structure is not formed. If the total number of spliced ​​paths in the entire contour set is 5, and 3 of them meet the closure condition, then 3 complete sealed boundary bands can be constructed in the end.

[0116] Please see Figure 4 The steps for obtaining the regional tectonic change distribution map are as follows:

[0117] S301: Call the closed area in the complete sealed boundary zone, extract all coordinate points of the corresponding area in the grayscale layer, obtain the grayscale value corresponding to each point and store it according to the coordinate sequence to obtain the grayscale distribution matrix of the area.

[0118] When accessing a closed region within a complete sealed boundary band, it's first necessary to read the two-dimensional position range occupied by this closed region in the image coordinate system, clarifying the coordinate values ​​of the boundary vertices. For example, if the upper left corner of the closed region is (40, 100) and the lower right corner is (60, 120), then the region's width and height are 21 pixels, forming a matrix of 441 pixels. Within this range, the grayscale layer is traversed, extracting the two-dimensional coordinate position and corresponding grayscale value for each pixel. The grayscale layer is a standard 8-bit image, with pixel grayscale values ​​between 0 and 255. Reading is done row-majorly, starting from coordinates (40, 100) and moving right to (60, 100), then from (40, 101) and right to (60, 101), and so on up to (60, 120). The grayscale value is read once for each pixel and recorded as a grayscale matrix. The corresponding numerical items, for example, the grayscale of point (42, 102) is 123, that of point (43, 102) is 127, and that of point (44, 102) is 129. The data in this row is [123, 127, 129], which, together with the coordinates of all pixels in this row, is recorded as a structured array to construct a complete grayscale distribution matrix. During the extraction process, the grayscale values ​​of the image need to be verified. If the grayscale value is lower than 40% of the image mean, it is set to 0 as noise and removed. The image mean is obtained by summing all grayscale values ​​in the region and dividing by the total number of pixels. If the grayscale sum of the region is 55296, then the image mean is 55296÷441≈125.4. Taking 40% of it is 50.2, grayscale values ​​less than 51 are set to 0, and the rest are retained. After processing, a corrected region grayscale distribution matrix is ​​formed and all coordinate sequence information is retained for subsequent orientation gradient and construction pattern recognition.

[0119] S302: Based on the difference in gray values ​​between adjacent coordinates in the gray distribution matrix of the region, calculate the gradient change in the corresponding direction, determine whether the angle between the gradient direction and the external tangent direction of the boundary is continuously offset, obtain the set of all points with discontinuous angle changes, and obtain the gradient direction offset mark set.

[0120] After obtaining the grayscale distribution matrix, it is necessary to calculate the difference between the grayscale values ​​of all adjacent pixels, and further deduce the direction of grayscale change based on the difference. First, in the horizontal direction, calculate the difference between two adjacent pixels in each row. For example, if the grayscale value of point (41, 101) is 120 and that of point (42, 101) is 125, then the horizontal gradient is +5. The gradient between points (42, 101) and (43, 101) is 125→122, with a gradient of -3. In the vertical direction, compare the grayscale values ​​of pixels in the same column. The gray values ​​of the next two pixels, for example, (42, 101) = 125 and (42, 102) = 130, have a gradient of +5. After recording all gradient information, a gradient vector is constructed in two directions for each pixel. The difference between the changes in the two directions is used for judgment. If the difference between the current gradient direction and the previous gradient direction is greater than a set threshold, it is considered that the direction has shifted significantly. The gradient difference threshold is set to 5, based on the edge change amplitude in the gray-scale distribution of the blood smear image. This is applied to 200 images. The sample image was statistically analyzed to determine the range of continuous grayscale changes. It was found that over 90% of the grayscale changes in edge regions were concentrated within ±5. Therefore, gradient differences exceeding 5 were marked as directional jump points. For example, the change from (45, 103) to (46, 103) was +4, and then to (47, 103) it was +10, with a jump value of +6, which is greater than 5 and considered a discontinuous change. Further, it was determined whether the gradient direction of the point was consistent with the boundary tangent direction. The tangent direction was obtained by local linear fitting of the region's outer contour. For example, if the tangent direction of a point was horizontal, but the gradient of the current pixel point shifted in the vertical direction, it was considered an abnormal gradient direction, and the point was added to the gradient offset marker set. This process was performed pixel by pixel in the entire closed region. The coordinates of all pixels that met the gradient jump and directional offset conditions were recorded, and finally, a gradient direction offset marker set was generated. Typically, in a closed region with an area of ​​more than 400 pixels, the number of marker points was between 20 and 60, and the marker density was positively correlated with the structural complexity.

[0121] S303: Based on the spatial distribution density, offset direction pattern and fracture trend characteristics of the gradient direction offset marker set, identify three structural types: aggregation and diffusion, direction turning and gradient fracture, perform pixel classification and labeling on the differentiated structural regions, and establish a regional structural change distribution map.

[0122] Based on the gradient direction offset marker set, the spatial distribution, directional consistency, and density of the marker points are comprehensively judged to identify their structural type. For each marker point set, a 10×10 pixel unit window is used for local density statistics, counting the number of marker points within the window. A recognition threshold of 6 points is set, meaning that if there are 6 or more gradient offset points in a unit area, it is considered a high-density area. This threshold was verified by experiments, and the average number of offset points in the aggregated structural region in 50 typical smear images was 6.3. Based on this, the classification density standard is determined. If a region meets the density requirement and the gradient direction vector of all points changes by less than ±15°, it is identified as an aggregated diffusion structural region. If there is a significant angle change in the direction change within the region, it is considered a high-density region. If the angle between the front and back directions changes by more than 30°, it is judged as a direction-turning structure. If the direction change between adjacent pixels in the region is not obvious and the gradient direction is randomly distributed, and the gray-level difference between points is greater than 10 units and the angle change exceeds 45°, it is judged as a gradient-breaking structure region. Different categories are assigned different classification labels. For example, the aggregation region is assigned a value of 1, the turning region is assigned a value of 2, and the breaking region is assigned a value of 3. Finally, a structural change distribution map is constructed inside the entire closed region. Each pixel is assigned a corresponding label according to the structural category of its surroundings. The labeled image is superimposed with a color label layer on the gray-level image to form a regional structural change distribution map. This map reflects the spatial distribution pattern and pixel-level differential characteristics of the complex structure inside the image.

[0123] Please see Figure 5 The steps to construct and obtain the layer of the enhanced area are as follows:

[0124] S401: Call all classified and labeled regions in the regional construction change distribution map, extract the boundary coordinate values ​​and morphological feature information of the regions, construct a spatial location index for each boundary unit, and generate a construction boundary location set;

[0125] To retrieve all categorized and labeled regions from the regional structural change distribution map, their coordinate boundary information and morphological feature information must be extracted one by one. During execution, the unique code of each labeled region is first identified on the distribution map. The vertex coordinates of each region are then retrieved according to their numerical order to obtain the point set sequence constituting the region boundary, represented in two-dimensional coordinate form. Subsequently, polygon closure is checked on the point set, using whether the beginning and end of the point set are closed as the criterion. When the coordinates of the beginning and end are inconsistent, the boundary line between the end and the beginning of the point needs to be filled to form a closed figure. For each closed construction region, its morphological parameters are further read, including perimeter, area, aspect ratio, and orientation angle. The orientation angle is calculated based on the maximum axis direction after fitting the principal axis. For example, in a certain construction region, the principal axis fitting direction is 30 degrees northeast, the area is 245.8 square meters, and the aspect ratio is 1.76, then the orientation angle is assigned to 30 degrees. After the morphological parameters are collected, the boundary contour of the region is marked in the construction annotation layer and a boundary index table is generated. Each entry in the boundary index table records the corresponding region number, boundary point set, morphological parameters, and construction type. Index construction is performed on all regions, using a spatial indexing mechanism such as a quadtree or R-tree, and a spatial positioning table is built with the boundary coordinates as the index key to facilitate subsequent fast retrieval. Finally, a construction boundary positioning set is generated to support subsequent operations such as path coincidence and direction intersection judgment.

[0126] S402: Based on the coordinate boundaries in the construction boundary positioning set, call the change path boundaries generated in the edge fracture contour chain, calculate the coordinate intersection in the spatial overlapping area, determine whether it is in the path turning area, and filter the construction fragments with overlapping relationship and consistent direction to obtain the structural direction consistent intersection set.

[0127] Based on the coordinate boundaries in the boundary positioning set, each boundary segment is traversed sequentially. First, its start and end point coordinates are extracted to construct a spatial segment set. Then, all changing path segments are read from the fracture contour chain. Each segment contains start and end point coordinates and path direction information. The spatial overlap area is calculated for each boundary segment and path segment. The overlap criterion is: if the horizontal and vertical coordinates of two segments overlap within a certain range, and the angle between their directions is less than a certain threshold (e.g., 5 degrees), then they are considered to have spatial overlap and consistent directions. The overlap interval is expressed in the form of coordinate intersection. For example, the start and end coordinates of the boundary segment are... The path segment is The intersection of their x-coordinates is The intersection of the vertical coordinates is If the direction angles are 35 degrees and 36 degrees respectively, and the direction difference is 1 degree, which meets the judgment condition of less than 5 degrees, then the constructed segment is identified as overlapping and having the same direction, and it is written into the structural direction consistent intersection set. In this set, the coordinates, direction angle pairs, intersection length and other information of each set of intersection segments are recorded. At the same time, for areas with large coordinate differences, it is further confirmed whether they belong to the path turning area. The judgment method is to calculate the change rate of the direction angle of three points. If the change rate exceeds 12 degrees, it is marked as a turning node. If it does not exceed 12 degrees, it is identified as a stable direction line segment. This kind of processing ensures that the screening results of the constructed segments in the structural direction consistent intersection set are accurate and can effectively reflect the convergence of the boundary and the path.

[0128] S403: Based on the spatial location index of the intersection set of structural orientations, extract the overlapping area between the structural offset boundary and the structural anomaly boundary, integrate orientation attributes and morphological parameters, and use the following formula:

[0129] ;

[0130] The boundary construction matching degree value is obtained by calculation, and the segments with matching degree higher than the overlap threshold are uniformly classified and marked to establish a construction direction enhancement region layer.

[0131] in, This indicates the total matching degree within the structural trend enhancement region. Indicates the first One construction direction angle, Indicates the orientation angle of the corresponding fracture path segment. These represent the coordinate differences between the two points in the horizontal and vertical directions, respectively. For the first The total number of matching numbers corresponding to the direction segment. This indicates cumulative processing across overlapping segments in all directions;

[0132] The method of normalizing the dimensions of formula parameters;

[0133] In the formula:

[0134] ;

[0135] It contains two physical quantities with different dimensions:

[0136] Direction angle difference ( The unit of ) is "degree" (°), which is a dimensionless angular difference, and its essence is a relative deviation in direction;

[0137] Euclidean distance of coordinate difference ( The unit of ) is "meter" (m), which is a physical distance in space.

[0138] Because the two quantities have different units, dimensional normalization must be performed before direct addition to eliminate the incomparability between them. Common normalization methods include:

[0139] Direction angle difference normalization: Divide all angle differences by the maximum possible angle difference value, i.e., 180°, so that the normalized angle difference is always within the range of 180°. ;between.

[0140] ;

[0141] Euclidean distance normalization: based on the maximum distance between all pairs of coincident points in the actual constructed region. Normalize the distance difference of each group as follows:

[0142] ;

[0143] This method ensures that all terms involved in the addition are dimensionless and fall under a uniform scale for comparison, thus ensuring that the matching index is numerically comparable and consistent.

[0144] Definition of boundary construction matching degree value;

[0145] "Boundary construction matching degree value" is the symbol in the formula. The cumulative value represents a normalized metric sum that characterizes the degree of matching between multiple structural boundary segments and fracture paths in terms of structural direction and spatial location. The smaller the value, the closer the direction and spatial location are, and the higher the degree of matching; the larger the value, the more obvious the difference in structural direction or the greater the positional offset, and the worse the degree of matching.

[0146] The matching degree value is a dimensionless quantity because its constituent terms have been normalized, and it is essentially a weighted average of multiple relative errors. The final matching degree value is often used to compare with a preset threshold as the basis for determining whether two sets of boundaries can be classified as constructing consistent units.

[0147] Operational principle;

[0148] The calculation logic of this formula consists of three core steps:

[0149] Constructing fragment-level difference calculation: For each fragment First, the directional difference and spatial distance difference between the constructed segment and the fracture path segment are calculated respectively. After the two differences are processed by the absolute value and the Euclidean distance function, the directional and geometric offsets are obtained.

[0150] Match density weighted balancing: This is achieved by dividing the error value calculated in the previous step by the total number of match numbers in the current segment. The design of adding 1 to the denominator prevents the denominator from being 0, and at the same time provides error smoothing function for the multi-pair area, thereby avoiding excessive penalty for segments with a small number of matching pairs;

[0151] Global matching degree summation: After calculating the unit error term for each intersection segment with the same construction direction, sum them to obtain the total global matching degree. This serves as a quantitative output indicator for the structural orientation matching analysis.

[0152] The overall calculation aims to quantify the two key elements of directional deviation and spatial offset into a unified index. Under the influence of factors such as the number of fragments and the density of matching point pairs, normalization and weighting are used to make the matching degree result reflect both spatial proximity and directional similarity, thereby truly revealing the consistency of the ownership between the constructed fragments.

[0153] Based on the spatial location index of the intersection set of structural orientations, the construction orientation angle is first extracted. With path segment direction angle The correspondence is then determined, and the coordinate difference between the corresponding points for each pair of direction angles is obtained. and Each pair of coordinates is obtained through overlapping segment extraction. If there are multiple pairs of points in the i-th segment, the number is set to the total number of matching numbers identified in that group. For example, if 5 pairs of corresponding points are identified in the first segment, then... Substitute each pair of data into the following formula to calculate the matching degree:

[0154] ;

[0155] Given three segments that intersect in the same direction, their data is as follows:

[0156] Segment 1: , , , , ;

[0157] Segment 2: , , , , ;

[0158] Segment 3: , , , , ;

[0159] The calculations are as follows:

[0160] Paragraph 1:

[0161] ;

[0162] ;

[0163] Paragraph 2:

[0164] ;

[0165] ;

[0166] Paragraph 3:

[0167] ;

[0168] ;

[0169] Final total match rate:

[0170] ;

[0171] Assuming the overlap threshold is The result Therefore, this set of construction fragments will be categorized into the construction orientation enhancement region layer, and the construction number and direction attribute will be uniformly marked in the layer. The advantage of the formula is that, by introducing... Assess the consistency of angle and direction, and combine The geometric offset value provides a measure of the completeness of the spatial matching, ultimately determined by the total number of matching pairs. The balanced matching density effectively supports the identification and merging of high-matching construction segments.

[0172] Please see Figure 6 The steps to obtain the intelligent quality inspection solution are as follows:

[0173] S501: Call all the located regions in the constructed direction enhancement region layer, extract the red and blue channel pixel values ​​of the image within the corresponding range, and record the spatial distribution information of all pixels under the channel to generate the channel pixel extraction matrix.

[0174] To construct and enhance the location of all pre-defined regions in the layer, the region coordinate indices in the layer must first be parsed. The top-left and bottom-right pixel coordinates of each region are read as boundary points. When extracting the corresponding image data, a pixel block region bounded by these boundaries is cropped from the original image according to the actual image size. This pixel block is a two-dimensional pixel array, with each pixel consisting of red, green, and blue channels. During execution, channel separation processing is performed on each pixel within this region. The red channel is extracted as the first component value in the RGB matrix, and the blue channel as the third component value. Each pixel is bound to its spatial position in the image. For example, in an image region of 300×200 pixels, the red channel... The value at point (105, 72) is 134, and the value of the blue channel at the same point is 128. Therefore, the channel record for this point is (105, 72, 134) for the red channel and (105, 72, 128) for the blue channel. This process is repeated for all pixels to complete the extraction of pixel values ​​and spatial coordinate labeling for the red and blue channels in the entire region. To ensure efficient processing, every 100 rows of pixels are stored in a batch in the cache array. After the batch is completed, the data is written to the total channel pixel extraction matrix. This matrix is ​​a three-dimensional array, where each element stores the spatial position and grayscale value of a single pixel. Finally, the extraction results of all regions are merged to output the complete spatial grayscale distribution data of the red and blue channels, forming a complete channel pixel extraction matrix.

[0175] S502: Extract the pixel coordinates and grayscale values ​​of the red and blue channels in the region of the channel pixel extraction matrix, calculate the weighted average value in the vertical direction, identify the spatial centroid position of the red and blue channels in the vertical direction, compare whether there is a vertical offset between the centroids of the two channels, and obtain the channel centroid offset value set.

[0176] Based on the channel pixel extraction matrix, the pixels in each column of the image are traversed vertically. For each column, the grayscale values ​​of the red and blue channel pixels are extracted, and their vertical coordinates are recorded. Then, the sum of the product of the red channel pixel grayscale value and its vertical coordinate is calculated, and the total grayscale value of the red channel pixels in that column is calculated. Dividing the former by the latter yields the vertical centroid position of the red channel in that column. For example, in a region, column 132 contains 5 red channel pixels. The coordinates are 210, 211, 212, 213, and 214, with grayscale values ​​of 122, 129, 134, 128, and 131 respectively. Therefore, the centroid ordinate is calculated as: (122×210+129×211+134×212+128×213+131×214)÷(122+129+134+128+131)=136. 126÷644=211.37 pixels; Blue Tong The same operation is performed on each column. Assuming the center of gravity of the blue channel in this column is 210.46 pixels, the center of gravity offset of the two channels in this column is +0.91 pixels, indicating that the center of gravity of the red channel is higher than that of the blue channel. After repeating the calculation for all columns, the channel offset values ​​in each column are summed to form a set of channel center of gravity offset values. It should be noted that if the sum of gray levels is 0 during sampling, it means that the column is a no-signal segment and should be skipped. The range of offset values ​​generally falls within ±10 pixels. According to the actual image precision, if the center of gravity offset is greater than ±3 pixels, it is considered a significant offset. Therefore, the offset baseline threshold is set to 3.0 pixels. This value is obtained by statistically analyzing the average fluctuation range of the center of gravity offset of the red and blue channels in 10 standard images. The maximum value is 4.6, the minimum value is 1.2, and the average value is 2.8. The value is rounded up to 3.0 to avoid misjudgment. The final set of offset values ​​will be used as input data for subsequent directional comparison.

[0177] S503: Based on the offset direction of the red and blue channels in the concentrated area of ​​channel centroid offset values, compare whether there are opposite directions, filter out areas with different offset directions, record the image coordinate position, and establish a quality intelligent detection scheme.

[0178] Based on the channel centroid offset value set obtained in the previous step, the offset direction between each pair of columns is compared in column order to determine whether the vertical offset of the current column and the next column tends to be consistent or opposite. Specifically, for each column i and its adjacent column i+1, the offset values ​​δ_i and δ_{i+1} are taken. If one is positive and the other is negative, their product is less than zero, indicating that the offset directions of the two columns are opposite. For example, the offset value of column 88 is +2.7 pixels and that of column 89 is -2.2 pixels, so their product is -5.94, which meets the condition of opposite directions. This column is marked as a structural area with conflicting directions, and its corresponding column number and its horizontal starting coordinate are recorded. When three or more consecutive columns have alternating directions, it is defined as an abnormal region segment. Each segment is required to contain at least 3 alternations with a spacing of no more than 5 columns. Region segments that meet this condition will be divided into an entire segment. This is considered an abnormal quality region. For example, in a certain image region, columns 50 to 54 contain a fluctuating sequence with directions [+2.1, -1.5, +2.4, -1.9, +1.7]. The direction reverses four times consecutively, exceeding the preset threshold of two alternations. This segment is confirmed as an abnormal region, and the image coordinates are recorded in the range of x=50 to x=54. The corresponding y-coordinate range is determined by the region boundary. These coordinates will be written into the intelligent quality detection scheme as input to the intelligent analysis tool. The threshold for judging the difference in offset direction used in this detection mechanism is ±1.0 pixel. This threshold is set based on the statistical results of the centroid shift rate in normal images, using the rule that 95% of the offset fluctuation values ​​in the standard image sample set do not exceed 1.0 pixel. Therefore, when the direction alternates and the amplitude exceeds ±1.0 pixel, it is determined to be an abnormal region.

[0179] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A smart detection method for the quality of blood smears used in a laboratory, characterized in that, Includes the following steps: S1: Obtain the blood cell smear analysis area, extract the main pixel direction, construct path blocks in segments, extract boundary bends, compare the differences in the first and last angles, determine the change in direction, mark the turning connection points, and connect them into a side-direction broken contour chain. S2: Call the edge fracture contour chain to obtain the edge contour of the covered area, identify the first and last broken segments, determine the closure, filter out the segments with inconsistent beginning and end, splice the remaining contour to form a continuous area, and output the complete sealed boundary band. S3: Call the complete sealed boundary band, extract the corresponding grayscale pixels, calculate the gradient direction, compare the internal gradient with the boundary direction, classify and label aggregation diffusion, direction turning point and gradient breakage, and construct a regional structural change distribution map. S4: Call the regional construction change distribution map, extract the boundary, spatially compare the contour chain path, determine the overlap of construction anomalies and turning areas, integrate areas with consistent direction, filter the dual offset of structure and boundary, and output the construction direction enhancement area layer. S5: Call the constructed direction enhancement region layer, extract red and blue channel pixels, calculate the vertical centroid, compare the channel axial offset, filter and locate regions with different directions, and generate a quality intelligent detection scheme. The steps for obtaining the regional tectonic change distribution map are as follows: S301: Call the closed area in the complete sealed boundary band, extract all coordinate points of the corresponding area in the grayscale layer, obtain the grayscale value corresponding to each point and store it according to the coordinate sequence to obtain the area grayscale distribution matrix. S302: Based on the difference in gray values ​​between adjacent coordinates in the gray distribution matrix of the region, calculate the gradient change in the corresponding direction, determine whether the angle between the gradient direction and the external tangent direction of the boundary is continuously offset, obtain the set of all points with discontinuous angle changes, and obtain the gradient direction offset mark set. S303: Based on the spatial distribution density, offset direction pattern and fracture trend characteristics of the gradient direction offset marker set, identify three structural types: aggregation diffusion, direction turning and gradient fracture, perform pixel classification and labeling on the differentiated structural regions, and establish a regional structural change distribution map. Whether the angle between the gradient direction and the external tangent direction of the boundary shifts continuously refers to whether the angle between the gradient direction and the boundary tangent direction in the image shows a stable and continuous trend or an abrupt jump in spatial variation.

2. The intelligent detection method for blood smear quality in the laboratory according to claim 1, characterized in that, The edge fracture contour chain includes path block division, structural turning nodes, direction change sequence, and contour chain segment linking method. The complete sealing boundary zone includes continuous edge segments, end-to-end docking structure, closed area contour, and spatial coverage range. The regional structural change distribution map includes grayscale gradient distribution, angle continuity mode, direction change annotation, and structural anomaly type. The structural orientation enhancement area layer includes structural alignment blocks, boundary overlap positions, direction consistent areas, and double offset markers. The intelligent quality detection scheme includes red and blue channel centroid positions, vertical offset values, channel distribution differences, and offset position records.

3. The intelligent detection method for blood smear quality in the laboratory according to claim 1, characterized in that, The aggregation diffusion refers to the gray-level gradient direction within the image area being consistent with the boundary direction and exhibiting a divergent state, reflecting the structural changes of pixels tending to concentrate and diffuse. The directional change refers to a sudden change in the gradient direction along the path in the image, resulting in a change in direction. The gradient break refers to the interruption of the continuity of gray-level gradient within an image region, manifested as a sudden cessation and break in gray-level changes; The dual offset of structure and boundary refers to the simultaneous offset in position and direction of the boundary contour and the internal structure orientation in the image; The region with dissimilar directions refers to the region where the direction of the center of gravity extracted from the red and blue channels differs axially. The overlap between the structural anomaly and the turning point refers to the spatial intersection and coincidence of the structural anomaly in the structural path and the turning point on the edge path.

4. The intelligent detection method for blood smear quality in the laboratory according to claim 1, characterized in that, The steps for obtaining the edge fracture profile chain are as follows: S101: Based on the main structural outline of the blood cell smear image region, the pixel direction extraction algorithm is called to extract the continuous pixel arrangement path of a single structure, mark the connection sequence between all continuous pixel segments, and generate a set of pixel direction path segments. S102: Based on the start and end positions of each pair of adjacent path segments in the pixel path segment column set, call the boundary angle measurement process, calculate the tangent direction values ​​of the start and end respectively, compare the direction angles between the two, obtain the angle difference, filter the path segment connection points whose angle difference is greater than the boundary change reference value, and generate the path bending node coordinate set. S103: Based on the spatial sequence of the coordinate set of the path bending nodes, obtain the position difference and angle difference between adjacent points, calculate the side angle fluctuation value, then connect the node segments in sequence to obtain the connection trajectory and establish the side fracture contour chain. The path segment whose angle difference is greater than the boundary change reference value refers to the connection position of two segments in a continuous pixel path where the direction of the first and last tangents changes and reaches a preset angle threshold.

5. The intelligent detection method for blood smear quality in the laboratory according to claim 4, characterized in that, The steps for obtaining the complete sealed boundary zone are as follows: S201: Call the structural change path in the edge fracture contour chain, obtain the edge pixel sequence of the path coverage area, combine them according to connectivity to generate edge contour line segments, identify the positions of the beginning and end fractures in all boundaries, and generate a set of edge fracture fragments. S202: Based on the starting and ending coordinates of the boundary segments in the set of edge broken segments, determine whether the spatial closure condition is met, filter out all edge segments with inconsistent starting and ending coordinates, and obtain a continuous and splicable contour set. S203: Based on the connection relationship of the continuous splicable contour concentrated boundary segments, the first and last nodes are spliced ​​in sequence to complete the spatial position docking operation, construct a closed area, and establish a complete sealed boundary zone. The edge contour line segment refers to a sequence of boundary pixels with directionality and spatial continuity, which is formed by combining edge pixels within the path coverage area according to their connectivity.

6. The intelligent detection method for blood smear quality in the laboratory according to claim 5, characterized in that, The steps for obtaining the structured enhanced region layer are as follows: S401: Call all classified and labeled regions in the regional construction change distribution map, extract the boundary coordinate values ​​and morphological feature information of the regions, construct a spatial location index for each boundary unit, and generate a construction boundary positioning set; S402: Based on the coordinate boundaries in the construction boundary positioning set, call the change path boundaries generated in the edge fracture contour chain, calculate the coordinate intersection in the spatial overlapping area, determine whether it is in the path turning area, and filter the construction segments with overlapping relationship and consistent direction to obtain the structural direction consistent intersection set. S403: Based on the spatial location index in the intersection set of the structural directions, extract the overlapping area of ​​the structural offset boundary and the construction anomaly boundary, integrate the direction attributes and morphological structural parameters, calculate and obtain the boundary construction matching degree value, and uniformly classify and mark the segments with matching degree higher than the overlap threshold to establish a construction orientation enhancement region layer. The spatial location index refers to a data structure established by constructing the coordinate values ​​of the region boundary for locating and comparing spatial location relationships; The structural segments with overlapping relationships and consistent directions refer to structural segments whose boundary coordinates overlap in a spatial region and whose structural directions are the same or similar.

7. The intelligent detection method for blood smear quality in the laboratory according to claim 6, characterized in that, The steps for obtaining the intelligent quality detection scheme are as follows: S501: Call all the located regions in the constructed direction enhancement region layer, extract the red and blue channel pixel values ​​of the image within the corresponding range, and record the spatial distribution information of all pixels under the channel respectively to generate a channel pixel extraction matrix; S502: Based on the pixel coordinates and grayscale values ​​of the red and blue channels in the region of the channel pixel extraction matrix, calculate the weighted average value in the vertical direction, identify the spatial centroid position of the red and blue channels in the vertical direction, compare whether there is a vertical offset between the centroids of the two channels, and obtain the channel centroid offset value set. S503: Based on the offset direction of the red and blue channels in the concentrated area of ​​the channel centroid offset value, compare whether there are opposite directions, filter out areas with different offset directions, record the image coordinate position, and establish a quality intelligent detection scheme. The spatial centroid position refers to the average coordinate position of the channel pixels in the image calculated vertically based on gray-level weighting, reflecting the concentrated distribution center of the channel pixels; The regions with opposite offset directions refer to areas in the image where the center of gravity of the red channel and the blue channel are offset in opposite directions in the vertical direction.

Citation Information

Patent Citations

  • Heat-conducting adhesive tape defect detection method and system based on machine vision

    CN120765596A

  • A system and method for automatic blood smear analysis based on image analysis

    IN201841002277A