Fiber component image acquisition method based on multi-view-field multi-focal-plane automatic scanning
By employing adaptive scanning strategies and image processing techniques, the problems of low efficiency and recognition distortion caused by scanning non-uniformity in fiber composition detection have been solved, achieving efficient and accurate fiber composition image acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN FEIQUELANBO TECH RES CENT CO LTD
- Filing Date
- 2026-04-09
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies for fiber composition detection suffer from redundant scanning in sparse areas and incomplete scanning in dense areas, resulting in excessively long scanning times and distorted identification of compositional features, making it difficult to meet the needs of high-precision quantitative analysis.
By acquiring fiber coverage and stacking height through image pre-scanning, an adaptive acquisition strategy is constructed, Z-axis scanning parameters are adjusted to match fiber distribution characteristics, and scanning efficiency and component identification accuracy are ensured through maximum response layer indexing and overlapping area alignment techniques.
It achieves efficient scanning even when fiber samples are not uniformly distributed, avoids unnecessary scanning time, and ensures the integrity and accuracy of fiber composition images.
Smart Images

Figure CN122001986A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method for acquiring fiber composition images based on multi-field-of-view and multi-focal-plane automatic scanning. Background Technology
[0002] Currently, the use of fully automated microscopic imaging systems for morphological identification and quantitative analysis of textile fibers has gradually replaced manual microscopic examination, becoming the mainstream technology for fiber composition detection. These systems typically consist of a motorized stage, a Z-axis focusing module, and a high-resolution camera. By controlling the stage's field-by-field movement in the XY horizontal direction and multi-layer scanning in the Z-axis vertical direction, they acquire microscopic image data of fiber samples on a glass slide, as illustrated by Chinese patent CN223259959U.
[0003] When performing multi-field-of-view and multi-focal-plane scanning, existing technologies typically employ a globally fixed scanning strategy, which pre-determines the same number and range of Z-axis layers for all fields of view. However, the spatial distribution of fiber samples on the slide exhibits significant non-uniformity (e.g., dense stacking at the center and sparse, flat edges). This strategy, lacking adaptability, results in a large number of invalid and redundant scans in sparse areas, while in densely stacked areas, it is difficult to cover the entire focal plane, leading to excessively long invalid scan times and low overall acquisition efficiency. Furthermore, when synthesizing panoramic full-focal-plane composite images, the slight tilt of the slide surface and the lack of depth continuity constraints across fields of view cause adjacent fields of view to easily select inconsistent focal planes for imaging in overlapping areas. This deviation causes morphological breaks or local defocusing of cross-field fibers at the splicing points, leading to distortion in component feature recognition and making it difficult to meet the requirements of high-precision quantitative analysis. Summary of the Invention
[0004] Based on this, the present invention provides a fiber composition image acquisition method based on multi-field-of-view and multi-focal plane automatic scanning to solve at least one of the above-mentioned technical problems.
[0005] To achieve the above objectives, a fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning includes the following steps: Step S1: Perform image pre-scanning on the fiber scanning sample to obtain preview images; perform multi-field fiber spatial feature analysis based on the preview images to obtain the fiber coverage and stacking height of each field of view; evaluate the stacking state of each field of view based on the fiber coverage and stacking height, thereby constructing an adaptive acquisition strategy; Step S2: Perform multi-field and multi-focal plane image acquisition on the fiber scanning sample based on the adaptive acquisition strategy to obtain multi-focal layer image data corresponding to each field of view; Step S3: Calculate the sharpness feature value layer by layer for the multi-focal layer image data of the same field of view, and select the layer number with the largest sharpness feature value at each pixel position in the multi-focal layer image data as the maximum response layer index; extract pixel values from the multi-focal layer image data based on the maximum response layer index to reconstruct the sharp focal plane unit image; Step S4: Extract the overlapping regions in the focal plane sharp unit images of adjacent fields of view, spatially align the focal plane sharp unit images of adjacent fields of view based on the overlapping regions, and sequentially fill the aligned focal plane sharp unit images of each field of view into the preset panoramic canvas to generate the target fiber composition image.
[0006] Compared with the prior art, this disclosure has at least the following advantages: The aforementioned fiber composition image acquisition method based on multi-field-of-view and multi-focal plane automatic scanning pre-scans the fiber sample to obtain a preview image. Based on the preview image, multi-field fiber spatial feature analysis is performed to obtain the fiber coverage and stacking height of each field of view. An adaptive acquisition strategy is then constructed based on the fiber coverage and stacking height to evaluate the stacking state of each field of view. When performing multi-field-of-view and multi-focal plane image acquisition, firstly, the actual distribution characteristics of the fibers on the slide are quickly identified through pre-scanning. Subsequently, the Z-axis scanning parameters are configured differently according to the fiber coverage and stacking height differences of each field of view, so that sparse areas use fewer scanning layers and dense areas use a sufficient number of scanning layers. Compared to the existing technology that uses globally fixed scanning parameters for all fields of view, the adaptive acquisition strategy of this invention can accurately match the non-uniform spatial distribution characteristics of the fiber sample, avoid performing invalid and redundant scans in sparse areas, and ensure complete focal plane coverage of densely stacked areas, effectively reducing invalid scan time and significantly improving acquisition efficiency.
[0007] Furthermore, since the sharpness feature value is calculated layer by layer for multi-focal layer image data in the same field of view, and the layer number with the largest sharpness feature value at each pixel position is selected as the maximum response layer index, the pixel values are extracted based on the maximum response layer index to reconstruct the sharp focal plane unit image, and the overlapping areas of adjacent fields of view are extracted and spatially aligned based on the overlapping areas. When synthesizing panoramic images, firstly, the maximum response layer index is used to ensure that the sharpest focal plane layer is selected for each pixel in the same field of view; then, the spatial alignment of the overlapping areas achieves consistent registration of adjacent fields of view. Through the unified alignment mechanism of the overlapping areas, this invention can ensure the consistency of focal plane layer selection at the splicing point of cross-field fibers, avoid morphological breakage and local defocusing, thereby improving the integrity of fiber morphological features and the accuracy of component identification in the target fiber component image. Attached Figure Description
[0008] Figure 1 This is a schematic diagram of the steps of the fiber composition image acquisition method based on multi-field and multi-focal plane automatic scanning of the present invention; The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0009] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0010] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0011] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0012] To achieve the above objectives, please refer to Figure 1 This invention provides a fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning, comprising the following steps: Step S1: Perform image pre-scanning on the fiber scanning sample to obtain preview images; perform multi-field fiber spatial feature analysis based on the preview images to obtain the fiber coverage and stacking height of each field of view; evaluate the stacking state of each field of view based on the fiber coverage and stacking height, thereby constructing an adaptive acquisition strategy; In one embodiment, using a microscopic imaging system as an example, the motorized stage carries the fiber scanning sample and performs a full-area traversal in the XY plane at a low resolution or in a single-layer fast scanning mode. The camera continuously captures images and stitches them together in real time to generate a low-resolution global preview image. Subsequently, the preview image is divided into grids according to a preset high-magnification field of view size. For each grid cell (corresponding to a potential acquisition field of view), the foreground pixels are extracted using an image binarization algorithm, and the proportion of foreground pixels to total pixels is calculated as the fiber coverage. At the same time, the degree of fiber aggregation is estimated using the gray-level gradient distribution or local contrast in the preview image to estimate its relative stacking height.
[0013] Based on this, a dynamic lookup table is established to map the coverage and stacking height of each field of view to specific scanning parameters. For blank or sparse areas with coverage below a preset threshold, they are marked as "skip" or "single-layer snapshot"; for areas with high coverage and large stacking height, they are marked as "dense stacking" and assigned a larger Z-axis scanning range and a smaller step spacing. The coordinates of all fields of view and their corresponding personalized Z-axis scanning parameters are encapsulated to construct an adaptive acquisition strategy file.
[0014] Step S2: Perform multi-field and multi-focal plane image acquisition on the fiber scanning sample based on the adaptive acquisition strategy to obtain multi-focal layer image data corresponding to each field of view; In one embodiment, the fully automated microscopic imaging system reads an adaptive acquisition strategy file containing a sequence of fields of view to be scanned and their corresponding action instructions. The controller drives the motorized stage to move to the target field of view coordinates one by one according to the planned path. When a specific field of view is reached, the stacking state parameters corresponding to that field of view are analyzed. If the field of view is marked as a sparse region, the Z-axis focusing module only drives the lens to the preset center focal plane position, the camera triggers an exposure, completes the acquisition, and quickly moves to the next field of view, thereby avoiding invalid Z-axis reciprocating motion. Conversely, if the current field of view is identified as a densely stacked region, the Z-axis focusing module performs multi-layer stepping motion according to the start height, end height, and stepping accuracy set in the strategy. At each Z-axis pause or continuous motion trigger point, the camera synchronously acquires images, thereby obtaining a set of sequential images of the field of view at different depths of focus. These images are marked and stored in hierarchical order to form multi-focal layer image data corresponding to the field of view, ensuring that the complete information of the thick fiber stack is recorded in the longitudinal direction without sacrificing the overall scanning efficiency.
[0015] Step S3: Calculate the sharpness feature value layer by layer for the multi-focal layer image data of the same field of view, and select the layer number with the largest sharpness feature value at each pixel position in the multi-focal layer image data as the maximum response layer index; extract pixel values from the multi-focal layer image data based on the maximum response layer index to reconstruct the sharp focal plane unit image; In one embodiment, for multi-focal layer image data acquired for each field of view, all Z-axis layer images of that field of view are loaded. Using a high-pass filter (such as the Laplacian operator or the Sobel operator) or a variance evaluation function, the local gradient magnitude of each pixel in each layer image is calculated. This magnitude represents the sharpness feature value. All layers are traversed, and the sharpness feature values of the same pixel coordinates in different layers are compared. The layer with the largest feature value is identified, and the layer number of that layer is recorded as the maximum response layer index for that pixel position. After generating the maximum response layer index matrix, a pixel remapping operation is performed. For each pixel (x, y) in the output image, according to the layer number k recorded in the index matrix, the pixel color value or grayscale value is extracted from the (x, y) position of the k-th layer image of the original multi-focal layer data and assigned to the output image. Through this pixel-level fusion method, the sharp fiber texture originally distributed on different focal planes is extracted and recombined onto the same plane, generating a sharp focal plane unit image with sharp focus across the entire field of view, effectively solving the problem of local blurring caused by fiber height differences.
[0016] Step S4: Extract the overlapping regions in the focal plane sharp unit images of adjacent fields of view, spatially align the focal plane sharp unit images of adjacent fields of view based on the overlapping regions, and sequentially fill the aligned focal plane sharp unit images of each field of view into the preset panoramic canvas to generate the target fiber composition image.
[0017] In the image stitching stage, instead of relying solely on the mechanical encoder coordinates of the stage for arrangement, a content-based visual registration mechanism is introduced. Based on a preset field-of-view overlap rate (e.g., 10%), theoretically overlapping sub-images are extracted from the focal plane sharp unit images of two adjacent fields of view. Feature matching algorithms (such as SIFT, SURF, or normalized cross-correlation matching NCC) are used to calculate the relative displacement vector between the two overlapping regions. This vector accurately reflects the positional deviation of adjacent fields of view in actual optical imaging, correcting errors caused by slight tilting of the slide or mechanical return gaps. Subsequently, a blank panoramic canvas covering the entire sample size is created. Using the first field of view as a reference, spatial geometric transformations (translation or slight rotation) are performed on the images of subsequent fields of view based on the calculated displacement vector to achieve sub-pixel-level spatial alignment. The aligned images of each field of view are then sequentially written into the panoramic canvas. For pixel values in overlapping areas, a weighted average or multi-band fusion algorithm is used for smooth transition processing to eliminate stitching gaps, ultimately generating a high-resolution, seamless, and fully sharp image of the target fiber composition.
[0018] Preferably, step S1 includes the following steps: Step S11: Construct a scanning space coordinate system based on the fiber scanning sample; Step S12: Divide the fiber scanning sample into grid field units according to the preset coarse scanning grid spacing, and calculate the X and Y coordinate values of the center point of each grid field unit in the scanning space coordinate system to form a list of pre-scanning field center coordinates. Step S13: Perform image pre-scanning on the fiber scan sample based on the pre-scan field center coordinate list, and acquire preview images of different focal planes of the grid field unit in the Z-axis direction; Step S14: Perform field-of-view fiber spatial feature analysis on the preview image to obtain the reference focal plane height, stacking height and fiber coverage of the field of view corresponding to the grid field of view unit.
[0019] In one embodiment, when the fully automated microscopic imaging system starts the initialization program, it controls the stage to move towards the negative limit positions of the X, Y, and Z axes respectively until the limit sensors are triggered, establishing the mechanical origin. Specifically, the feedback value of the stage grating ruler is read, the upper left corner vertex of the slide slot is set as the coordinate origin (0,0,0), and the X and Y axes are established along the horizontal movement direction of the stage, and the Z axis is established along the vertical lifting direction of the objective lens, in micrometers, thereby constructing a three-dimensional scanning space coordinate system. It should be noted that this scanning space coordinate system is the reference for all subsequent field-of-view positioning and image stitching. The orthogonality of this coordinate system is corrected by a preset calibration plate to ensure that the angle error between the X and Y axes is within the preset allowable deviation range.
[0020] In one implementation of this invention, the "coarse scan grid spacing" is read. This data is set based on the actual field of view of the low-magnification objective (e.g., a 4x objective). Specifically, based on the length L and width W of the scanning activity area, the number of columns N in the horizontal direction and the number of rows M in the vertical direction are calculated using a floor function. It should be noted that, in order to calculate the center point coordinates of each grid field of view unit, the following linear formula is used for traversal calculation: Let the... Line number The horizontal coordinate of the center point of the grid field of view unit of the column is The vertical coordinate is ,but , ;in, and This is the center offset of the starting grid. This is the preset coarse scan grid spacing.
[0021] In one implementation of this invention, the stage is driven to move rapidly to each coordinate point according to the pre-scanned field of view center coordinate list. Specifically, when the stage reaches a certain coordinate point, the Z-axis focusing module does not execute a fine autofocus algorithm, but instead performs an action according to a "preset large-step Z-axis scanning strategy". This strategy predefines a scanning range covering the thickness tolerance of the slide (e.g., 50 micrometers up and down) and a large Z-axis step size (e.g., 10 micrometers). Moreover, the camera triggers exposure after each Z-axis movement, or triggers exposure at fixed time intervals during low-speed continuous Z-axis movement, thereby acquiring a set of 5 to 10 low-resolution images of different depths for the current grid field of view unit. It should be noted that these images constitute the "preview image stack" of the field of view. Although their clarity is not as good as the final acquired image, it is sufficient to reflect the presence and approximate height of the fiber. In other words, this is a probing scan that sacrifices a small amount of clarity for extremely high scanning speed.
[0022] In one implementation of this invention, to obtain the fiber coverage, the frame with the highest sharpness evaluation index is selected for binarization. A "grayscale segmentation threshold" is set (this threshold is obtained by statistically analyzing the background noise of the blank slide, for example, set to 1.2 times the average grayscale value of the background), and the number of pixels in the image with grayscale values greater than this threshold is counted. Divide it by the total number of pixels in the image. That is, to obtain the fiber coverage. It should be noted that, regarding the calculation of stacking height, the curve of the sharpness evaluation index changes with the Z-axis is analyzed. The difference between the upper and lower Z-axis positions corresponding to the curve dropping to 50% of the peak value is defined as the "half-width at half maximum" (HWHM). Alternatively, the difference between the highest and lowest layer numbers in the image where effective edge gradients can be detected is identified. This difference is multiplied by the Z-axis step size to calculate the stacking height.
[0023] Of particular importance is the construction of a scanning space coordinate system based on the fiber scan sample, which includes: Boundary contour recognition is performed on the fiber scan sample to obtain the boundary contour line of the fiber scan sample; Calculate the minimum bounding rectangle of the boundary contour, and determine the vertex coordinates and side length of the minimum bounding rectangle; Choose any vertex in the smallest bounding rectangle as the origin of the coordinate system, take the direction of the origin along one side of the smallest bounding rectangle as the positive direction of the X-axis, take the direction of the origin along the adjacent side of the smallest bounding rectangle as the positive direction of the Y-axis, and take the direction perpendicular to the XY-axis plane as the positive direction of the Z-axis to establish the scanning space coordinate system.
[0024] In one implementation of this invention, the fully automated microscopic imaging system first activates a low-magnification macroscopic camera to quickly photograph the entire stage area, acquiring a high-resolution panoramic image containing the fiber scan sample. Specifically, the panoramic image is grayscale processed, and a global threshold is calculated using an image binarization segmentation threshold to segment the image into a foreground (sample area) and a background (stage base area). Then, the binarized image is convolved using the Canny edge detection operator or the Sobel operator to extract the set of edge pixels in the foreground area.
[0025] In one implementation of this invention, geometric analysis is performed on the obtained boundary contour line. A rotating caliper algorithm can be used to find the minimum bounding rectangle of the contour line. Specifically, this algorithm rotates a pair of parallel support lines around the convex hull of the contour line, calculating the area of the rectangle at each angle where the pair of support lines coincide with the boundary of the convex hull. By comparing the rectangle areas at all angles, the rectangle with the smallest area is found as the minimum bounding rectangle. The pixel coordinates of the four vertices of this minimum bounding rectangle are recorded as follows: And use the Euclidean distance formula to calculate the distance between two adjacent points as the side length, for example, the longer side. short side It should be noted that these pixel coordinates and dimensions will subsequently be determined using the camera's calibration coefficients. (For example, each pixel corresponds to 5 micrometers) This is converted into the actual physical size and coordinate values, i.e., the physical long side. Physical shorter side .
[0026] Specifically, calculate the unit vector originating from the origin along the longer side of the smallest circumscribed rectangle. Define it as the positive direction of the X-axis; calculate the unit vector along the short side direction. This direction is defined as the positive Y-axis. Simultaneously, using the right-hand rule, the direction perpendicular to the plane formed by the X and Y axes is defined as the positive Z-axis. The original mechanical coordinate system of the stage is transformed to this newly created scanning space coordinate system using a rotation and translation matrix. It should be noted that if the longer side of the smallest bounding rectangle forms an angle with the mechanical axis of the stage... The coordinate transformation formula will be applied in real time when controlling the movement of the stage. , Perform path planning, where and The target position in the machine coordinate system. and To ensure the planned location in the scanning spatial coordinate system, the scanning path is always parallel to the actual physical edge of the sample.
[0027] Preferably, the field-of-view fiber spatial feature analysis of the preview image includes: The sharpness evaluation value of each preview image is obtained by summing the absolute values of the grayscale differences between adjacent pixels in each preview image. The sharpness evaluation values of each preview image are sorted in descending order. The sharpness evaluation value at the top of the sorted values is selected as the peak sharpness. The preview image corresponding to the peak sharpness and its corresponding Z-axis position are recorded as the reference focal plane height of the field of view. Calculate the product of peak sharpness and a preset scaling factor to obtain the lower limit threshold for sharpness; The difference between the maximum and minimum Z-axis position values of preview images whose sharpness evaluation values are greater than the lower threshold of sharpness is used as the stacking height of the field of view. Binarize and segment the preview image corresponding to the reference focal plane height to obtain a binary segmented image; The fiber coverage of the field of view is obtained by calculating the ratio of the number of fiber foreground pixels in the binary segmented image to the total number of pixels in the preview image.
[0028] In one implementation of this invention, for a resolution of Multiply The grayscale image matrix is traversed sequentially using raster scanning to check each pixel. Calculate the number of pixels that are horizontally adjacent to the given pixel. The sharpness evaluation value is obtained by summing the absolute values of the differences between the grayscale values of all pixels in the image. It should be noted that this calculation process uses mathematical formulas. It means that among them Representing coordinates The pixel grayscale value at that location.
[0029] In one implementation of this invention, a key-value pair list consisting of Z-axis position coordinates and corresponding sharpness evaluation values is established. Specifically, the list is sorted in descending order of sharpness evaluation values using bubble sort or quick sort, and the sharpness evaluation value at the top of the sorted list is directly selected as the peak sharpness. And read the Z-axis position coordinates corresponding to this value as the reference focal plane height. .
[0030] In one implementation of this invention, a preset scaling factor is read from configuration parameters. This scaling factor is set based on the depth-of-field characteristics of the microscope lens and the transparency of the fiber sample, and is typically between 0.4 and 0.6. Specifically, a multiplication operation is performed. To obtain the lower limit threshold of sharpness .
[0031] In one implementation of this invention, the sharpness evaluation values of all preview images in the field of view are iterated, and all images with sharpness values greater than the lower threshold are selected. The image frames are analyzed, and the set of Z-axis position coordinates corresponding to these valid image frames is extracted. Specifically, the maximum Z-axis coordinate value is found from this set. and minimum Z-axis coordinate value By subtraction The stacking height of the field of view was calculated. .
[0032] In one implementation of this invention, the clearest preview image at the reference focal plane height is retrieved, and the optimal global threshold is automatically calculated using the Otsu algorithm (maximum inter-class variance method). Specifically, the algorithm iterates through all grayscale thresholds from 0 to 255, calculates the inter-class variance between the foreground and background, and selects the grayscale value corresponding to the largest variance as the segmentation threshold. For example, if the calculated threshold is 100, pixels with grayscale values less than 100 in the image are marked as background (assigned a value of 0), and pixels with grayscale values greater than or equal to 100 are marked as fiber foreground (assigned a value of 1), thereby generating a binary segmented image with only black and white.
[0033] In one implementation of this invention, histogram statistics are performed on the binary segmented image to calculate the total number of pixels with a pixel value of 1. At the same time, obtain the width of the image. and high Calculate the total number of pixels in the image. Through division operation Fiber coverage .
[0034] Preferably, the adaptive acquisition strategy constructed in step S1 by evaluating the stacking state of each field of view based on fiber coverage and stacking height includes: The fiber coverage of the grid field of view unit is compared with a preset coverage threshold. Grid field of view units with fiber coverage less than the preset coverage threshold are marked as single-layer areas, and grid field of view units with fiber coverage greater than or equal to the preset coverage threshold are marked as stacked areas, generating a region type identifier. Traverse the region type identifiers corresponding to the grid field of view units, check whether the region type identifiers of the current grid field of view unit and its adjacent grid field of view units are consistent, and merge the grid field of view units with the same region type identifiers and spatially adjacent into connected regions. Plane fitting is performed on the reference focal plane height of all grid field units within the connected region to obtain the tilted reference plane of each connected region, and the tilted reference plane is used as the Z-axis scanning zero reference for all fields within the region. For connected regions identified as single-layer regions, the basic layer scan range and sparse step size centered on the inclined reference plane are set to generate single-layer acquisition parameters. For connected regions identified as stacked regions, the extended layer scan range is set based on the maximum stacking height of each grid field of view unit within the connected region, and a dense step size is set to generate stacked acquisition parameters.
[0035] In one implementation of this invention, a preset coverage threshold is read, for example, set to 10%. Specifically, all grid field-of-view cells are traversed, and the fiber coverage of each cell is read. ;for For units, set their region type identifier to 0 (representing a single-layer region); for The cell is assigned a region type identifier of 1 (representing a stacked region). It should be noted that the coverage threshold is an empirical value determined by statistical analysis of a large number of historical samples with different fiber density distribution characteristics. The principle of setting this threshold is to effectively distinguish between densely stacked regions that require multi-layer fine scanning and sparse, flat regions that only require a small number of layer scans.
[0036] In one implementation of this invention, a two-pass scanning algorithm or a breadth-first search algorithm is used to perform connectivity analysis on the region type identifier matrix of the grid field of view units. Specifically, the algorithm first assigns a unique temporary label to each field of view unit, then traverses the matrix. When it is detected that the current unit and the units in its four neighboring regions (upper, lower, left, and right) have the same region type identifier (all 0 or all 1), the two units are recorded as having an equivalence relationship. During the second scan, all connected units are merged into a single connected region according to the equivalence relationship table and assigned a unique region ID.
[0037] In one implementation of this invention, for each connected region, the center coordinates of all field-of-view units are extracted. and its corresponding reference focal plane height Specifically, the least squares method is used to construct the plane equations. Plane parameters are determined by solving the normal equations. , and This minimizes the sum of the squared distances from all sampling points to the plane; it should be noted that... and These represent the tilt rates of the slide along the X and Y axes in this region, respectively. The intercept height is the plane equation obtained by fitting the plane, which is the inclined reference plane.
[0038] In one implementation of this invention, a lower data acquisition density is configured for the single-layer region to improve efficiency. For example, the basic layer scan range is set to 3 micrometers vertically, and the sparse step size is 1.5 micrometers. This means that for each field of view within the single-layer region, the Z-axis will be... micrometers micrometers Image acquisition is performed at three locations: micrometers, micrometers, and micrometers. In other words, acquiring only a very small amount of focal plane data is sufficient to cover the depth-of-field requirements of a single fiber layer, while the plane fitting results ensure accurate focusing of these layers.
[0039] In one implementation of this invention, the stacking height of all units within the connected region of the stacking area is traversed to find the maximum value. (e.g., 20 micrometers), for example, setting the extended scan range to... Add a safety margin (e.g., 5 micrometers), resulting in a total scan range of 25 micrometers, and set the dense step size to 0.5 micrometers, requiring the Z-axis to start from... Starting at one micrometer, an image is acquired every 0.5 micrometers until... The scan ended at the micrometer level, with a total of 51 images acquired. It should be noted that this high-density layer scanning strategy ensures that even at the densest fiber intersections, complete and clear axial information can be obtained, avoiding missed detections.
[0040] Of particular importance is that, for connected regions identified as stacked areas, the extended layer scan range is set based on the maximum stacking height of each grid field of view unit within the connected region, and a dense step size is set to generate stacked acquisition parameters including: The stacking height of each grid field of view unit within the connected region is extracted, and the field of view is divided into three levels according to the preset first stacking threshold and second stacking threshold: sparse scanning parameters are assigned to the field of view whose stacking height is less than the first stacking threshold, standard scanning parameters are assigned to the field of view whose stacking height is between the two thresholds, and dense scanning parameters are assigned to the field of view whose stacking height is greater than or equal to the second stacking threshold. A hierarchical Z-axis scanning strategy is generated, where sparse, standard, and dense scanning parameters correspond to an increasing number of Z-axis scanning layers and a decreasing step spacing, respectively, and the first stacking threshold is less than the second stacking threshold. Calculate the initial Z-axis compensation value relative to the tilt compensation plane based on the X and Y coordinates of each grid field of view unit; Using the initial Z-axis compensation value as the scanning start point, and combining the number of layers and step spacing in the hierarchical Z-axis scanning strategy, the Z-axis termination point and tomographic sequence of each grid field of view unit are calculated, generating stacked acquisition parameters containing differentiated control commands.
[0041] In one implementation of this invention, the stacking height dataset of all grid field cells within the current connected region is extracted from the fiber space feature analysis results generated in the preceding steps. Specifically, a preset first stacking threshold is read. Second stacking threshold and ensure For each field of view unit, compare its stacking height. Relationship with threshold size: If The field of view is then marked as slightly stacked, and sparse scan parameters are assigned, setting a smaller number of scan layers. and larger step spacing ;like The field of view is then labeled as moderately stacked, and standard scanning parameters are assigned, setting a moderate number of scanning layers. and step spacing ;like The field of view is then marked as heavily stacked, and dense scanning parameters are assigned, setting a higher number of scanning layers. and smaller step spacing It should be noted that the parameters satisfy the following conditions: and This relationship ensures that scanning precision increases with increasing stacking degree.
[0042] In one implementation of this invention, the equation of the inclined reference plane is obtained through plane fitting. For each grid field of view cell, extract the x-coordinate of its center point. and ordinate Substituting into the above equation, we can calculate the theoretical height of this point on the ideal plane. To highly value this theory Defined as the Z-axis zero reference point of this field of view.
[0043] In one implementation of this invention, the number of scanning layers allocated to each field of view unit is... and step spacing and the calculated initial Z-axis compensation value This generates a series of discrete Z-axis motion coordinates. Specifically, this is achieved through the formula... Calculate the first The Z-axis position of the layer, where From 1 to Integer, at this time, the first The Z-axis position of the layer is the Z-axis endpoint. This ordered set of coordinates Encapsulate it as a tomography sequence instruction and associate it with the planar coordinates of the field of view. The parameters are correlated to form the final stacked acquisition parameter package.
[0044] Preferably, step S1, which evaluates the stacking state of each field of view based on fiber coverage and stacking height to construct an adaptive acquisition strategy, further includes: Obtain the spatial distribution topology of connected regions; The field of view acquisition sequence is planned based on the spatial distribution topology, and the connection order between regions is determined according to the shortest distance between connected regions to generate the field of view acquisition sequence. The center coordinates of each grid field of view unit in the field of view acquisition sequence and the single-layer acquisition parameters or stacked acquisition parameters corresponding to their respective connected regions are encapsulated to construct an adaptive acquisition strategy containing differentiated automatic scanning control commands.
[0045] In one implementation of this invention, all connected regions marked as "single-layer regions" or "stacked regions" and their contained mesh field-of-view units are obtained through preliminary steps. Specifically, for each connected region... Calculate its geometric centroid coordinates The centroid coordinates are obtained by the arithmetic mean of the center coordinates of all field units within the region. A weighted undirected complete graph is constructed with the centroids of each connected region as nodes and the minimum Euclidean distance between connected regions as edge weights, which is the spatial distribution topology.
[0046] In one implementation of this invention, path optimization is first performed on the field-of-view units within the connected regions, using a serpentine scanning or Hilbert curve scanning mode to generate each connected region. Internal Local Ordered Field of View List Specifically, at the macro level, the Traveling Salesman Problem (TSP) of the aforementioned weighted undirected complete graph is solved using a greedy algorithm or simulated annealing algorithm, planning a region-visiting path that visits all connected regions with the shortest total travel distance. According to the path The determined order connects the local field-of-view lists of each region sequentially. , the previous area The last scan field of view and the next region The first scanning field of view is connected to form a global field of view acquisition sequence that runs through the entire sample; it should be noted that at the junction, the acceleration and deceleration time of the stage is calculated based on the actual physical distance, and necessary transition commands are inserted.
[0047] In one implementation of this invention, the generated field-of-view acquisition sequence is traversed, and for each grid field-of-view unit in the sequence, its planar coordinates are extracted. And the Z-axis scan parameters (including starting height) assigned according to the type of connected region to which it belongs. Termination height Step spacing Exposure time, etc.
[0048] Of particular importance, constructing an adaptive acquisition strategy that includes differentiated automatic scanning control commands also includes: The physical travel time along the XY axes of the image acquisition device from the current field of view to the next field of view is calculated and denoted as the lateral movement delay. The time it takes for the image acquisition device to reset from the end height of the current field of view to the start height of the next field of view is recorded as the longitudinal reset time. By comparing the lateral movement delay with the longitudinal reset time, if the lateral movement delay is greater than the longitudinal reset time, a Z-axis reset command is inserted during the synchronization period after the XY-axis movement command is issued, thus constructing an adaptive acquisition strategy for non-uniform tomography.
[0049] In one implementation of this invention, when generating the field-of-view acquisition sequence, the current field of view is read. center coordinates With the next field of view center coordinates Specifically, using the distance formula between two points... Calculate the physical linear distance the stage needs to move. Next, retrieve the motion parameter configuration table of the electric platform and obtain the preset maximum speed. acceleration and deceleration It should be noted that the lateral movement delay is calculated based on the trapezoidal velocity programming model. That is, the total time including the acceleration phase, the constant speed phase, and the deceleration phase. If If the maximum speed cannot be reached in a shorter distance, then the velocity is calculated using a triangular velocity planning method. For example, for distance... Accelerate time Uniform time deceleration time ,but .
[0050] In one implementation of this invention, the current field of view is extracted. Z-axis termination scan height and next field of view Z-axis starting scan height Specifically, calculate the difference in vertical distance between the two. Then, the maximum speed of the Z-axis motor is read. and acceleration Similarly, the longitudinal reset time is calculated using kinematic formulas. .
[0051] In one implementation of this invention, for each adjacent field of view pair Perform a time analysis. Specifically, if The system determines that a time window for "hidden Z-axis reset action" exists and generates a parallel control command, namely, sending a "move to" command to the XY-axis controller of the stage. Simultaneously with the command (or after a very short microsecond delay), send "Move to" to the Z-axis controller. In other words, the instruction utilizes the time taken for the XY axis to move a long distance to complete the Z-axis homing action, so that when the stage reaches the horizontal position of the next field of view, the Z-axis has already reached the starting height in advance or simultaneously, without any extra waiting time, thus significantly improving the overall scanning efficiency.
[0052] Preferably, step S3 includes the following steps: Step S31: Perform Laplacian convolution operation on each layer of the same field of view in the multi-focal layer image data, calculate the gradient magnitude at each pixel position, and generate a gradient evaluation map sequence for the field of view; Step S32: Traverse all gradient response values at the same pixel position in the gradient evaluation map sequence, filter the layer number corresponding to the maximum gradient magnitude, and generate the maximum response layer index; Step S33: Based on the layer number recorded at each pixel position in the maximum response layer index, index and extract the RGB pixel values at the corresponding positions from the multi-focal layer image data, and reconstruct them to generate a full-focal surface texture map; Step S34: Normalize the depth grayscale value of the maximum response layer index to construct a depth index map, and attach it as an independent data channel to the full focal plane texture map to synthesize a focal plane sharp unit image containing texture information and depth information.
[0053] In one implementation of this invention, multi-focal layer image data is first loaded into the GPU memory. This data includes images of a certain field of view acquired at different Z-axis heights. Each color image is converted to a grayscale image, and a spatial convolution operation is performed on each grayscale image using a preset Laplacian convolution kernel (e.g., a 3rd-order convolution kernel: center value is 4, adjacent values are -1, and the rest are 0). This operation is applied to any pixel position in the image. Its convolution result This reflects the second derivative information at that point, and the absolute value of the convolution result is taken. This yields the gradient magnitude map of that layer. It should be noted that this gradient magnitude directly characterizes the sharpness of image edges, i.e., clarity. The layer images are processed sequentially using the above operations to ultimately generate an image containing... A sequence of gradient evaluation graphs for gradient magnitude plots.
[0054] In one implementation of this invention, the generated gradient evaluation map sequence is analyzed pixel by pixel. Specifically, for pixel coordinates... Extract the point from layer 1 to layer 2. The values in the layer gradient magnitude map form a length of gradient response vector Find the vector through comparison algorithm The maximum value in and its corresponding index position That is, the first The layer image is clearest at this point; therefore, this optimal layer number should be selected. Recorded in a two-dimensional matrix of the same size as the original image middle.
[0055] In one implementation of this invention, a new blank RGB image is created. Traversing the matrix Each coordinate in Read its stored layer number Then, the original multifocal layer image data is accessed to locate the first... Layer color image, extract the coordinates of that layer Pixel values of the red, green, and blue channels at the location And assign this set of values to the new image. The corresponding position.
[0056] In one implementation of this invention, the maximum response layer index matrix is... Numerical normalization is performed, mapping its value range to a grayscale range of 0 to 255. Specifically, this is done using the formula... Calculate the depth gray value ,in The total number of layers, the generated depth index map In reality, it is a grayscale image. The higher the brightness, the higher the focal plane (the higher the physical height) the pixel is located on. This depth index map is used as the fourth channel (Alpha channel or independent Depth channel) and merged with the three RGB channels of the full focal plane texture map to generate a four-channel image file (such as PNG or TIFF in RGBA format).
[0057] Preferably, before synthesizing a focal plane sharp unit image containing texture information and depth information, the method further includes: Calculate the variance of the layer number of each pixel position in the maximum response layer index within a preset neighborhood window, mark the pixel positions with variance values greater than a preset variance threshold as outliers, and generate an outlier mask. The proportion of outliers in the outlier mask is calculated to obtain the outlier percentage value. Determine whether the proportion of outliers is greater than the preset correction trigger threshold. If the proportion of outliers is greater than the correction trigger threshold, then perform median filtering and mode filtering on the maximum response layer index in sequence to eliminate isolated layer number jump points and fill small-range layer number holes to generate a smooth layer index. The position of the pixel to be corrected in the smoothing layer index is located based on the outlier mask. The position of the pixel to be corrected is rounded and padded by the distance-weighted average of the effective pixel layer indices in the neighborhood to generate the correction layer index. Based on the layer number recorded in the correction layer index, the RGB pixel values of the corresponding layer are re-extracted from the multi-focal layer image data to correct the full focal plane texture map, and the correction layer index is updated to the data channel to output the optimized focal plane sharp unit image. If the proportion of outliers is less than or equal to the correction trigger threshold, the image of the sharp focal plane unit will not be optimized.
[0058] In one implementation of this invention, a 3-pixel by 3-pixel neighborhood window is first defined, containing a total of 9 pixels. Specifically, the maximum response layer index is traversed. Each pixel coordinate Get all layer index values within a 3x3 area around the given coordinate. Calculate the vector variance ,in The variance value is calculated as the arithmetic mean of the inner layer indices of this neighborhood. Compared with the preset variance threshold If a comparison is made, If the layer number around the point changes drastically, it is a noise point or an edge jump point. The point is marked as 1 (white) in the outlier mask matrix; otherwise, it is marked as 0 (black).
[0059] In one implementation of this invention, the generated outlier mask matrix is summed and counted. Specifically, the total number of elements with a value of 1 in the matrix is calculated. And obtain the total number of pixels in the matrix. (Width multiplied by height), using the formula The outlier percentage was calculated. It should be noted that this ratio value It reflects the degree of dispersion or noise level of the depth information of the entire map.
[0060] In one implementation of this invention, a preset correction trigger threshold (e.g., 0.05, or 5%) is read. Specifically, if the calculated... The depth map was deemed of poor quality, and the maximum response layer index matrix was used. A 5x5 median filter is applied, sorting all layer numbers within the window and replacing the center point value with the median value. This effectively removes salt-and-pepper noise. Next, a mode filter is applied to the median-filtered result. The most frequent layer number value within a 3x3 window is counted; if this value accounts for more than half, the center point value is replaced with this mode value. This fills small gaps in the layer number count and generates a smooth layer index. .
[0061] In one implementation of this invention, the smoothing layer index is determined based on the position marked as 1 in the outlier mask matrix. Mid-positioning of pixels to be corrected Specifically, it retrieves all pixels within the neighborhood of a given pixel (e.g., a 5x5 range) whose mask marker is 0 (i.e., not outliers, considered valid). and its layer number Calculate the Euclidean distance from each valid point to the point to be corrected. And based on the reciprocal of the distance As weights, the weighted average formula is used. Calculate the new layer number, round the result to the nearest integer, and replace the value in the original index with this integer value to generate the final corrected layer index. .
[0062] In one implementation of this invention, a correction layer index is utilized. The full-focal-area texture map is reconstructed a second time. Specifically, for each pixel coordinate... Read the corrected layer number The first time to access the original multifocal layer image data again The layer extracts the RGB value at that location and updates it to the full focal plane texture map.
[0063] In one implementation of this invention, if the statistical outlier percentage is... The current depth map is determined to be of good quality, and no complex smoothing and resampling operations are required.
[0064] Preferably, before extracting the overlapping region in the focal plane sharpness unit images of adjacent fields of view in step S4, and before spatially aligning the focal plane sharpness unit images of adjacent fields of view based on the overlapping region, the process includes: Image patches corresponding to overlapping regions are cropped from the sharp focal plane unit images of adjacent fields of view. Feature points are extracted from the two image patches and similarity matching is performed to generate an initial set of matching point pairs. Obtain the depth grayscale value corresponding to each matching point in the initial matching point pair set, calculate the depth deviation value of the two ends in the same matching point pair, remove the matching point pairs whose depth deviation value is greater than the preset depth continuity threshold, and generate a valid matching point pair set; Based on the coordinate position relationship of each matching point pair in the effective matching point pair set, the translation and rotation angle between adjacent fields of view are calculated to generate field of view registration parameters.
[0065] In one implementation of this invention, a preset overlap rate parameter (e.g., 10%) of the microscopic imaging and the pixel resolution of a single field of view (e.g., width) are first read. Multiply by height Specifically, for horizontally adjacent left and right field-of-view images, the right edge region (with a width of...) of the left field-of-view image is cropped out. The left edge region of the right field of view and the right field of view (with the same width as above) are used as image patches to be matched. Scale-invariant feature transformation (SIN) or accelerated robust feature transformation (ARPE) algorithms are used to perform feature detection in grayscale space on these two image patches, extracting key points and their feature descriptor vectors. It is important to note that a nearest neighbor search algorithm (such as the Kd-tree algorithm) is used to calculate the Euclidean distance between the two feature descriptor sets. When the ratio of the nearest neighbor distance to the second nearest neighbor distance is less than a preset threshold (e.g., 0.7), the two feature points are considered a matching pair, thus generating an initial set of matching point pairs.
[0066] In one implementation of this invention, the depth index map channel generated in step S3 is invoked. This channel stores the physical focal plane layer information corresponding to each pixel. Specifically, for each pair of matching points in the initial matching point pair set... ,in Located in the left field of view, Located in the right field of view, read their depth grayscale values in their respective depth index maps. and Through formula Calculate the depth deviation value. It should be noted that the preset depth continuity threshold is set based on the flatness tolerance of the slide (e.g., a grayscale value corresponding to a physical height difference of 2 micrometers), aiming to filter mismatches using the principle of fiber height continuity at the edges of adjacent fields of view. If the value exceeds the threshold, the matching pair is determined to be an object at a different height level (such as fiber and dust on the surface of a glass slide), even though the textures are similar. It is considered a false match and is removed from the set. The remaining point pairs constitute the set of valid matching point pairs.
[0067] In one implementation of this invention, the geometric transformation model is estimated using the point-pair coordinate data in the effective matching point-pair set and the Random Sample Consensus Algorithm (RANSAC). Specifically, the algorithm repeatedly selects a subset to calculate the affine transformation matrix or homography matrix, counts the number of interior points that conform to the matrix model, and selects the model with the most interior points as the optimal transformation matrix. For the optimal transformation matrix Perform mathematical decomposition to extract the translation along the X-axis. Translation along the Y-axis and rotation angle .
[0068] Preferably, step S4, which involves sequentially filling the pre-set panoramic canvas with the aligned sharp unit images of each field of view focal plane, further includes: Based on the field of view registration parameters, the focal plane sharp unit images of adjacent fields of view are mapped to a unified coordinate system. The absolute value of the gray level difference of corresponding pixels in the overlapping area is calculated as the texture difference value, and the absolute value of the depth gray level difference of corresponding pixels is calculated as the depth difference value. The texture difference value and the depth difference value are weighted and summed to generate a fusion cost map. Search for a connected path in the fusion cost graph that runs through the overlapping region and has the minimum cumulative pixel cost value, and mark it as the optimal stitching line.
[0069] In one implementation of this invention, the field registration parameters (including translation) generated in the previous step are first read. and rotation angle Specifically, using the coordinate system of the left field of view image as a reference, the right field of view image is geometrically transformed using an affine transformation matrix to align it with the left field of view image on the virtual canvas, thereby determining the pixel range of the overlapping area (e.g., width of...). The height is For each pixel within the overlapping region Extract the grayscale value of the left field of view image at that point. and depth channel grayscale value And the grayscale value of the transformed right field of view at that point. and depth channel grayscale value Using the formula Calculate texture difference values using the formula Calculate the depth difference value.
[0070] In one implementation of this invention, a preset texture weight coefficient is read. and depth weighting coefficient These two coefficients usually satisfy (For example Take 0.6, (Take 0.4). Specifically, perform a weighted summation operation on each pixel within the overlapping region, calculated using the following formula: The calculated cost It is stored in a two-dimensional matrix with the same size as the overlapping region, which is the fusion cost map.
[0071] In one implementation of this invention, a dynamic programming algorithm is used to find the optimal path in the fusion cost graph. Specifically, assuming the overlapping regions are horizontally stitched together, a cumulative energy matrix is established. The first row of the fusion cost graph is directly assigned to The first row, starting from the second row, for each pixel Calculate its own cost value The sum of the minimum cumulative energy values of the three positions adjacent to the previous row (top left, top right, top right), i.e. The calculation proceeds line by line until the last line. The pixel with the smallest accumulated energy value is found in the last line as the endpoint. The path pointer is then used to backtrack to the first line, forming a connected pixel path.
[0072] Preferably, step S4, which involves sequentially filling the pre-defined panoramic canvas with the aligned sharp unit images of each field of view focal plane, includes: A feathered region is formed by expanding a preset feather width to both sides of the optimal seam line. The vertical distance from each pixel within the feathered region to the optimal seam line is calculated and normalized into a blend weight. The corresponding pixels in the sharp focal plane unit images of adjacent fields of view are linearly weighted and mixed according to the mixing weight to generate a smooth transition band; The absolute coordinates of each field of view in the preset panoramic canvas are calculated based on the field of view registration parameters of all fields of view. The sharp focal plane unit images of each field of view are then filled into the preset panoramic canvas according to their absolute coordinates. The original pixel values of the overlapping areas are replaced with smooth transition bands. After cropping the incomplete areas at the edge of the panoramic canvas, the target fiber composition image is obtained.
[0073] In one implementation of this invention, the feathering width parameter is first read. This parameter defines half the width of the transition band in the image fusion. Specifically, it iterates through each pixel along the optimal stitching line. Using this point as the center, extend horizontally to the left and right by a distance to define the extent of the feathering area. For any pixel within this region Calculate its distance from the center point of the suture line. horizontal distance Subsequently, the linear normalization formula was used. Calculate the mixed weights It should be noted that when the pixel is located on the left edge of the stitching line... At that time, weight =0; when located at the right edge of the suture line At that time, weight =1; when located at the center of the suture line At that time, weight With a weight of 0.5, this weighting method ensures a smooth transition from the left field of view to the right field of view.
[0074] In one implementation of this invention, a color blending operation is performed on each pixel location within the feathered region. Specifically, the pixel value of the left field-of-view image at that location is extracted. And the pixel value of the right field of view image at this location Using the mixed formula Calculate the merged pixel values It should be noted that this operation is performed independently for the red, green, and blue color channels, and the calculation results are written to a temporary transition zone image buffer.
[0075] In one implementation of this invention, the top-left corner vertex of the first scanning field of view is taken as the origin of the panoramic canvas coordinates. Specifically, following the scanning order, the field registration parameters (translation amounts) between adjacent fields of view are accumulated. ), calculate the first The absolute coordinates of each field of view on the panoramic canvas For example, the absolute coordinates of the second field of view are... The absolute coordinates of the third field of view are Based on the calculated absolute coordinates, the sharp focal plane unit images of each field of view are copied to the corresponding positions on the panoramic canvas. In the overlapping areas of adjacent fields of view, the original overlapping pixels are covered with the smooth transition zone image generated in the previous step. It should be noted that after filling all fields of view, an edge detection algorithm is used to scan the perimeter of the panoramic canvas, identifying the largest inscribed rectangular region containing valid pixels. A cropping operation is then performed to remove jagged blank or invalid areas at the edges, ultimately outputting a complete rectangular, high-resolution image of the target fiber composition.
[0076] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.
[0077] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A method for acquiring fiber composition images based on multi-field-of-view and multi-focal-plane automatic scanning, characterized in that, Includes the following steps: Step S1: Perform image pre-scanning on the fiber scan sample to obtain a preview image; Multi-field fiber spatial feature analysis is performed on the preview image to obtain the fiber coverage and stacking height of each field of view; the stacking state of each field of view is evaluated based on the fiber coverage and stacking height, thereby constructing an adaptive acquisition strategy; Step S2: Perform multi-field and multi-focal plane image acquisition on the fiber scanning sample based on the adaptive acquisition strategy to obtain multi-focal layer image data corresponding to each field of view; Step S3: Calculate the sharpness feature value layer by layer for the multi-focal layer image data of the same field of view, and select the layer number with the largest sharpness feature value at each pixel position in the multi-focal layer image data as the index of the maximum response layer; Pixel values are extracted from multi-focal layer image data based on the maximum response layer index to reconstruct the image of the sharp focal plane unit; Step S4: Extract the overlapping regions in the focal plane sharp unit images of adjacent fields of view, spatially align the focal plane sharp unit images of adjacent fields of view based on the overlapping regions, and sequentially fill the aligned focal plane sharp unit images of each field of view into the preset panoramic canvas to generate the target fiber composition image.
2. The fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning according to claim 1, characterized in that, Step S1 includes the following steps: Step S11: Construct a scanning space coordinate system based on the fiber scanning sample; Step S12: Divide the fiber scanning sample into grid field units according to the preset coarse scanning grid spacing, and calculate the X-axis coordinates and Y-axis coordinates of the center point of each grid field unit in the scanning space coordinate system to form a list of pre-scanning field center coordinates; Step S13: Perform image pre-scanning on the fiber scan sample based on the pre-scan field center coordinate list, and acquire preview images of different focal planes of the grid field unit in the Z-axis direction; Step S14: Perform field-of-view fiber spatial feature analysis on the preview image to obtain the reference focal plane height, stacking height and fiber coverage of the field of view corresponding to the grid field of view unit.
3. The fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning according to claim 2, characterized in that, Field-of-view fiber spatial feature analysis of the preview image includes: The sharpness evaluation value of each preview image is obtained by summing the absolute values of the grayscale differences between adjacent pixels in each preview image. The sharpness evaluation values of each preview image are sorted in descending order. The sharpness evaluation value at the top of the sorted values is selected as the peak sharpness. The preview image corresponding to the peak sharpness and its corresponding Z-axis position are recorded as the reference focal plane height of the field of view. Calculate the product of peak sharpness and a preset scaling factor to obtain the lower limit threshold for sharpness; The difference between the maximum and minimum Z-axis position values of preview images whose sharpness evaluation values are greater than the lower threshold of sharpness is used as the stacking height of the field of view. Binarize and segment the preview image corresponding to the reference focal plane height to obtain a binary segmented image; The fiber coverage of the field of view is obtained by calculating the ratio of the number of fiber foreground pixels in the binary segmented image to the total number of pixels in the preview image.
4. The fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning according to claim 2, characterized in that, Step S1 involves evaluating the stacking status of each field of view based on fiber coverage and stacking height, thereby constructing an adaptive acquisition strategy, including: The fiber coverage of the grid field of view unit is compared with a preset coverage threshold. Grid field of view units with fiber coverage less than the preset coverage threshold are marked as single-layer areas, and grid field of view units with fiber coverage greater than or equal to the preset coverage threshold are marked as stacked areas, generating a region type identifier. Traverse the region type identifiers corresponding to the grid field of view units, check whether the region type identifiers of the current grid field of view unit and its adjacent grid field of view units are consistent, and merge the grid field of view units with the same region type identifiers and spatially adjacent into connected regions. Plane fitting is performed on the reference focal plane height of all grid field units within the connected region to obtain the tilted reference plane of each connected region, and the tilted reference plane is used as the Z-axis scanning zero reference for all fields within the region. For connected regions identified as single-layer regions, the basic layer scan range and sparse step size centered on the inclined reference plane are set to generate single-layer acquisition parameters. For connected regions identified as stacked regions, the extended layer scan range is set based on the maximum stacking height of each grid field of view unit within the connected region, and a dense step size is set to generate stacked acquisition parameters.
5. The fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning according to claim 4, characterized in that, Step S1, which evaluates the stacking state of each field of view based on fiber coverage and stacking height to construct an adaptive acquisition strategy, also includes: Obtain the spatial distribution topology of connected regions; The field of view acquisition sequence is planned based on the spatial distribution topology, and the connection order between regions is determined according to the shortest distance between connected regions to generate the field of view acquisition sequence. The center coordinates of each grid field of view unit in the field of view acquisition sequence and the single-layer acquisition parameters or stacked acquisition parameters corresponding to their respective connected regions are encapsulated to construct an adaptive acquisition strategy containing differentiated automatic scanning control commands.
6. The fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning according to claim 1, characterized in that, Step S3 includes the following steps: Step S31: Perform Laplacian convolution operation on each layer of the same field of view in the multi-focal layer image data, calculate the gradient magnitude at each pixel position, and generate a gradient evaluation map sequence for the field of view; Step S32: Traverse all gradient response values at the same pixel position in the gradient evaluation map sequence, filter the layer number corresponding to the maximum gradient magnitude, and generate the maximum response layer index; Step S33: Based on the layer number recorded at each pixel position in the maximum response layer index, index and extract the RGB pixel values at the corresponding positions from the multi-focal layer image data, and reconstruct them to generate a full-focal surface texture map; Step S34: Normalize the depth grayscale value of the maximum response layer index to construct a depth index map, and attach it as an independent data channel to the full focal plane texture map to synthesize a focal plane sharp unit image containing texture information and depth information.
7. The fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning according to claim 6, characterized in that, Before synthesizing a focal plane sharpness unit image containing texture and depth information, the following steps are also included: Calculate the variance of the layer number of each pixel position in the maximum response layer index within a preset neighborhood window, mark the pixel positions with variance values greater than a preset variance threshold as outliers, and generate an outlier mask. The proportion of outliers in the outlier mask is calculated to obtain the outlier percentage value. Determine whether the proportion of outliers is greater than the preset correction trigger threshold. If the proportion of outliers is greater than the correction trigger threshold, then perform median filtering and mode filtering on the maximum response layer index in sequence to eliminate isolated layer number jump points and fill small-range layer number holes to generate a smooth layer index. The position of the pixel to be corrected in the smoothing layer index is located based on the outlier mask. The position of the pixel to be corrected is rounded and padded by the distance-weighted average of the effective pixel layer indices in the neighborhood to generate the correction layer index. Based on the layer number recorded in the correction layer index, the RGB pixel values of the corresponding layer are re-extracted from the multi-focal layer image data to correct the full focal plane texture map, and the correction layer index is updated to the data channel to output the optimized focal plane sharp unit image. If the proportion of outliers is less than or equal to the correction trigger threshold, the image of the sharp focal plane unit will not be optimized.
8. The fiber composition image acquisition method based on multi-field-of-view and multi-focal plane automatic scanning according to claim 6, characterized in that, Step S4 involves extracting overlapping regions in the focal plane sharpness unit images of adjacent fields of view. Before spatially aligning the focal plane sharpness unit images of adjacent fields of view based on the overlapping regions, the process includes: Image patches corresponding to overlapping regions are cropped from the sharp focal plane unit images of adjacent fields of view. Feature points are extracted from the two image patches and similarity matching is performed to generate an initial set of matching point pairs. Obtain the depth grayscale value corresponding to each matching point in the initial matching point pair set, calculate the depth deviation value of the two ends in the same matching point pair, remove the matching point pairs whose depth deviation value is greater than the preset depth continuity threshold, and generate a valid matching point pair set; Based on the coordinate position relationship of each matching point pair in the effective matching point pair set, the translation and rotation angle between adjacent fields of view are calculated to generate field of view registration parameters.
9. The fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning according to claim 8, characterized in that, Step S4, which involves sequentially filling the pre-set panoramic canvas with the aligned sharp unit images of each field of view focal plane, also includes: Based on the field of view registration parameters, the focal plane sharp unit images of adjacent fields of view are mapped to a unified coordinate system. The absolute value of the gray level difference of corresponding pixels in the overlapping area is calculated as the texture difference value, and the absolute value of the depth gray level difference of corresponding pixels is calculated as the degree difference value. The texture difference value and the depth difference value are weighted and summed to generate a fusion cost map. Search for a connected path in the fusion cost graph that runs through the overlapping region and has the minimum cumulative pixel cost value, and mark it as the optimal stitching line.
10. The fiber composition image acquisition method based on multi-field-of-view and multi-focal-plane automatic scanning according to claim 9, characterized in that, Step S4 involves sequentially filling the pre-set panoramic canvas with the aligned sharp unit images of each field of view focal plane, including: A feathered region is formed by expanding a preset feather width to both sides of the optimal seam line. The vertical distance from each pixel within the feathered region to the optimal seam line is calculated and normalized into a blend weight. The corresponding pixels in the sharp focal plane unit images of adjacent fields of view are linearly weighted and mixed according to the mixing weight to generate a smooth transition band; The absolute coordinates of each field of view in the preset panoramic canvas are calculated based on the field of view registration parameters of all fields of view. The sharp focal plane unit images of each field of view are then filled into the preset panoramic canvas according to their absolute coordinates. The original pixel values of the overlapping areas are replaced with smooth transition bands. After cropping the incomplete areas at the edge of the panoramic canvas, the target fiber composition image is obtained.
Citation Information
Patent Citations
Shooting device for fiber component analysis
CN223259959U
Method and device for automatically detecting fiber content in textiles based on digital images
CN107860933A
A method for image fusion of multifocal plane of nonwovens
CN109345493A
Depth information guided multi-focal-plane microscopic imaging method and device and medium
CN121509829A
Method and apparatus for z-stack acquisition for microscopic slide scanner
US20210149170A1