Part recognition and positioning method and system based on image segmentation

By constructing a structural energy feature map and an adaptive iterative erosion algorithm, the problem of insufficient positioning accuracy of irregular parts was solved, achieving high-precision part identification and positioning, and improving the accuracy and robustness of attitude angle calculation.

CN121366154BActive Publication Date: 2026-05-05DONGGUAN HUAMAO ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DONGGUAN HUAMAO ELECTRONICS CO LTD
Filing Date
2025-12-05
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing component positioning methods lack accuracy and robustness when dealing with irregular, asymmetrical, or complex extended shapes of components. In particular, under conditions of uneven lighting and background noise interference, they are prone to errors in attitude angle calculation and head-to-tail reversal.

Method used

An image segmentation-based method is adopted to generate the geometric centroid evolution trajectory by constructing a structural energy feature map and combining it with an adaptive iterative erosion algorithm. A Gaussian weighting function is used to suppress noise interference, the erosion intensity is adaptively adjusted, the attitude angle is calculated, and the positioning information is output.

Benefits of technology

It significantly improves the accuracy and robustness of attitude angle calculation for irregular parts, solves the head-to-tail inversion problem, and increases the success rate of part grasping in industrial settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121366154B_ABST
    Figure CN121366154B_ABST
Patent Text Reader

Abstract

This invention relates to the field of image recognition technology, specifically to a method and system for component identification and localization based on image segmentation. The method includes: acquiring a grayscale image and constructing a local neighborhood window; using a Gaussian weighting function to weighted sum the pixel differences to generate a structure energy feature map; performing binarization and morphological closing operations on the feature map to extract the foreground region; performing adaptive iterative erosion starting from the geometric centroid, recording the evolution trajectory of the geometric centroid until a termination condition is met; performing linear regression fitting on the trajectory sequence to determine the pose angle, and determining the localization coordinates based on the distance from the endpoint to the boundary. This invention enhances noise resistance through the structure energy feature map and accurately characterizes the component's shape and orientation using the trajectory generated by adaptive iterative erosion, significantly improving the accuracy and robustness of identification and localization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology. More specifically, this invention relates to a method and system for component identification and localization based on image segmentation. Background Technology

[0002] With the rapid development of industrial automation technology, machine vision is playing an increasingly important role in the automatic identification and positioning of parts. Traditional image recognition technologies typically rely on methods such as edge detection, threshold segmentation, or template matching to extract features from parts. In real-world industrial scenarios, image acquisition is often affected by factors such as uneven lighting, background noise interference, and complex surface textures of parts.

[0003] Existing component positioning methods mostly employ contour-based geometric feature extraction or region-based moment feature calculation. For example, the centroid and principal axis direction of a component are determined by calculating the geometric moments of a binarized image, or basic geometric shapes such as lines and circles are detected using Hough transform. These traditional methods are based on the premise that the component has a regular geometric structure or central symmetry. When processing components with standard geometric shapes such as circles, squares, or rectangles, they can utilize their symmetry features to achieve fast and stable positioning, meeting conventional production needs.

[0004] However, existing technologies exhibit significant limitations when dealing with the numerous irregularly shaped, non-centrosymmetric, or complexly extended irregular parts found in industrial production. For these irregular parts, simple geometric centroids often fail to represent their physical center of gravity or functional center. Furthermore, due to the lack of regular axes of symmetry, relying solely on circumscribed rectangles or principal axes for analysis is prone to errors in attitude angle calculations, even leading to head-to-tail inversions. In addition, morphological operations with fixed parameters struggle to adapt to the varying widths and detailed features of irregular parts, easily damaging critical morphological structures while denoising. Therefore, a method for high-precision morphological characterization and identification of irregular and asymmetrical parts is urgently needed. Summary of the Invention

[0005] The purpose of this invention is to propose a component identification and positioning method and system based on image segmentation, so as to solve the problems of insufficient accuracy and robustness of component positioning in the prior art.

[0006] In a first aspect, the present invention provides a component identification and localization method based on image segmentation, comprising: acquiring a grayscale image of the component to be identified, constructing a local neighborhood window for each pixel; calculating the absolute difference between the grayscale values ​​of the center pixel and the neighboring pixels, and using a Gaussian weighting function to perform a weighted summation of the difference to generate a structure energy feature map; performing binarization and morphological closing operations on the structure energy feature map to extract the foreground region; calculating the geometric centroid of the foreground region as the starting point and recording the initial area, initializing the trajectory sequence, performing adaptive iterative erosion on the foreground region, and appending the updated geometric centroid to the trajectory sequence after each erosion until the termination condition is met, stopping the iteration and marking the termination point of the evolution trajectory, wherein the adaptive iterative erosion adjusts the erosion intensity according to the decay degree of the remaining foreground area relative to the initial area; performing linear regression fitting on the trajectory sequence, and using the tilt angle of the fitted line as the attitude angle; calculating the shortest distance from the starting point and the termination point to the boundary of the foreground region respectively, and outputting the coordinates of the endpoint corresponding to the largest shortest distance and the attitude angle as localization information.

[0007] This invention achieves high-precision identification and localization of components by constructing a structural energy feature map and combining it with an adaptive iterative erosion algorithm. The structural energy feature map generated using a Gaussian weighting function can effectively suppress high-frequency noise interference while enhancing the edge structure information of the components. The geometric centroid evolution trajectory generated by adaptive iterative erosion can more stably represent the overall morphological distribution and extension direction of the components compared to single centroid or principal axis features, thereby significantly improving the accuracy and robustness of attitude angle calculation.

[0008] Optionally, the calculation process of the structure energy feature map includes: for each center pixel in the grayscale image, determining multiple neighboring pixels within the local neighborhood window; calculating the absolute difference between the grayscale value of each neighboring pixel and the grayscale value of the center pixel; determining weighting coefficients based on the spatial Euclidean distance between the neighboring pixels and the center pixel, wherein the numerical distribution of the weighting coefficients conforms to a Gaussian distribution and the weighting coefficients are negatively correlated with the spatial Euclidean distance; multiplying the absolute difference by the corresponding weighting coefficient to obtain a weighted difference, and accumulating the weighted differences of all neighboring pixels within the local neighborhood window, assigning the accumulated result to the pixel value at the corresponding coordinate position in the structure energy feature map.

[0009] This invention uses weighting coefficients that conform to a Gaussian distribution to weight the pixel differences within a local neighborhood when calculating the structural energy feature map. This weighting mechanism based on spatial Euclidean distance ensures that neighboring points closer to the center pixel contribute more, smoothing internal texture noise in the image while preserving the boundary gradient information of components to the greatest extent, thus providing a high-quality data foundation for subsequent binarization segmentation.

[0010] Optionally, the foreground region extraction process includes: statistically analyzing the grayscale distribution features of the structural energy feature map, and calculating a global binarization threshold based on Otsu's method; using the global binarization threshold to divide the structural energy feature map into a foreground pixel set and a background pixel set; performing a morphological dilation operation on the foreground pixel set to fill internal holes, followed by a morphological erosion operation to restore the boundary contour, generating a closed operation region; detecting connected components within the closed operation region, and marking connected components with a pixel count greater than a preset noise threshold as the foreground region.

[0011] This invention employs the Otsu method to determine the global threshold and combines morphological dilation, erosion, and connected component filtering strategies to extract the foreground region. This process can automatically adapt to the grayscale distribution characteristics of different images, effectively fill the holes inside the components and filter out small noise points in the background, ensuring the integrity and connectivity of the foreground region and avoiding localization failures caused by fragmented segmentation.

[0012] Optionally, the calculation process of the geometric centroid includes: traversing the foreground region and obtaining the abscissa and ordinate values ​​of all foreground pixels in the region; counting the number of all foreground pixels in the foreground region and using the number as the initial area; calculating the arithmetic mean of the abscissa values ​​of all foreground pixels to obtain the abscissa of the geometric centroid; calculating the arithmetic mean of the ordinate values ​​of all foreground pixels to obtain the ordinate of the geometric centroid; using the coordinate point formed by the abscissa and ordinate of the geometric centroid as the starting point, and using the starting point as the first element of the trajectory sequence.

[0013] Optionally, the adaptive iterative erosion process includes: in the current adaptive iterative erosion step, calculating the ratio of the current remaining foreground area to the initial area, and defining the ratio as the area retention rate; wherein, the current remaining foreground area is the number of pixels in the current foreground region; establishing a positive correlation mapping relationship between the erosion kernel size and the area retention rate, and matching the corresponding erosion kernel size from the positive correlation mapping relationship according to the current area retention rate; using the matched erosion kernel size to construct structuring elements, performing erosion operations on the current foreground region, and stripping boundary pixels.

[0014] Optionally, establishing a positive correlation between the corrosion nucleus size and the area retention rate includes: setting a preset upper limit and a preset lower limit for the corrosion nucleus size to construct a mapping logic, such that when the area retention rate tends towards a first value, the corrosion nucleus size tends towards the preset upper limit; when the area retention rate tends towards a second value, the corrosion nucleus size tends towards the preset lower limit; wherein the first value is greater than the second value, and the mapping logic ensures that as the area retention rate decreases, the corrosion nucleus size monotonically decreases or remains unchanged, and is always not less than the preset lower limit.

[0015] This invention establishes a positive correlation between the size of the erosion nucleus and the area retention rate during the iterative erosion process. By setting upper and lower limits for the size and a monotonically decreasing logic, the maximum size is used to quickly peel off non-skeleton regions in the early stages of erosion, while a smaller size is used in the later stages to refine the preservation of skeleton features. This adaptive adjustment mechanism ensures both the efficiency of the algorithm and avoids premature trajectory interruption due to excessive erosion, ensuring the accurate description of the component morphology by the evolution trajectory.

[0016] Optionally, the termination condition of the adaptive iterative erosion includes: after each adaptive iterative erosion, monitoring the morphological features of the current foreground region in real time; determining whether the termination condition is met, wherein the termination condition includes: the current remaining foreground area is less than a preset lower area threshold, or the current foreground region is broken, resulting in a connected component number greater than 1; if the termination condition is met, the adaptive iterative erosion is stopped, and the geometric centroid calculated last time before the condition is met is marked as the termination point of the evolution trajectory.

[0017] Optionally, the process of calculating the attitude angle includes: extracting the coordinate data of all geometric centroids in the trajectory sequence to construct a coordinate point set; performing linear regression fitting on the coordinate point set based on the least squares method to calculate the line parameter that minimizes the sum of squared residuals of the distances from the coordinate point set to the fitted line; and calculating the tilt angle of the fitted line based on the line parameter to obtain the attitude angle of the component to be identified.

[0018] Optionally, the edge contour pixels of the foreground region are extracted to construct a contour point set; the contour point set is traversed, and the Euclidean distance from the starting point to each point in the contour point set is calculated, and the minimum value is selected as the starting point boundary distance; the contour point set is traversed, and the Euclidean distance from the ending point to each point in the contour point set is calculated, and the minimum value is selected as the ending point boundary distance; the numerical values ​​of the starting point boundary distance and the ending point boundary distance are compared, and the coordinates of the starting point or ending point corresponding to the largest value are output as positioning coordinates; the positioning coordinates are combined with the pose angle and output as the positioning information.

[0019] This invention determines the positioning coordinates by comparing the shortest distances from the starting and ending points of the evolution trajectory to the foreground boundary. This method utilizes the thickness differences in the shape of components to effectively distinguish the endpoints of components with similar shapes but opposite directions, solving the problem of head-to-tail reversal that easily occurs when using simple geometric center positioning, and further improving the success rate of component grasping in industrial settings.

[0020] In a second aspect, a component identification and localization system based on image segmentation includes:

[0021] processor;

[0022] The memory stores computer instructions for a component identification and localization method based on image segmentation, which, when executed by the processor, cause the system to perform the aforementioned component identification and localization method based on image segmentation.

[0023] The beneficial effects of this invention are as follows: By constructing a structural energy feature map and combining it with an adaptive iterative erosion algorithm, this invention achieves high-precision identification and positioning of components. The structural energy feature map generated using a Gaussian weighting function can effectively suppress high-frequency noise interference while enhancing the edge structure information of the components. The geometric centroid evolution trajectory generated by adaptive iterative erosion, compared with a single centroid or principal axis feature, can more stably represent the overall morphological distribution and extension direction of the components, thereby significantly improving the accuracy and robustness of attitude angle calculation. Attached Figure Description

[0024] Figure 1 This is a flowchart of a component identification and localization method based on image segmentation according to an embodiment of the present invention.

[0025] Figure 2 This is the original image and structural energy feature map of a component identification and positioning system based on image segmentation according to an embodiment of the present invention.

[0026] Figure 3 This is a magnified view of the recognition result of a component recognition and positioning system based on image segmentation according to an embodiment of the present invention.

[0027] Figure 4 This is a structural block diagram of a component identification and positioning system based on image segmentation according to an embodiment of the present invention. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. Figure 1 The diagram shown is a flowchart of a component identification and localization method based on image segmentation according to an embodiment of the present invention.

[0029] S1: Acquire grayscale images of the components to be identified and generate structural energy feature maps.

[0030] First, a grayscale image of the component to be identified is acquired, and a structural energy feature map is generated. The grayscale image is acquired using an industrial camera, with an image resolution set to 1280 pixels multiplied by 1024 pixels, and a grayscale value range of 0 to 255.

[0031] For each pixel in the grayscale image, it is designated as the center pixel, and a local neighborhood window is constructed centered on that pixel. In this embodiment, the size of the local neighborhood window is set to a square area of ​​7 pixels by 7 pixels. All neighboring pixels within this local neighborhood window, excluding the center pixel, are then identified.

[0032] Calculate the absolute difference between the grayscale value of each neighboring pixel and the grayscale value of the center pixel. Determine weighting coefficients based on the Euclidean distance between the neighboring pixels and the center pixel. The weighting coefficients exhibit a Gaussian distribution and a negative correlation with the spatial Euclidean distance. Neighboring pixels closer to the center pixel have larger weighting coefficients; conversely, pixels farther away have smaller weighting coefficients.

[0033] The weighted difference is obtained by multiplying the absolute difference of each neighboring pixel by its corresponding weight coefficient, and then summing the weighted differences of all neighboring pixels within the local neighborhood window. The sum is then assigned to the pixel at the corresponding coordinate position. By traversing all pixels in the grayscale image, the structure-energy feature map is generated.

[0034] The formula for calculating the structural energy characteristic map is as follows:

[0035] ;

[0036] in, Represents the structural energy characteristic map at coordinate position Pixel value at; Represents the coordinate position of a grayscale image The grayscale value at that location; This represents the grayscale value of a neighboring pixel; This represents the weighting coefficients based on a Gaussian distribution, which are dimensionless. and This represents the offset of a neighboring pixel relative to the center pixel; the summation range covers all neighboring pixels within the entire local neighborhood window. For example... Figure 2 The image shown is the original image and structural energy feature map of a component identification and positioning system based on image segmentation according to an embodiment of the present invention.

[0037] S2: Binarize the structural energy feature map and perform morphological closing operations to extract the foreground region.

[0038] After obtaining the structure energy feature map, it is binarized and morphological closing operations are performed to extract the foreground region. The gray-level distribution characteristics of the structure energy feature map are statistically analyzed, and a global binarization threshold is calculated based on Otsu's method. Otsu's method selects the threshold that maximizes the variance between the foreground pixel set and the background pixel set as the optimal segmentation threshold by traversing all possible thresholds.

[0039] The structure energy feature map is divided into a foreground pixel set and a background pixel set using the calculated global binarization threshold. Pixels with gray values ​​greater than or equal to the threshold are marked as foreground pixels and assigned a value of 255; pixels with gray values ​​less than the threshold are marked as background pixels and assigned a value of 0.

[0040] A morphological closing operation is performed on the foreground pixel set. First, a morphological dilation operation is performed, using a 5-pixel multiplied circular structuring element to expand the foreground region outward to fill the internal holes. Then, a morphological erosion operation is performed, using a structuring element of the same size to shrink the foreground region boundary inward to restore the original boundary contour, generating the closed region.

[0041] Connected components within the closed operation region are detected, and the number of pixels in each connected component is counted. Connected components with a pixel count greater than a preset noise threshold are marked as foreground regions. In this embodiment, the preset noise threshold is set to 100 pixels; connected components with a pixel count less than this threshold are considered noise and filtered out.

[0042] S3: Perform adaptive iterative erosion and record the evolution trajectory of the geometric centroid.

[0043] After extracting the foreground region, adaptive iterative erosion is performed, and the evolution trajectory of the geometric centroid is recorded. The foreground region is traversed, and the x-coordinate and y-coordinate values ​​of all foreground pixels within the region are obtained. The total number of foreground pixels in the region is counted, and this number is used as the initial area. The arithmetic mean of the x-coordinate values ​​of all foreground pixels is calculated to obtain the x-coordinate of the geometric centroid; the arithmetic mean of the y-coordinate values ​​of all foreground pixels is calculated to obtain the y-coordinate of the geometric centroid. The point formed by the x-coordinate and y-coordinate of the geometric centroid is used as the starting point, and this starting point is used as the first element of the trajectory sequence.

[0044] Adaptive iterative erosion is performed on the foreground region. In each iteration, the ratio of the current remaining foreground area to the initial area is calculated, and this ratio is defined as the area retention rate. A positive correlation is established between the erosion kernel size and the area retention rate. The preset upper limit for the erosion kernel size is set to 7 pixels, and the preset lower limit is set to 3 pixels. When the area retention rate approaches 1, the erosion kernel size approaches the preset upper limit; when the area retention rate approaches 0.1, the erosion kernel size approaches the preset lower limit.

[0045] Based on the current area retention rate, the corresponding erosion kernel size is matched from the positive correlation mapping relationship. A circular structuring element is constructed using the matched size, and the erosion operation is performed on the current foreground region to remove boundary pixels. After each erosion, the geometric centroid of the current foreground region is recalculated, and the updated geometric centroid is appended to the trajectory sequence.

[0046] After each adaptive iterative erosion, the morphological features of the current foreground region are monitored in real time. It is determined whether a termination condition is met. Termination conditions include: the remaining foreground area is less than a preset lower area threshold (set to 5% of the initial area in this embodiment); or the current foreground region is broken, resulting in a connected component count greater than 1. If the termination condition is met, the adaptive iterative erosion stops, and the geometric centroid calculated last before the condition is met is marked as the termination point of the evolution trajectory.

[0047] S4: Perform linear regression fitting on the trajectory sequence and output positioning information.

[0048] After completing the adaptive iterative erosion, the trajectory sequence is fitted with linear regression and the positioning information is output.

[0049] The coordinate data of all geometric centroids in the trajectory sequence are extracted to construct a coordinate point set. A linear regression is performed on the coordinate point set using the least squares method, and the parameters of the line that minimize the sum of squared residuals from the coordinate point set to the fitted line are calculated. The tilt angle of the fitted line is calculated based on the line parameters to obtain the attitude angle of the component to be identified. The attitude angle ranges from -90 degrees to +90 degrees.

[0050] Extract the edge contour pixels of the foreground region to construct a contour point set. Traverse the contour point set, calculate the Euclidean distance from the starting point to each point in the contour point set, and select the minimum value as the boundary distance of the starting point. Traverse the contour point set, calculate the Euclidean distance from the ending point to each point in the contour point set, and select the minimum value as the boundary distance of the ending point.

[0051] The system compares the numerical values ​​of the starting point boundary distance and the ending point boundary distance, and outputs the coordinates of the starting or ending point corresponding to the largest value as the positioning coordinates. The positioning coordinates are combined with the attitude angle and output as positioning information. This positioning information is displayed to the operator through a human-machine interface and can be transmitted to the robotic arm control system for automatic part grasping. Figure 3 The image shown is a magnified view of the recognition result of a component recognition and positioning system based on image segmentation according to an embodiment of the present invention.

[0052] According to a second aspect of the present invention, the present invention also provides a component identification and positioning system based on image segmentation. Figure 4 This is a structural block diagram of a component identification and positioning system based on image segmentation according to an embodiment of the present invention. Figure 4 As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the component identification and localization method based on image segmentation according to the first aspect of the present invention. The system also includes other components well-known to those skilled in the art, such as a communication bus and a communication interface; their configuration and functions are known in the art and will not be described further here.

[0053] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be within the scope of protection of the present invention.

Claims

1. A component identification and localization method based on image segmentation, characterized in that, The positioning method includes: Acquire grayscale images of the parts to be identified and construct local neighborhood windows for each pixel; calculate the absolute difference between the grayscale values ​​of the center pixel and the neighboring pixels, and use a Gaussian weighting function to perform a weighted summation of the differences to generate a structural energy feature map; The structural energy feature map is binarized and morphologically closed to extract the foreground region; the geometric centroid of the foreground region is calculated as the starting point and the initial area is recorded, the trajectory sequence is initialized, and adaptive iterative erosion is performed on the foreground region. After each erosion, the updated geometric centroid is appended to the trajectory sequence until the termination condition is met, at which point the iteration stops and the termination point of the evolution trajectory is marked. The adaptive iterative erosion adjusts the size of the erosion kernel according to the degree of decay of the remaining foreground area relative to the initial area. Linear regression fitting is performed on the trajectory sequence, and the tilt angle of the fitted line is used as the attitude angle; the shortest distance from the starting point and the ending point to the boundary of the foreground region is calculated respectively, and the coordinates of the endpoint corresponding to the largest shortest distance and the attitude angle are output as positioning information.

2. The component identification and localization method based on image segmentation according to claim 1, characterized in that, The calculation process of the structural energy characteristic map includes: For each center pixel in the grayscale image, determine multiple neighboring pixels within the local neighborhood window; calculate the absolute difference between the grayscale value of each neighboring pixel and the grayscale value of the center pixel; determine weighting coefficients based on the spatial Euclidean distance between the neighboring pixels and the center pixel, wherein the numerical distribution of the weighting coefficients conforms to a Gaussian distribution, and the weighting coefficients are negatively correlated with the spatial Euclidean distance; The absolute difference is multiplied by the corresponding weight coefficient to obtain the weighted difference. The weighted differences of all neighboring pixels in the local neighborhood window are accumulated, and the accumulated result is assigned to the pixel value at the corresponding coordinate position of the structure energy feature map.

3. The component identification and localization method based on image segmentation according to claim 1, characterized in that, The process of extracting the foreground region includes: The gray-level distribution characteristics of the energy feature map of the structure are statistically analyzed, and the global binarization threshold is calculated based on Otsu's method. The structure energy feature map is divided into a foreground pixel set and a background pixel set using the global binarization threshold; A morphological dilation operation is first performed on the foreground pixel set to fill the internal holes, followed by a morphological erosion operation to restore the boundary contour and generate a closed operation region. Detect connected components within the closed operation region, and mark connected components with a pixel count greater than a preset noise threshold as the foreground region.

4. The component identification and localization method based on image segmentation according to claim 1, characterized in that, The calculation process for the geometric centroid includes: Traverse the foreground region and obtain the x-coordinate and y-coordinate values ​​of all foreground pixels in the region; count the total number of all foreground pixels in the foreground region and use the count as the initial area. Calculate the arithmetic mean of the x-coordinate values ​​of all foreground pixels to obtain the x-coordinate of the geometric centroid; calculate the arithmetic mean of the y-coordinate values ​​of all foreground pixels to obtain the y-coordinate of the geometric centroid. The coordinate point formed by the x-coordinate and y-coordinate of the geometric centroid is taken as the starting point, and the starting point is taken as the first element of the trajectory sequence.

5. The component identification and localization method based on image segmentation according to claim 1, characterized in that, The adaptive iterative erosion process includes: In the current adaptive iterative erosion step, the ratio of the current remaining foreground area to the initial area is calculated, and this ratio is defined as the area retention rate; wherein, the current remaining foreground area is the number of pixels in the current foreground region. Establish a positive correlation between the size of the corrosion nucleus and the area retention rate, and match the corresponding corrosion nucleus size from the positive correlation based on the current area retention rate; The structuring element is constructed using the size of the erosion kernel obtained from the matching, and the current foreground region is eroded to remove the boundary pixels.

6. The component identification and localization method based on image segmentation according to claim 5, characterized in that, The establishment of a positive correlation between the size of the erosion nucleus and the area retention rate includes: Set the preset upper and lower limits for the size of the erosion nucleus; A mapping logic is constructed such that when the area retention rate approaches a first value, the size of the erosion core approaches the preset upper limit value; and when the area retention rate approaches a second value, the size of the erosion core approaches the preset lower limit value. Wherein, the first value is greater than the second value, and the mapping logic ensures that as the area retention rate decreases, the size of the corrosion nucleus decreases monotonically and is always not less than the preset lower limit value.

7. The component identification and localization method based on image segmentation according to claim 1, characterized in that, The termination conditions for the adaptive iterative erosion include: After each adaptive iteration of erosion, the remaining foreground area is monitored in real time; Determine whether the termination condition is met. The termination condition includes: the current remaining foreground area is less than a preset lower area threshold, or the current foreground region is broken, resulting in a connected component number greater than 1. If the termination condition is met, the adaptive iterative erosion is stopped, and the geometric centroid obtained in the last calculation before the condition is met is marked as the termination point of the evolution trajectory.

8. The component identification and localization method based on image segmentation according to claim 1, characterized in that, The calculation process for the attitude angle includes: Extract the coordinate data of all geometric centroids in the trajectory sequence to construct a coordinate point set; Linear regression fitting is performed on the coordinate point set based on the least squares method, and the line parameters that minimize the sum of squared residuals of the distances from the coordinate point set to the fitted line are calculated. The tilt angle of the fitted straight line is calculated based on the straight line parameters to obtain the attitude angle of the component to be identified.

9. The component identification and localization method based on image segmentation according to claim 1, characterized in that, The location information includes: Extract the edge contour pixels of the foreground region and construct a contour point set; Traverse the set of contour points, calculate the Euclidean distance from the starting point to each point in the set of contour points, and select the minimum value as the boundary distance of the starting point. Traverse the set of contour points, calculate the Euclidean distance from the termination point to each point in the set of contour points, and select the minimum value as the boundary distance of the termination point. Compare the numerical values ​​of the starting point boundary distance and the ending point boundary distance, and output the coordinates of the starting point or ending point corresponding to the largest value as the positioning coordinates; The positioning coordinates and the attitude angle are combined and output as the positioning information.

10. A component identification and positioning system based on image segmentation, characterized in that, include: processor; A memory, wherein a computer program is stored; When the processor is configured to execute the computer program, it implements a component identification and localization method based on image segmentation as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Cell edge segmentation method and device based on adaptive morphology

    CN114240978A

  • Dark weak space target centroid extraction method based on morphological reconstruction

    CN117314800A