Dynamic window-based microscopic image particle analysis method and system
By introducing dynamic windows and mapping mechanisms, combined with mouse interaction events, the problem of inaccurate sampling area marking in existing technologies has been solved, achieving high accuracy and efficiency in microscopic image particle analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-19
AI Technical Summary
Existing microscopic image particle analysis methods cannot guarantee the accuracy of the marking of the sampling area, resulting in low accuracy of particle line segments, and they also ignore the overall consideration of the dynamic window.
A microscopic image particle analysis method based on dynamic window is adopted. By introducing dynamic window and forward and reverse mapping to mark the sampling area, combined with mouse interaction event-triggered traversal mechanism and deletion event, the accuracy of sampling area and particle line segment is ensured.
It improves the accuracy of labeling in the sampling area and the precision of particle segments, ensuring the accuracy and efficiency of particle analysis and avoiding data errors caused by overlapping and nested areas.
Smart Images

Figure CN122066754A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of microscopic images, and more particularly to a method and system for particle analysis of microscopic images based on a dynamic window. Background Technology
[0002] With the development of technology, scanning electron microscopy (SEM) and transmission electron microscopy (TEM) have become core tools for characterizing microscopic morphology in fields such as materials science, nanotechnology, and biomedicine. By quantitatively analyzing the size distribution, shape characteristics (such as roundness and aspect ratio), and distribution density of particles in microscopic images, researchers can accurately evaluate the physicochemical properties of materials.
[0003] In existing technologies, the commonly used technique is manual analysis based on traditional digital image processing software. Users manually select scale line segments on the image and input the corresponding physical length values to establish the conversion relationship between pixel distance and actual physical length. The image is then preprocessed with operations such as grayscale conversion and filtering to remove noise. Users manually set the binarization threshold based on visual experience to convert the image into a black and white image. The particle contour recognition method based on connected component analysis ignores the overall consideration of the sampling area and dynamic window, which cannot guarantee the accuracy of the sampling area marking, resulting in low accuracy of particle line segments. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art. This invention provides a particle analysis method and system based on a dynamic window microscopic image.
[0005] This invention provides a particle analysis method for microscopic images based on a dynamic window, comprising: Acquire microscopic images and output the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale. Also, determine the corresponding sampling area based on the division of the microscopic image. A dynamic window is introduced for the sampling region, and the labeling of the sampling region is coordinated based on forward mapping and reverse mapping so as to present the corresponding label in the sampling region; When the user completes the drawing of the new sampling area through the mouse release event, the traversal mechanism is triggered to check the spatial relationship between the new sampling area and all existing sampling areas, and to maintain the isolation relationship between the new sampling area and all existing sampling areas. The corresponding deletion and marking events are determined based on the operation of the new sampling area. The deletion event presents the unified deletion of all particle marking data within the coordinate range of the new sampling area. In the marking event, the start and end points of the particle line segments fall completely within the new sampling area, and the corresponding diameter length is greater than the minimum diameter threshold.
[0006] This invention provides a particle analysis system for silicon wafer microscopic images based on a dynamic window. This system is applied to the aforementioned particle analysis method based on dynamic window microscopic images. The system includes: The sampling area module is used to acquire microscopic images and output the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale. It also determines the corresponding sampling area based on the division of the microscopic image. The dynamic window module introduces a dynamic window to the sampling area, based on forward and reverse mapping to coordinate the labeling of the sampling area, so as to present the corresponding label in the sampling area; The new sampling region module is used to trigger a traversal mechanism after the user completes the drawing of the new sampling region through the mouse release event. This mechanism checks the spatial relationship between the new sampling region and all existing sampling regions and maintains the isolation relationship between the new sampling region and all existing sampling regions. The marking module is used to determine the corresponding deletion and marking events based on the operation of the new sampling area. The deletion event presents the unified deletion of all particle marking data within the coordinate range of the new sampling area. In the marking event, the start and end points of the particle line segments fall completely within the new sampling area, and the corresponding diameter length is greater than the minimum diameter threshold.
[0007] Compared with the prior art, the beneficial effects of the present invention are: (1) Acquire microscopic images and output the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale. Also, determine the corresponding sampling area based on the division of the microscopic image. A dynamic window is introduced for the sampling area. Based on the labeling of the sampling area through forward mapping and reverse mapping, the corresponding label is presented in the sampling area. The sampling area is introduced and combined with the sampling area and the dynamic window to control the forward mapping and reverse mapping, thereby improving the accuracy of the labeling of the sampling area.
[0008] (2) When the user completes the drawing of the new sampling area through the mouse release event, the traversal mechanism is triggered to check the spatial relationship between the new sampling area and all existing sampling areas, and maintain the isolation relationship between the new sampling area and all existing sampling areas. Based on the operation of the new sampling area, the corresponding deletion event and marking event are determined. In the deletion event, the unified deletion of all particle marking data within the coordinate range of the new sampling area is presented. In the marking event, the start and end points of the particle line segments fall completely into the new sampling area, and based on the corresponding diameter length being greater than the minimum diameter threshold, the new sampling area and all existing sampling areas are controlled, thus realizing the particle deletion event and marking event, so as to perform multi-level analysis of particles and ensure the accuracy of particle line segments. Attached Figure Description
[0009] Figure 1 This is a schematic flowchart of a particle analysis method based on a dynamic window micrograph in an embodiment of the present invention. Figure 2 This is a flowchart illustrating step S11 in the particle analysis method based on a dynamic window micrograph in this embodiment of the invention. Figure 3 This is a flowchart illustrating step S12 in the particle analysis method based on a dynamic window micrograph in an embodiment of the present invention. Figure 4 This is a flowchart illustrating step S13 in the particle analysis method based on a dynamic window micrograph in this embodiment of the invention. Figure 5 This is a flowchart illustrating step S14 in the particle analysis method based on a dynamic window micrograph in this embodiment of the invention. Figure 6 This is a schematic diagram of the structural composition of a particle analysis system for silicon wafer microscopic images based on a dynamic window, according to an embodiment of the present invention. Figure 7 This is a schematic diagram of the architecture of the particle analysis method for silicon wafer microscopic images based on dynamic windows in an embodiment of the present invention. Figure 8 This is an interactive schematic diagram of the particle analysis method for silicon wafer microscopic images based on dynamic windows in an embodiment of the present invention. Detailed Implementation
[0010] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0011] Please see Figures 1 to 5 A particle analysis method for microscopic images based on a dynamic viewport is applied to microscopic image scenarios. The particle analysis method for microscopic images based on a dynamic viewport includes: Step S11: Acquire a microscopic image, and output the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale, and determine the corresponding sampling area based on the division of the microscopic image. Step S12: A dynamic window is introduced for the sampling area, and the labeling of the sampling area is coordinated based on forward mapping and reverse mapping to present the corresponding label in the sampling area; Step S13: After the user completes the drawing of the new sampling area through the mouse release event, the traversal mechanism is triggered to check the spatial relationship between the new sampling area and all existing sampling areas, and to maintain the isolation relationship between the new sampling area and all existing sampling areas. Step S14: Determine the corresponding deletion event and marking event based on the operation of the new sampling area. The deletion event presents the unified deletion of all particle marking data within the coordinate range of the new sampling area. In the marking event, the start and end points of the particle line segments fall completely within the new sampling area, and the corresponding diameter length is greater than the minimum diameter threshold.
[0012] refer to Figure 2 In step S11, the specific steps are as follows: S111: Obtain the corresponding microscopic image based on the image input module. The format of the microscopic image is BMP, PNG, JPG, JPEG, TIF or TIFF. At the same time, determine the corresponding image scale based on the detection of the microscopic image database, and trigger the combination of the microscopic image and the corresponding image scale to output the correspondence between physical length and pixel length. S112: Based on the imported microscopic images and the configured image scale, further draw, view, or delete the sampling area, which is the specific operating space for particle labeling and analysis; and serves as a specific area of interest to the user.
[0013] In the embodiments of this application, a corresponding microscopic image is obtained based on the image input module. The format of the microscopic image is BMP, PNG, JPG, JPEG, TIF, or TIFF. At the same time, the corresponding image scale is determined based on the detection of the microscopic image database, and the combination of the microscopic image and the corresponding image scale is triggered to output the correspondence between physical length and pixel length. This approach is compatible with the overall consideration of the detection of the microscopic image database and ensures the accuracy of the corresponding image scale.
[0014] At this point, the system calls the underlying image decoding interface through the image input module to achieve compatible reading of various common industrial and image formats such as BMP, PNG, JPG, JPEG, TIF, and TIFF. Meanwhile, the system kernel integrates a Unicode path parsing method, which can correctly identify and process file paths containing Chinese characters, special symbols, or non-ASCII encoding, ensuring that image data under different operating systems and file naming conventions can be stably loaded into the memory buffer.
[0015] The system automatically retrieves or assists users in determining the imaging scale parameters corresponding to an image by accessing a microscopic image database or reading the metadata header of an image file. This process linearly correlates the digital discrete signal (pixel) of the image with a continuous physical quantity (length) in the real world. The system generates a global conversion coefficient by calculating the ratio of physical length to pixel length, thereby completing the mapping transformation from screen pixel coordinates to physical geometric coordinates and providing a measurement benchmark for subsequent particle size calculations.
[0016] Specifically, the user obtained a high-resolution sample image using a scanning electron microscope (SEM); the user imported the microscopic image file, saved in TIFF format, into the system, and the file path contained Chinese characters; the system successfully located and read the file using Unicode path parsing technology, and loaded the image data completely into the video memory.
[0017] The system identifies the scale data from the scale markings at the bottom of the image, or the user can manually input the scale value based on the electron microscope imaging parameters. In this scenario, the scale line segment at the bottom of the image is known to represent "500nm" and occupy "200 pixels" on the image. Based on this, the system calculates and outputs the correspondence between physical length and pixel length, thus establishing a conversion factor of "2.5nm / pixel". The establishment of this benchmark allows any particle diameter subsequently marked on the image to be accurately converted into the actual physical size at the nanometer level based on this factor.
[0018] Furthermore, based on the imported microscopic images and the configured image scale, the sampling area can be further drawn, viewed, or deleted. The sampling area is the specific operational space for particle labeling and analysis; and as a specific region of interest to the user, a specific region of interest is introduced.
[0019] At this point, the system provides a mouse-based drawing tool that allows users to freely draw sampling areas on a pre-loaded and calibrated microscopic image canvas. When the user presses the mouse and drags, the system calculates and renders a rectangular or arbitrary polygonal visual frame in real time. This process captures the user's input trajectory on the screen and converts it into geometric coordinates in the image matrix in real time (such as the coordinates of the top left and bottom right corners of the rectangle). This interactive process is implemented through the view control module, ensuring the smoothness and intuitiveness of the area drawing.
[0020] The sampling region management module stores the geometric coordinates drawn and confirmed by the user as independent region objects. The system maintains a list of sampling regions in memory, recording the unique identifier and spatial extent of each region. These regions are defined as "effective fields of view," meaning that the system will only accept subsequent particle marking operations within the limited coordinate range. At the same time, users can view the distribution of all currently defined regions at any time, or delete regions that are no longer needed according to experimental analysis requirements. The system will update the region list in memory in real time to ensure the dynamic controllability of the analysis range.
[0021] Specifically, after completing the image loading and scale calibration (determining the conversion coefficient of 2.5nm / pixel) in sub-step S111, the user identifies the central region of the catalyst support in the image view. By interacting with the mouse, the user presses and drags at the center of the image to draw a rectangle covering the central region. The system captures this operation in real time and generates the coordinate data of the region (for example, set as region ROI_1, with a coordinate range of [1000,1000,3000,3000]). For comparative analysis, the user draws a second rectangle on the edge of the image (set as region ROI_2).
[0022] The two calibrated sampling frames are clearly displayed on the screen. These frames logically lock the valid boundaries of the particle markers, meaning that subsequent particle diameter measurements will only be recognized as valid data if the marker line segment is completely inside these two frames. If the user finds that the ROI_2 in the edge region no longer meets the analysis requirements, it can be deleted through the management module. The system will immediately clear the data in that region, ensuring that subsequent particle statistics are based only on the valid central region ROI_1. This flexible region management mechanism ensures the relevance and effectiveness of the analysis for specific microstructures.
[0023] refer to Figure 3 In step S12, the specific steps are as follows: S121: When the sampling areas are in a non-overlapping state, three key parameters are introduced: global scaling factor, canvas offset, and local magnification window offset. The mapping relationship of the corresponding dynamic window is constructed in combination with each sampling area. The mapping relationship of the dynamic window presents forward mapping, local magnification and reverse mapping. S122: In forward mapping, the rendering of the sampling area is monitored in real time, and it is determined whether the pixel is located within the local magnification window. If the pixel is located within the local magnification window, coordinate transformation is performed. In local magnification, when a sampling area is double-clicked to enter local magnification mode, the system does not perform full-image rendering, but instead slices a sub-matrix based on the coordinate range of the sampling area for rendering. In reverse mapping, when the screen is clicked in local magnification mode, coordinate inverse calculation is performed, and the starting coordinate offset of the local magnification window is accumulated to ensure that the marker point accurately falls back to the original pixel grid.
[0024] In the embodiments of this application, when the sampling areas are in a non-overlapping state, three key parameters are introduced: global scaling factor, canvas offset, and local magnification window offset. The mapping relationship of the corresponding dynamic window is constructed in combination with each sampling area. The mapping relationship of the dynamic window presents forward mapping, local magnification, and reverse mapping.
[0025] At this point, the system introduces three key parameters to construct a mathematical mapping model for the dynamic viewport: global scaling factor, canvas offset, and local magnification window offset. Among them, the local magnification window offset is a core feature parameter used to identify the starting coordinate offset of the current local viewport in the original high-resolution image matrix. This model strictly binds the canvas coordinate system displayed on the screen with the physical coordinate system of the original image.
[0026] By introducing three key parameters—global scaling factor, canvas offset, and local magnification window offset—a unified coordinate system transformation framework supporting multi-level scaling, translation, and local fine-grained operations is constructed. This model establishes a strict topological correspondence between the screen display canvas coordinate system and the original high-resolution image physical coordinate system, which is the mathematical basis for achieving pixel-level accurate labeling.
[0027] The global scaling factor is a dimensionless scaling factor used to describe the overall scaling ratio of the original image data on the screen canvas. This parameter is defined as the ratio between the screen pixel units and the original image pixel units. When the user is not in local zoom mode, this factor controls the display size of the entire image (e.g., 1:1 or 1:2). When the user enters local zoom mode, this factor dynamically switches to a higher magnification ratio (e.g., 5:1 or 10:1). It is a scaling multiplier in coordinate mapping, determining the projected length of the physical length on the screen.
[0028] Canvas offset is a two-dimensional vector parameter used to describe the translation distance of the original image's coordinate origin relative to the top-left corner of the visible area of the screen canvas. This parameter reflects the translation operation performed by the user on the image. By introducing canvas offset, the model can handle cases where the image center is not in the center of the screen. It ensures that even if the image is dragged to the edge of the screen, the system can still calculate the original image coordinates corresponding to any point on the screen. In forward mapping (rendering), it is used to calculate the starting drawing position of the image on the screen; in reverse mapping (interaction), it is the additive component that restores the true coordinates.
[0029] The local zoom-in window offset is the most crucial feature parameter in this model. It is a coordinate pair used to identify the absolute position of the top-left corner of the current local view (i.e., the rectangular area the user double-clicks to zoom in) within the original high-resolution image matrix. In traditional image processing, zooming is often based on the screen center or simple image stretching, which can easily lead to the loss of coordinate reference. This parameter explicitly records the "anchor point" of the local view in the original large image. When the system performs matrix slicing-based rendering, it reads a specific range of pixel matrices from this offset to the right and downwards, forming the unique data source for the current screen display. In reverse mapping, this parameter is added to the screen relative coordinates as a correction term. Without this offset, the zoomed-in screen coordinates would be incorrectly mapped back to the top area of the original image, resulting in severe physical position drift. The above three parameters together construct a bidirectional transformation channel from the screen coordinate system (Xscreen, Yscreen) to the original image physical coordinate system (Ximg, Yimg).
[0030] Specifically, the user has drawn non-overlapping central region ROI_1 and edge region ROI_2 on the SEM image of the nanocatalyst; in order to accurately measure the extremely small nanoparticles (approximately 5-10 nm in diameter), the system constructs a dynamic mapping model; assuming the current screen's global scaling factor is 1.0 and the canvas has no offset; when the user double-clicks "central region ROI_1" to enter the local zoom-in mode, the system records the starting position of this region in the original image, for example, (1000, 1000), and sets it as the local zoom-in window offset.
[0031] Instead of rendering the full 4096×4090 image, the system extracts the original pixel submatrix corresponding to the region starting from coordinates (1000, 1000) and magnifies it for display, clearly showing the highly magnified nanoparticle structure on the screen. When the user clicks to mark the starting point of a particle at coordinates (500, 500) in the magnified view, the system performs a reverse calculation. The formula divides the screen coordinates (500, 500) by the magnification (assuming it is 5 times) to obtain the local relative coordinates (100, 100). The system adds the previously recorded local magnification window offset (1000, 1000) and finally calculates the true physical location of the point in the original large image as (1100, 1100). This precise mapping ensures that every mark made in the highly magnified view accurately corresponds to the true physical location of the original sample, achieving pixel-level measurement accuracy.
[0032] Furthermore, in forward mapping, the rendering of the sampling area is monitored in real time, and it is determined whether the pixel is located within the local magnification window. If the pixel is located within the local magnification window, coordinate transformation is performed. In local magnification, when a sampling area is double-clicked to enter local magnification mode, the system does not perform full-image rendering, but instead slices a sub-matrix based on the coordinate range of the sampling area for rendering. In reverse mapping, when the screen is clicked in local magnification mode, coordinate inverse calculation is performed, and the starting coordinate offset of the local magnification window is accumulated to ensure that the marker point accurately falls back to the original pixel grid. This ensures that the marker point accurately falls back to the original pixel grid. At the same time, a sampling area is introduced, and combined with the sampling area and dynamic window, forward and reverse mapping are controlled, improving the accuracy of the sampling area markers and further realizing seamless and accurate mapping between the local magnified view and the original high-resolution image coordinate system. A dynamic coordinate bidirectional mapping mechanism supporting multi-level zoom windows is constructed. The coordinate inverse calculation formula of "local magnification window offset compensation" solves the coordinate drift problem when switching between thumbnail view and magnified view.
[0033] At this time, the system monitors the display status of the sampling area in real time in the graphics rendering pipeline; during the forward mapping process, the system traverses the pixels to be rendered and uses the geometric boundaries of the local magnification window to determine spatial inclusion; if it is determined that a pixel is within the coordinate range of the local magnification window, the system starts the coordinate transformation mode to convert the original image coordinates of the point into screen canvas coordinates based on the global scaling factor and window offset, thereby achieving the correct display of the view.
[0034] When a user triggers a local zoom-in interaction (such as double-clicking a sampling area), the system abandons the traditional full-image redraw or simple image interpolation and stretching methods. Instead, the system directly slices the original high-resolution image matrix based on the coordinate range [x1:x2,y1:y2] of the sampling area in the original image. The system only extracts and renders the sub-matrix data within this specific coordinate range. This hardware-friendly matrix slicing rendering method not only avoids the performance overhead caused by loading full-image data, but also ensures the clarity and realism of image details at extremely high magnification.
[0035] To enable accurate marking in a magnified view, the system triggers a reverse mapping calculation upon receiving a mouse click signal. The system establishes a coordinate inverse calculation formula with offset compensation to restore the interactive coordinates on the screen to the physical coordinates of the original image. During the reverse calculation, the system not only considers the current magnification but, more importantly, must accumulate the "initial coordinate offset of the local magnified window in the original image." By explicitly introducing this offset vector into the calculation logic, the system can eliminate coordinate deviations caused by view transformations, ensuring that the marker points accurately fall back to the original pixel grid at any zoom level.
[0036] Specifically, users need to perform precise particle size measurements on the nanocatalyst particles, and conduct forward mapping and rendering monitoring; in the microscopic image displayed on the screen, the system continuously monitors the rendering pipeline in the background; when the view is in a local zoom-in state, the system calculates each display pixel on the current canvas and determines whether it belongs to the currently active local zoom-in window; for pixels belonging to the window, the system applies coordinate transformation logic to map them from the coordinate space of the original image to the display space of the screen, ensuring that the image is correctly presented in the specified area in front of the user.
[0037] Perform local zoom-in based on matrix slicing; the user double-clicks the previously defined "center region ROI_1" to observe details; the system responds immediately to this event, without performing time-consuming and memory-intensive full-image rendering, but directly slices the rectangular region from the original image data based on the coordinate range of ROI_1 in the original large image (e.g., horizontal coordinate 1000 to 3000, vertical coordinate 1000 to 3000); the system only performs high-magnification rendering on the sliced sub-matrix, which makes the screen instantly filled with clear nano-particle details, and the operation is extremely smooth.
[0038] A reverse mapping with offset compensation is implemented. In the magnified view, the user moves the cursor to the edge of a nanoparticle and presses the mouse to mark it. At this time, the cursor coordinates on the screen are assumed to be (200, 200). The system triggers the reverse mapping, divides the screen coordinates by the current magnification (e.g., 5x), and obtains the local relative coordinates (40, 40). The system calls the "local magnification window starting coordinate offset" recorded in step S121 (i.e., the upper left corner coordinates of ROI_1, 1000, 1000) and adds it to the local relative coordinates. After calculation, the system obtains that the true physical coordinates of the marked point in the original 4096×4096 large image are (1040, 1040). This accurate coordinate reverse calculation ensures that no matter how the magnified view is moved or scaled, the marked data always accurately corresponds to the true physical position of the original sample, completely solving the coordinate drift problem under high magnification.
[0039] refer to Figure 4 In step S13, the specific steps are as follows: S131: After the user completes the drawing of the new sampling area through the mouse release event, the traversal mechanism is triggered; all existing sampling areas are traversed, and the following judgments are made for each area: the new sampling area and the currently traversed area are judged by the rectangle intersection method to determine whether there is a pixel intersection; if there is an intersection, it means that the two areas have collided; it is determined whether the new sampling area is completely contained in the currently traversed area, or whether the currently traversed area is completely contained in the new sampling area; if there is an inclusion relationship, it means that the two areas have a nested relationship. S132: If a collision is detected, prevent the creation of new sampling regions and prompt the user to redraw to ensure that there is no overlap between sampling regions; if an inclusion relationship is detected, perform warning processing, automatic adjustment processing, or retain the new sampling region according to specific needs.
[0040] In the embodiments of this application, after the user completes the drawing of a new sampling area through a mouse release event, a traversal mechanism is triggered; all existing sampling areas are traversed, and the following judgments are made for each area: whether there is a pixel intersection between the new sampling area and the currently traversed area using the rectangle intersection method; if there is an intersection, it means that the two areas have collided; whether the new sampling area is completely contained within the currently traversed area, or whether the currently traversed area is completely contained within the new sampling area; if there is an inclusion relationship, it means that the two areas have a nested relationship, thus introducing the explanation that the two areas have a nested relationship.
[0041] At this point, the system listens for user mouse interaction events. When it detects that the user has released the left mouse button to complete the drawing operation of the new sampling area (defined as ROI_New), it immediately interrupts the default creation process and triggers the traversal mechanism. The system searches the memory for all existing and effective sampling areas (defined as {ROI_Exist_1, ROI_Exist_2, ..., ROI_Exist_n}) and prepares to compare spatial relationships one by one.
[0042] During the traversal, the system performs collision detection logic for each existing sampling region ROI_Exist_i. The system extracts the geometric boundary coordinates of ROI_New and ROI_Exist_i (usually the coordinates of the upper left and lower right corners of the smallest bounding rectangle), and calculates the spatial relationship between the two using the rectangle intersection method. This method compares the maximum and minimum values of the boundary to determine whether the two rectangles have overlapping projection intervals in the X and Y axes. If a pixel-level intersection is detected, the system determines that the two regions have "collided", which means that if they coexist, it will lead to overlapping sampling spaces.
[0043] In addition to collision detection, the system further performs nesting relationship determination; the system calculates whether the boundary of ROI_New is completely within the boundary of ROI_Exist_i, and vice versa. This involves a strict determination of whether the coordinates of the four vertices of ROI_New all fall within the coordinate range of ROI_Exist_i. If a complete containment relationship exists, the system determines that the two regions have a "nesting relationship". Although this nesting relationship does not overlap geometrically (they are subsets of each other), it still belongs to a kind of spatial interference in logic and needs to be specially processed according to the preset strategy.
[0044] Specifically, during the analysis of SEM images of nanocatalysts, in order to compare the particle density of different deposition areas, the user attempts to draw a new "edge region ROI_New" given the existing "central region ROI_1". The moment the user draws the rectangle and releases the mouse, the system initiates a traversal mechanism and locks the existing "central region ROI_1" as the comparison object. Assume that the coordinate range of "central region ROI_1" is set to the horizontal coordinate [1000, 3000] and the vertical coordinate [1000, 3000].
[0045] Suppose the user's hand shakes, causing the newly drawn "ROI_New" coordinate range to be set to [2900, 4000] on the x-axis and [1500, 2500] on the y-axis. The system compares the coordinates of the two using a rectangle intersection method and finds that the left boundary (2900) of ROI_New is smaller than the right boundary (3000) of ROI_1, and they completely overlap in the y-axis range [1500, 2500]. The system determines that the two have an intersection on both the x-axis and y-axis, and immediately identifies that a "collision" has occurred, which means that the two regions have a partial area overlap, which will cause particles in the overlapping region to be counted repeatedly.
[0046] If the user redraws and completely places ROI_New inside ROI_1 (e.g., within the coordinate range [1200, 1800, 1200, 1800]), the system will determine that all the vertex coordinates of ROI_New fall within the range of ROI_1 when performing containment detection; the system will then identify that there is a "nesting relationship" between the two.
[0047] Furthermore, if a collision is detected, the creation of new sampling regions is prevented, and the user is prompted to redraw to ensure that there is no overlap between sampling regions; if an inclusion relationship is detected, warning processing, automatic adjustment processing, and retention of new sampling regions are introduced according to specific requirements.
[0048] At this point, when the system confirms that the new sampling area collides with any existing area (i.e., pixel intersection), it immediately executes the blocking logic; the system cancels the current drawing operation, prevents the creation of the new sampling area, and pops up a warning prompt through the user interface (UI). This prompt clearly informs the user of the existence of spatial conflict and forces the user to readjust the drawing range. This mechanism ensures from the underlying logic that the denominator (area) in the particle density calculation will not produce the error of repeated calculation due to area overlap, thus ensuring the validity of the statistical data.
[0049] For detected containment relationships (i.e., one region is completely inside another), the system provides flexible processing strategies to adapt to different needs: Warning handling: The system only issues warnings to users about spatial nesting, suggesting that users adjust the region range to avoid logical confusion, while still retaining the user's operational choice; Automatic adjustment: The system automatically performs geometric operations to spatially merge two regions (new and old regions) with containment relationships, generating a new region that can cover the coordinate range of both. This method eliminates the nesting structure, transforming it into a single effective analysis space and preventing data statistical chaos; Preservation of new regions and cascading cleanup: If the system determines that the new sampling region contains richer information or better meets the current experimental analysis needs, it performs the operation of preserving the new region and deleting the contained old region. This process usually triggers subsequent data cleanup mechanisms to automatically clean up invalid data associated with the old region, ensuring the consistency of the analysis data.
[0050] Specifically, in the SEM image analysis of nanocatalysts, a user attempts to draw a new edge region to statistically analyze particle distribution; a collision blocking scenario occurs; assuming the user accidentally drags the newly drawn "edge region" into the existing "center region," causing them to overlap in the X-axis coordinate range [2900, 3000]; after step S131 detects this collision, step S132 immediately responds: the system automatically cancels the previously drawn "edge region" and displays a prompt on the screen: "Region overlap, drawing has been canceled, please redraw." This forced measure effectively prevents catalyst particles in the overlapping area from being counted repeatedly, ensuring the accuracy of density calculation.
[0051] In scenarios involving containment relationships, suppose the user redraws the data, and the new region falls entirely within the "central region." The system detects this nested relationship, and processes it according to a preset strategy. If the current analysis aims to refine the data in the central region, the system may choose the "preserve new region" strategy: delete the original, larger "central region," retain this more refined new region, and automatically remove the hundreds of particle marker data associated with the old region to prevent them from becoming "zombie data" that interferes with the analysis. Alternatively, if the system is configured for automatic adjustment, it will perform a union operation on the coordinates of the two regions, merging them into a larger region that covers both, ensuring the continuity of the analysis operation. Through these specific processing strategies, the system can flexibly handle various complex drawing situations and maintain the rigor of the analysis logic.
[0052] refer to Figure 5 In step S14, the specific steps are as follows: S141: When a user selects to delete a sampling area, a deletion event is triggered. At this time, based on the coordinate range of the new sampling area, all marked particle segments are traversed, and it is determined whether each particle segment is located within the area. For particle segments located within the new sampling area, the system removes them from memory, thus achieving cascading deletion. S142: When the user draws a particle line segment in the new sampling area, a marking event is triggered to mark the coordinates of the two endpoints of the particle line segment and determine whether they fall completely within the new sampling area. If any endpoints are outside the area, the mark is discarded to avoid invalid data. The diameter of the particle line segment is determined according to the physical coordinate system and it is determined whether it is greater than the minimum diameter threshold. If it is less than the threshold, the mark is discarded to avoid noise-induced accidental touches. For particle line segments that pass the verification, their coordinate information is stored in memory and associated with their respective sampling areas.
[0053] In the embodiments of this application, when a user selects to delete a certain sampling area, a deletion event is triggered. At this time, based on the coordinate range of the new sampling area, all marked particle segments are traversed, and it is determined whether each particle segment is located in the area. For particle segments located in the new sampling area, the system removes them from memory, thereby realizing cascading deletion.
[0054] At this time, the system listens for user operation commands for the sampling area in real time; when the user issues a command to delete a specific sampling area (denoted as Rdelete), the system immediately captures the interaction signal and triggers the deletion event; at this time, the system locks the geometric properties of Rdelete and extracts its coordinate range data (such as the coordinates of the upper left and lower right corners of the rectangular area [x1,y1,x2,y2]) as the geometric boundary conditions for subsequent spatial queries.
[0055] Unlike the traditional cascading delete method that relies on database ID foreign key binding, this solution adopts a more flexible real-time spatial query mechanism. The system does not rely on the preset parent-child relationship index, but immediately traverses all marked particle segment datasets in memory. During the traversal, for each particle segment object, the system uses geometric containment to determine whether its spatial position is completely within the coordinate range of Rdelete. This process is achieved by comparing the coordinates of the endpoints of the particle segment with the coordinates of the region boundary.
[0056] Based on the above traversal and judgment results, the system identifies all target particle segments located within the Rdelete region. The system performs a memory cleanup operation to completely remove the identified particle segment data from the current memory data structure without the need for manual identification. This recursive operation based on spatial geometry judgment achieves the cascading deletion effect of "region deletion triggering automatic clearing of internal particle data", ensuring the integrity of the remaining data after the deletion operation.
[0057] Specifically, during the long-term analysis of the SEM images of the nanocatalyst, the user initially defined a sampling area called the "edge region" and manually marked the diameter segments of 50 nanocatalyst particles within it. Due to adjustments in the experimental protocol, the user decided not to analyze the edge region anymore, so the user selected the region in the software interface and clicked the "delete" button.
[0058] The system locks the coordinate range of the "edge region", assuming it is [3000, 3000, 4000, 4000]. The system starts a traversal mechanism to check all the particle segment data saved in memory one by one. When traversing to the 50 previously marked particle segments, the system calculates their endpoint coordinates and finds that these coordinates are all within the interval [3000, 3000, 4000, 4000], that is, it determines that these particles belong to the region to be deleted.
[0059] Based on this determination, the system automatically performs a memory cleanup operation, instantly removing the data of these 50 particle segments from the system. The entire process does not require the user to manually find and delete these 50 data points, greatly improving operational efficiency and completely eliminating "zombie data" left over from area deletion, ensuring the purity and accuracy of subsequent particle statistics based on the remaining area (such as the "central area").
[0060] Furthermore, when a user draws a particle segment within a new sampling area, a marking event is triggered to mark the coordinates of the two endpoints of the particle segment and determine whether they fall completely within the new sampling area. If any endpoints are outside the area, the mark is discarded to avoid invalid data. The diameter of the particle segment is determined based on the physical coordinate system, and it is determined whether it is greater than the minimum diameter threshold. If it is less than the threshold, the mark is discarded to avoid noise-induced accidental touches. For particle segments that pass the verification, their coordinate information is stored in memory and associated with their respective sampling areas, which is compatible with the overall consideration of the physical coordinate system and ensures the accuracy of the diameter of the particle segment. At the same time, the new sampling area and all existing sampling areas are managed, realizing particle deletion and marking events to perform multi-level analysis of particles and ensure the accuracy of particle segments. Furthermore, the logic of triggering cascading deletion of internal particles and dual regional verification of marked endpoints through region deletion does not rely on the ID index, but triggers the spatial geometric inclusion determination of the entire data, automatically identifies and cascades the clearing of particle data within the area, and achieves loosely coupled data integrity protection.
[0061] At this time, the system listens for the user's marking operation through mouse interaction events; when the user completes the drawing of the particle line segment in a new sampling area and releases the mouse, the system immediately triggers the marking event; the system captures the coordinates of the start and end points of the line segment on the screen canvas, and based on the inverse mapping model established in step S122, combined with the local magnification window offset and scaling factor, accurately converts them into the physical coordinates in the original microscopic image matrix.
[0062] The system performs a strict spatial inclusion determination on the converted particle segments; the system extracts the geometric boundary of the currently active sampling region, and then calculates whether the coordinates of the two endpoints of the particle segment fall completely within the boundary; if any endpoint is detected to be outside the region (i.e. the segment crosses the region boundary or overflows), the system determines that the label is "invalid data across the region", immediately discards the label and does not store it, thereby avoiding statistical bias caused by the ambiguity of the label range.
[0063] After passing spatial verification, the system further performs physical dimension quality control. The system uses preset image scale parameters (i.e., the correspondence between physical length and pixel length) to calculate the actual diameter of the particle line segment in the physical coordinate system. The system compares the calculated value with a preset minimum diameter threshold (e.g., 0.5nm). If the calculated value is less than the threshold, the system determines it to be invalid data generated by image noise or accidental touch, and also performs a discard operation to prevent tiny image artifacts from interfering with particle size distribution statistics.
[0064] For particle segments that pass both spatial boundary verification and physical size verification, the system marks them as valid data; the system encapsulates the geometric information of the segment, such as the endpoint coordinates and diameter, into a data object and stores it in memory; at the same time, the system establishes a logical association (such as parent-child index) between the particle data and its sampling area, and mounts it into the data tree of the corresponding area, providing a data foundation for subsequent cascading deletion and regional statistical analysis.
[0065] Specifically, in high-magnification analysis of SEM images of nanocatalysts, the user is densely marking particles within the "central region ROI_1"; the user attempts to mark a particle located at the edge of ROI_1; due to a slight mouse tremor, the starting point of the line segment is drawn inside ROI_1, but the ending point is slightly offset outside ROI_1; after the system captures the line segment, it immediately calculates the coordinates of its two endpoints and compares them with the boundary range of ROI_1; the system finds that the endpoint coordinates exceed the boundary, determines that the marking is invalid, immediately discards it, and does not display the line segment on the interface, thus avoiding the error of including impurities outside the region in the statistics.
[0066] A user accidentally clicked the mouse in a dark area of the image background, drawing an extremely short line segment. The system calculated its physical length based on the previously calibrated scale of "2.5nm / pixel" and found that the line segment was only 0.3nm long, which is less than the preset minimum diameter threshold of 0.5nm. The system recognized that this was background noise rather than real nanoparticles and automatically filtered it out, ensuring the purity of the data entering the database.
[0067] The user precisely draws a line segment spanning 20 pixels at the center of ROI_1; the system calculates that its endpoints are completely within ROI_1 and its physical length is 50nm (greater than 0.5nm); the system stores this valid data in memory and marks it as "belonging to ROI_1" in the data structure. This association mechanism ensures that if ROI_1 is deleted in the future, the particle data can be deleted synchronously and in a cascading manner, maintaining data consistency.
[0068] refer to Figure 7 In another embodiment of this application, the architecture of the particle analysis method for silicon wafer microscopic images based on dynamic windows is divided into five layers from top to bottom: input layer, preprocessing layer, interaction layer, processing layer and output layer. The layers are connected by data flow to form a complete closed-loop system for microscopic particle analysis.
[0069] The input layer, serving as the system's data entry point, primarily consists of an "image input module." Its function is to support user selection and loading of common image files (such as BMP, PNG, JPG, etc.) and to possess the ability to parse Unicode paths, ensuring stable image file reading across different operating system environments. The preprocessing layer is responsible for preliminary processing of the input image, preparing it for subsequent analysis. It comprises three core modules: an image processing module performs content region detection and boundary recognition analysis to initially locate the effective analysis area of the image; a scale detection module automatically identifies scale line segments in the image through edge detection, Hough line transform, and binarized contour analysis; and an OCR recognition module performs optical character recognition on the identified scale, extracting its physical size values and performing unit conversion processing to automatically establish the correspondence between physical length and pixel length.
[0070] The interaction layer is the core interface for users to interact with the system, and includes four functional modules: parameter configuration allows users to set ruler parameters and select analysis modes; image display provides canvas rendering and scaling control functions, supporting image display and view adjustment; coordinate transformation realizes bidirectional mapping between canvas coordinates and image coordinates, which is the key to achieving high-precision marking; and event handling handles user operations such as mouse interaction and right-click menus, serving as the entry point for triggering subsequent analysis steps.
[0071] The processing layer is the core logical processing unit of the system, which includes three main modules: the region drawing module allows users to draw, select and delete sampling regions, and performs overlap detection to ensure that sampling regions do not overlap; the particle marking module allows users to manually mark particle diameters within the sampling region, and performs threshold filtering and mark deletion, while performing dual boundary validity checks; the data calculation module performs diameter conversion, statistical analysis (such as size distribution) and density calculation based on the marked particle data.
[0072] The output layer is the result output part of the system, mainly composed of the "result output module". Its function is to export the analysis results in the form of CSV data files, save the labeled images, and support database management, so as to facilitate users to perform subsequent data management and application.
[0073] refer to Figure 8 In another embodiment of this application, a schematic diagram of the software interface layout and interaction state is presented for a particle analysis method based on microscopic images of silicon wafers using a dynamic window. This diagram intuitively demonstrates the software's visual presentation and user operation flow, embodying the design concepts of "left-right split" and "operation flow." The entire interface is divided into three main parts from top to bottom: the main interface layout, the interface layout description, and the operation flow. These parts work together to form a user-friendly interactive environment.
[0074] The main interface is the core display area of the software, employing a left-right split design. The left control panel provides parameter configuration and operation buttons, including image upload, region drawing, particle marking, result saving, and database opening functions, and displays the current software status (e.g., "Ready"). The right image display area uses a Canvas to display SEM images and supports sampling region drawing, particle marking, and interactive operations, while also providing an information bar displaying rulers and device parameters. The interface layout description details the design features of the main interface, including the left-right split design, the parameter configuration and operation buttons on the left panel, the image display and interactive drawing on the right canvas, adaptive scaling, the window size (1200×800 pixels), and the fixed width of the left panel (300 pixels). The operation flow section presents the five main steps for users to use the software in the form of a flowchart, including uploading images, drawing regions, marking particles, saving results, and opening the database. Each step has a corresponding functional description, guiding users through the entire analysis process.
[0075] Please see Figure 6 , Figure 6This is a schematic diagram of the structure of a particle analysis system for silicon wafer microscopic images based on a dynamic window, according to an embodiment of the present invention. The particle analysis system for silicon wafer microscopic images based on a dynamic window is applied to the aforementioned particle analysis method for silicon wafer microscopic images based on a dynamic window. The particle analysis system for silicon wafer microscopic images based on a dynamic window includes: The sampling area module 21 is used to acquire microscopic images and output the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale, and to determine the corresponding sampling area based on the division of the microscopic image. The dynamic window module 22 is used to introduce a dynamic window into the sampling area, and to coordinate the labeling of the sampling area based on forward mapping and reverse mapping so as to present the corresponding label in the sampling area; The new sampling area module 23 is used to trigger a traversal mechanism after the user completes the drawing of the new sampling area through the mouse release event, to check the spatial relationship between the new sampling area and all existing sampling areas, and to maintain the isolation relationship between the new sampling area and all existing sampling areas. The marking module 24 is used to determine the corresponding deletion event and marking event based on the operation of the new sampling area. In the deletion event, all particle marking data within the coordinate range of the new sampling area are uniformly deleted. In the marking event, the start and end points of the particle line segments fall completely within the new sampling area, and the corresponding diameter length is greater than the minimum diameter threshold.
[0076] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A particle analysis method based on microscopic images using a dynamic window, characterized in that, include: Acquire microscopic images and output the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale. Also, determine the corresponding sampling area based on the division of the microscopic image. A dynamic window is introduced for the sampling region, and the labeling of the sampling region is coordinated based on forward mapping and reverse mapping so as to present the corresponding label in the sampling region; When the user completes the drawing of the new sampling area through the mouse release event, the traversal mechanism is triggered to check the spatial relationship between the new sampling area and all existing sampling areas, and to maintain the isolation relationship between the new sampling area and all existing sampling areas. The corresponding deletion and marking events are determined based on the operation of the new sampling area. The deletion event presents the unified deletion of all particle marking data within the coordinate range of the new sampling area. In the marking event, the start and end points of the particle line segments fall completely within the new sampling area, and the corresponding diameter length is greater than the minimum diameter threshold.
2. The particle analysis method based on a dynamic window micrograph according to claim 1, characterized in that, The process of acquiring a microscopic image and outputting the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale, and determining the corresponding sampling area based on the division of the microscopic image, includes: The corresponding microscopic image is obtained based on the image input module. The format of the microscopic image is BMP, PNG, JPG, JPEG, TIF or TIFF. At the same time, the corresponding image scale is determined based on the detection of the microscopic image database, and the combination of the microscopic image and the corresponding image scale is triggered to output the correspondence between physical length and pixel length.
3. The particle analysis method based on a dynamic window micrograph according to claim 2, characterized in that, The process of acquiring a microscopic image, outputting the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale, and determining the corresponding sampling area based on the division of the microscopic image, further includes: Based on the imported microscopic images and the configured image scale, the sampling area can be further drawn, viewed, or deleted. The sampling area is the specific operational space for particle labeling and analysis, and serves as a specific area of interest to the user.
4. The particle analysis method based on a dynamic window micrograph according to claim 1, characterized in that, The introduction of a dynamic window for the sampling region, based on forward and reverse mapping, coordinates the labeling of the sampling region to present the corresponding label in the sampling region, including: When the sampling regions are in a non-overlapping state, three key parameters are introduced: global scaling factor, canvas offset, and local magnification window offset. The mapping relationship of the corresponding dynamic window is constructed in combination with each sampling region. The mapping relationship of the dynamic window presents forward mapping, local magnification, and reverse mapping.
5. The particle analysis method based on a dynamic window micrograph according to claim 4, characterized in that, The method of introducing a dynamic window for the sampling region, and co-labeling the sampling region based on forward and reverse mapping to present the corresponding label in the sampling region, further includes: In forward mapping, the rendering of the sampling area is monitored in real time, and it is determined whether the pixel is located within the local magnification window. If the pixel is located within the local magnification window, coordinate transformation is performed. In local magnification, when a sampling area is double-clicked to enter local magnification mode, the system does not perform full-image rendering, but instead slices a sub-matrix based on the coordinate range of the sampling area for rendering. In reverse mapping, when the screen is clicked in local magnification mode, coordinate inverse calculation is performed, and the starting coordinate offset of the local magnification window is accumulated to ensure that the marker point accurately falls back to the original pixel grid.
6. The particle analysis method based on a dynamic window micrograph according to claim 1, characterized in that, When the user completes the drawing of the new sampling area through a mouse release event, a traversal mechanism is triggered to check the spatial relationship between the new sampling area and all existing sampling areas, and to maintain the isolation relationship between the new sampling area and all existing sampling areas, including: When the user completes the drawing of the new sampling area through the mouse release event, the traversal mechanism is triggered; it traverses all existing sampling areas and performs the following judgments for each area: it uses the rectangle intersection method to determine whether there is a pixel intersection between the new sampling area and the currently traversed area; if there is an intersection, it means that the two areas have collided; it determines whether the new sampling area is completely contained within the currently traversed area, or whether the currently traversed area is completely contained within the new sampling area; if there is an inclusion relationship, it means that the two areas have a nested relationship.
7. The particle analysis method based on a dynamic window micrograph according to claim 6, characterized in that, The step of triggering a traversal mechanism after the user completes the drawing of a new sampling area via a mouse release event, checking the spatial relationship between the new sampling area and all existing sampling areas, and maintaining the isolation relationship between the new sampling area and all existing sampling areas, also includes: If a collision is detected, the creation of a new sampling region is prevented, and the user is prompted to redraw to ensure that there is no overlap between sampling regions; if an inclusion relationship is detected, warnings, automatic adjustments, or preservation of the new sampling region are handled according to specific needs.
8. The particle analysis method based on a dynamic window micrograph according to claim 1, characterized in that, The operation based on the new sampling region determines the corresponding deletion and marking events. The deletion event represents the unified deletion of all particle marking data within the coordinate range of the new sampling region. The marking event specifies that the start and end points of the particle line segments completely fall within the new sampling region, and that the corresponding diameter length is greater than the minimum diameter threshold. This includes: When a user selects to delete a sampling area, a deletion event is triggered. At this time, based on the coordinate range of the new sampling area, all marked particle segments are traversed, and it is determined whether each particle segment is located within the area. For particle segments located within the new sampling area, the system removes them from memory, thus achieving cascading deletion.
9. The particle analysis method based on a dynamic window micrograph according to claim 8, characterized in that, The operation based on the new sampling region determines the corresponding deletion and marking events. The deletion event represents the unified deletion of all particle marking data within the coordinate range of the new sampling region. The marking event, based on the condition that the start and end points of the particle line segments completely fall within the new sampling region and the corresponding diameter length is greater than the minimum diameter threshold, also includes: When a user draws a particle segment within a new sampling area, a marking event is triggered, marking the coordinates of the two endpoints of the particle segment and determining whether they fall completely within the new sampling area. If any endpoints are outside the area, the mark is discarded to avoid invalid data. The diameter of the particle segment is determined based on the physical coordinate system, and it is checked whether it is greater than a minimum diameter threshold. If it is less than the threshold, the mark is discarded to avoid accidental touches due to noise. For particle segments that pass the verification, their coordinate information is stored in memory and associated with their respective sampling areas.
10. A particle analysis system based on microscopic images of silicon wafers using a dynamic viewing window, characterized in that, The particle analysis system based on the microscopic image of a silicon wafer with a dynamic window is applied to the particle analysis method based on the microscopic image with a dynamic window as described in any one of claims 1-9. The particle analysis system for silicon wafer microscopic images based on dynamic windows includes: The sampling area module is used to acquire microscopic images and output the correspondence between physical length and pixel length based on the combination of the microscopic image and the corresponding image scale. It also determines the corresponding sampling area based on the division of the microscopic image. The dynamic window module introduces a dynamic window to the sampling area, and coordinates the labeling of the sampling area based on forward mapping and reverse mapping to present the corresponding label in the sampling area; The new sampling region module is used to trigger a traversal mechanism after the user completes the drawing of the new sampling region through the mouse release event. This mechanism checks the spatial relationship between the new sampling region and all existing sampling regions and maintains the isolation relationship between the new sampling region and all existing sampling regions. The marking module is used to determine the corresponding deletion and marking events based on the operation of the new sampling area. The deletion event presents the unified deletion of all particle marking data within the coordinate range of the new sampling area. In the marking event, the start and end points of the particle line segments fall completely within the new sampling area, and the corresponding diameter length is greater than the minimum diameter threshold.