Part size detection method based on image recognition

Through the part size detection method based on image recognition, three-dimensional models are generated using adaptive lighting and image processing technology, the problems of complex and low efficiency of part accuracy detection in the prior art are solved, and high-precision and efficient part size detection are achieved.

CN119625045APending Publication Date: 2025-03-14YUQIN PRECISION DRAWING TECH (SUZHOU) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411651982.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When detecting the surface accuracy of parts, the prior art requires continuous adjustment of the relative positions of the light source, parts and cameras, and taking a large number of photos. The adjustment of light intensity and resolution is complicated, making it difficult to quickly detect the accuracy of tiny parts.

Method used

The part size detection method based on image recognition is adopted, and the light intensity is adjusted through an adaptive lighting system, the light irradiates parts at different angles is controlled, and two-dimensional images of different shadow shapes are obtained. The edge detection algorithm and image segmentation technology are used to extract boundary and shadow information, establish normal directions, generate three-dimensional point clouds, and build a three-dimensional grid model to achieve accurate detection of part size.

Benefits of technology

Improves the accuracy and efficiency of part size measurement, can quickly detect whether the part meets standard dimensional requirements, meets changing measurement needs, and accurately identify the complex curved surfaces and geometric characteristics of the part.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625045A_ABST
    Figure CN119625045A_ABST
Patent Text Reader

Abstract

The invention discloses a part size detection method based on image recognition, which comprises the following steps of: generating a plurality of two-dimensional images with different shadow shapes, recognizing and extracting boundary information and shadow information of a part in the two-dimensional images to obtain the shadow information and normal direction of the part in the two-dimensional images, constructing a three-dimensional image of the part, and detecting the size of the part according to the three-dimensional image. Therefore, the accurate size information of the part can be accurately recognized, the part size measurement precision is improved, the measurement efficiency is further improved, the continuously changing measurement requirements are met, and meanwhile, the normal direction is obtained by recognizing and extracting the boundary information and shadow information of the part in the two-dimensional image, so that the measurement accuracy is improved. And the normal direction information forms a normal field of the part surface, the inclination degree and the shape change of the part surface are known, and the orientation and the concave-convex condition of the part surface are determined, so that the precision of subsequently constructing a part three-dimensional model is further improved, and the measurement efficiency is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of size detection, and in particular to a part size detection method based on image recognition. Background Art

[0002] Image recognition refers to the technology of using computers to process, analyze and understand images to identify targets and objects of various different patterns. It is a core task in the field of computer vision, which aims to enable computers to understand and judge the content of images like humans. Image recognition technology may be based on the main features of the image. Image recognition technology has rich and diverse functions, such as target detection and recognition, which can detect specific targets from images and identify their categories, such as face detection, vehicle recognition, etc.; feature extraction, which can extract feature information in images, such as color, texture, shape, etc., for subsequent classification, recognition and other tasks.

[0003] The shape and structure of parts often have three-dimensional characteristics, such as gears. Two-dimensional images cannot fully display these characteristics, while three-dimensional imaging can more completely present the shape and structure of parts, which helps to more comprehensively understand the size information of parts; the existing direction of detecting the surface accuracy of parts requires constantly adjusting the relative positions of the light source, parts and cameras, and taking a large number of photos to detect the accuracy; and the difficulty of detecting the accuracy of tiny parts lies in the fact that too strong light will produce strong reflected light, so that the accuracy is covered by the reflected strong light; too weak light will cause the part image to be underexposed, and the accuracy is difficult to detect. Therefore, when detecting the accuracy of parts of different sizes and types, it is necessary to constantly adjust the light intensity of the light source, the resolution of the camera, and the design parameters of the lens, which is troublesome and cannot be detected quickly.

[0004] Therefore, in order to overcome the above shortcomings, it is necessary to design a part size detection method based on image recognition. Summary of the invention

[0005] The present invention overcomes the deficiencies of the prior art and provides a part size detection method based on image recognition.

[0006] To achieve the above object, the technical solution adopted by the present invention is: a part size detection method based on image recognition, comprising the following steps:

[0007] Step S1, placing the parts in the irradiation area of ​​the platform, adjusting the intensity of the light with the adaptive lighting system, controlling lights at several different angles to sequentially irradiate the parts, and taking pictures with a camera located on one side of the platform to obtain two-dimensional images of different shadow shapes;

[0008] Step S2, preprocessing a plurality of two-dimensional images, using edge detection algorithm and image segmentation technology to identify and extract boundary information and shadow information of parts in the two-dimensional images;

[0009] Step S3, based on lighting at different angles on the part, record the angular direction of the light source, as well as the shape and position of the shadow formed by the part, and establish a geometric relationship between each light source angle and the corresponding shadow shape to obtain the normal direction;

[0010] Step S4: Generate a three-dimensional point cloud of the part surface based on the shadow information and the normal direction, and gradually convert the point cloud into a three-dimensional mesh model using computer vision and a three-dimensional reconstruction algorithm to construct the three-dimensional shape of the part;

[0011] Step S5, refine and smooth the three-dimensional model, obtain accurate size information of the three-dimensional model of the part, output the measured part size information in a numerical form, and realize the detection of the part size.

[0012] In a preferred embodiment of the present invention, in step S2, the preprocessing includes: removing noise and enhancing image contrast to eliminate errors and outliers.

[0013] In a preferred embodiment of the present invention, in step S2, the boundary information includes: the edge and contour of the part; the shadow information includes: the coordinates, shape and curvature of the shadow boundary.

[0014] In a preferred embodiment of the present invention, in step S3, the method for obtaining the normal direction comprises the following steps:

[0015] Step S31, recording the shadow image under each light source at different angles, and recording the direction of the light source, and performing noise elimination and contrast enhancement processing on the image;

[0016] Step S32: measure the brightness of the obtained images to obtain the brightness value I of each image. i , I i is the brightness value of the reflected light intensity;

[0017] Step S33: According to the known light source direction L i And the brightness value I obtained by shooting i , use the light field method formula to establish a linear equation system and calculate the normal direction N of each point.

[0018] In a preferred embodiment of the present invention, in step S4, the method for generating a three-dimensional point cloud of a part surface comprises the following steps:

[0019] Step S41, integrating the normal direction obtained in step S3 with the boundary information and shadow information extracted in step S2;

[0020] Step S42: Based on the two-dimensional images generated at different angles, feature points P of the part and shadow boundary in the two-dimensional image are extracted using a feature detection algorithm, and the three-dimensional coordinates of the feature points P are generated by extending them using the corresponding normal direction N. The three-dimensional coordinates of each feature point can be: Among them, (x0, y0, z0) is the two-dimensional projection coordinate of the sampling point, d is the depth value, and N is the normal direction;

[0021] Step S43: fusing point cloud data from different angles, removing duplicate points and optimizing data to obtain a unified three-dimensional point cloud set, and storing the three-dimensional point cloud set in a point cloud array;

[0022] Step S44: optimize the point cloud and use a point cloud registration algorithm to align multiple point cloud data sets to the same coordinate system to form a complete part surface point cloud.

[0023] In a preferred embodiment of the present invention, in step S4, the three-dimensional shape of the part is constructed, specifically, the implicit function in the point cloud is solved by the Poisson equation to generate a continuous surface on the surface of the part, the surface divergence field is solved by the least squares method using Poisson surface reconstruction, the isosurface of the implicit surface is extracted, and the three-dimensional mesh model of the part is gradually generated.

[0024] In a preferred embodiment of the present invention, in step S5, the three-dimensional model is refined to increase the texture information of the model and improve the edge details of the model; and the smoothing process is to eliminate the sharp and uneven parts of the model surface.

[0025] In a preferred embodiment of the present invention, in step S5, obtaining accurate size information of a part comprises the following steps:

[0026] Step S51: using the constructed mesh model, detecting the edge and contour of the part, analyzing the normal change of the mesh vertex, and identifying the geometric features of the part;

[0027] Step S52: Calculate the dimensions based on the extracted geometric features of the parts, compare the measured dimensions of the parts with the standard dimension model, use a registration algorithm to match the three-dimensional model, analyze the deviations of each dimension, and determine whether the parts meet the design requirements;

[0028] Step S53: output the measurement result in numerical form.

[0029] In a preferred embodiment of the present invention, in step S52, the geometric features of the part include: structural information of edges, contours, and holes.

[0030] The present invention solves the defects existing in the background technology and has the following beneficial effects:

[0031] (1) The present invention provides a part size detection method based on image recognition, which generates a number of two-dimensional images with different shadow shapes, and identifies and extracts the boundary information and shadow information of the part in the two-dimensional image to obtain the shadow information and normal direction of the part in the two-dimensional image, generate three-dimensional points on the surface of the part, and construct a three-dimensional map of the part. It is ensured that the constructed three-dimensional model of the part is consistent with the part to be detected, so that the accurate size information of the part can be accurately identified, and it is determined whether the part to be detected meets the requirements of the standard part, thereby improving the accuracy of part size measurement, further improving the efficiency of measurement, and meeting the ever-changing measurement needs.

[0032] (2) The present invention provides a part size detection method based on image recognition. By identifying and extracting the boundary information and shadow information of the part in the two-dimensional image, the normal direction is obtained. The normal direction information will constitute the normal field of the part surface, understand the inclination degree and shape change of the part surface, and determine the orientation and concave-convexity of the part surface, thereby further improving the accuracy of the subsequent construction of the part three-dimensional model and further improving the measurement efficiency.

[0033] (3) The present invention generates a three-dimensional point cloud based on the normal direction to construct a three-dimensional model of the part to be inspected. It can analyze the normal changes of each point in the part and accurately identify the geometric features of the edge, curved surface and hole of the part. It not only helps to accurately measure the key parameters of the thickness and curvature of the part, but also can effectively detect geometric deviations to ensure that the constructed three-dimensional model of the part is consistent with the part to be inspected, so that the part size can be quickly detected and it can be determined whether the part to be inspected meets the requirements of the standard part, thereby improving the speed of part size detection.

[0034] (4) The present invention covers the entire surface of the part through a complete three-dimensional coordinate point cloud, including not only the external contour but also the complex concave curved surface and hidden areas. The three-dimensional shape of the part can be fully constructed through the coordinate points, avoiding the occurrence of holes or breaks in the constructed three-dimensional model, thus ensuring the integrity of the model and making the subsequent point cloud fusion and registration smoother. The point cloud data obtained by shooting at different angles can be integrated into the same coordinate system to form a seamless three-dimensional point cloud model. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 The present invention is a flowchart of a method for detecting part dimensions based on image recognition. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0039] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the scope of protection of the present application. In addition, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the invention, unless otherwise specified, "multiple" means two or more.

[0040] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood by specific circumstances.

[0041] like Figure 1 As shown, a part size detection method based on image recognition includes the following steps:

[0042] Step S1, placing the parts in the irradiation area of ​​the platform, adjusting the intensity of the light with the adaptive lighting system, controlling lights at several different angles to sequentially irradiate the parts, and taking pictures with a camera located on one side of the platform to obtain two-dimensional images of different shadow shapes;

[0043] Step S2, preprocessing a plurality of two-dimensional images, using edge detection algorithm and image segmentation technology to identify and extract boundary information and shadow information of parts in the two-dimensional images;

[0044] Step S3, based on lighting at different angles on the part, record the angular direction of the light source, as well as the shape and position of the shadow formed by the part, and establish a geometric relationship between each light source angle and the corresponding shadow shape to obtain the normal direction;

[0045] Step S4: Generate a three-dimensional point cloud of the part surface based on the shadow information and the normal direction, and gradually convert the point cloud into a three-dimensional mesh model using computer vision and a three-dimensional reconstruction algorithm to construct the three-dimensional shape of the part;

[0046] Step S5, refine and smooth the three-dimensional model, obtain accurate size information of the three-dimensional model of the part, output the measured part size information in a numerical form, and realize the detection of the part size.

[0047] In step S1, specifically, the part to be tested is placed on a workbench, and the workbench is kept horizontal and stable to ensure that the captured image will not produce errors due to the instability of the platform; the part is placed in the irradiation area of ​​the workbench to ensure that all parts of the part can be illuminated and adapted by the light;

[0048] Among them, the adaptive lighting system controls lights at different angles to illuminate the parts in turn, so as to obtain the shadow information of the parts from multiple perspectives; the camera located on one side of the workbench captures images of the parts under different lights; after the shooting is completed, several two-dimensional images with different shadow shapes are generated. The two-dimensional images contain the shadow information of the parts under different lighting angles, providing a data basis for subsequent image processing and analysis.

[0049] In step S2, a plurality of two-dimensional images are preprocessed to remove noise, enhance image contrast, and eliminate errors and outliers. During the image capture and transmission process, some noise points often appear in the image due to interference from factors such as the environment and equipment. The noise points not only affect the clarity of the image, but may also interfere with subsequent feature extraction. Therefore, removing noise is a key step in preprocessing. A filter is used to perform denoising on the image. The filter can smooth the high-frequency noise in the image and retain the low-frequency information, thereby making the image clearer.

[0050] The contrast of an image reflects the degree of difference between different gray levels in the image. If the contrast is insufficient, the details in the image may be difficult to recognize. Therefore, it is necessary to enhance the image contrast to make the histogram distribution of the image more uniform, thereby enhancing the image contrast.

[0051] Among them, the boundary information includes: the edge and contour of the part; the shadow information includes: the coordinates, shape and curvature of the shadow boundary;

[0052] After preprocessing, the image quality is improved. Edge detection and feature extraction are performed on the two-dimensional image. The edge is the place where the grayscale changes most dramatically in the image, usually corresponding to the outline of the object or the boundary of different areas. Therefore, edge detection is a key step in feature extraction. The edge detection algorithm is usually based on grayscale gradient or second-order derivative for detection. For example, the Canny edge detection algorithm is used to calculate the gradient strength and direction of each pixel in the image, and then non-maximum suppression and double threshold processing are used to extract edge information.

[0053] On the basis of edge detection, feature information in the image is further extracted. The feature information includes not only the boundary and outline of the part, but also the shape, size and position of the shadow. For boundary and outline information, the shape features of the part are extracted by analyzing the coordinates and connection relationships of the edge points. For example, basic geometric shapes such as straight line segments and circular arcs can be identified. For shadow information, the features of the shadow are extracted by analyzing the coordinates and shape of the shadow boundary.

[0054] In the present invention, in step S3, the method for obtaining the normal direction comprises the following steps:

[0055] Step S31, recording the shadow image under each light source at different angles, and recording the direction of the light source, and performing noise elimination and contrast enhancement processing on the image;

[0056] Step S32: measure the brightness of the obtained images to obtain the brightness value I of each image. i , I i is the brightness value of the reflected light intensity;

[0057] Step S33: According to the known light source direction L i And the brightness value I obtained by shooting i , use the light field method formula to establish a linear equation system and calculate the normal direction N of each point.

[0058] In this process, multiple shadow images under different light source angles are collected, and the brightness of the obtained images is measured to obtain the brightness value I of each image. i , where i represents different light sources, denoising and edge detection are performed on the image to ensure the accuracy of the shadow boundary;

[0059] In step S31, the direction of the light source is recorded, and the incident direction of each light source is a known vector L i =(L ix , L iy , L iz), where i = 1, 2, ..., k, and k is the number of light sources;

[0060] The brightness of the surface reflection under each light source direction can be described by Lambert's law of reflection: i = k·(N·L i )=k·(N x L ix +N y L iy +N z L iz ), where I i is the brightness of the image illuminated by the i-th light source, reflecting the reflection intensity of the surface in that direction, N = (N x , N y , N z ) is the normal vector to be found, L i is the direction vector of the i-th light source, k is the reflection coefficient,;

[0061] Based on the known quantities mentioned above, the different directions of the light source and the corresponding brightness values ​​are combined to form a set of equations, and the normal vector N is solved. The following brightness equations are selected:

[0062] Solve for the normal direction N.

[0063] The calculated normal direction is used to understand the inclination and shape change of the part surface. The normal direction of each point determines the reflection angle and shadow shape of the point relative to the light source. By calculating the normal direction under multiple light source angles, the three-dimensional shape of the part surface can be accurately constructed, and the tiny details of the part can be accurately captured, so that parts with complex surfaces or irregular geometric structures can be reconstructed to ensure that the reconstructed three-dimensional shape is in line with reality, so that a three-dimensional model can be accurately constructed for the part in the subsequent process.

[0064] Among them, by calculating the normal direction of each point, the local orientation of the part surface at different positions can be clarified, which can avoid the error caused by the projection of the two-dimensional image and improve the accuracy of the subsequent generation of the three-dimensional model; and the determination of the normal direction provides the spatial position and depth information of each feature point, which helps to accurately extract feature points from two-dimensional images at different angles, form a high-quality point cloud, ensure the comprehensive capture of the part surface details, and further improve the accuracy of the subsequent construction of the three-dimensional model.

[0065] In step S4, a method for generating a three-dimensional point cloud of a part surface comprises the following steps:

[0066] Step S41, integrating the normal direction obtained in step S3 with the boundary information and shadow information extracted in step S2;

[0067] Step S42: Based on the two-dimensional images generated at different angles, feature points P of the part and shadow boundary in the two-dimensional image are extracted using a feature detection algorithm, and the three-dimensional coordinates of the feature points P are generated by extending them using the corresponding normal direction N. The three-dimensional coordinates of each feature point can be: Among them, (x0, y0, z0) is the two-dimensional projection coordinate of the sampling point, d is the depth value, and N is the normal direction;

[0068] Step S43: fusing point cloud data from different angles, removing duplicate points and optimizing data to obtain a unified three-dimensional point cloud set, and storing the three-dimensional point cloud set in a point cloud array;

[0069] Step S44: optimize the point cloud and use a point cloud registration algorithm to align multiple point cloud data sets to the same coordinate system to form a complete part surface point cloud.

[0070] By integrating the normal direction calculated in step S3 with the boundary information and shadow information extracted in step S2, the spatial shape of the part under different lighting angles can be preliminarily determined;

[0071] In step S42, feature points are extracted by a feature detection algorithm, and are extended into three-dimensional coordinates using the normal direction, which provides a basis for reconstructing the three-dimensional shape of the part from the two-dimensional image. By obtaining the coordinate positions of the feature points, basic data is provided for constructing the point cloud, ensuring that each surface detail of the model is accurately restored, and providing the accuracy and completeness of the reconstructed three-dimensional model.

[0072] In step S43, point cloud fusion ensures that point cloud data from different angles are unified into a whole, avoiding the possibility of redundant points or model discontinuity, ensuring that the subsequently reconstructed three-dimensional model has higher accuracy, and improving the quality and integrity of the point cloud;

[0073] In step S4, a three-dimensional point cloud is generated based on the normal direction. The three-dimensional coordinates of each feature point are calculated. The three-dimensional coordinates of the feature point provide a basis for the accurate spatial positioning of the part. Compared with the depth projection of only a two-dimensional image, the three-dimensional coordinates give each point a position in space, realizing the conversion of the part from a plane image to a three-dimensional structure, and ensuring that the details of the part surface can be accurately reflected in the three-dimensional model.

[0074] After obtaining the coordinates, the geometric features of the parts can be accurately described, because the feature points are distributed in locations with significant geometric changes, such as edges, curved surfaces, and holes. By capturing the three-dimensional information of the feature points, the key geometric features of the part surface are retained, ensuring that the generated three-dimensional model can accurately restore the structure of the part;

[0075] In addition, the entire surface of the part is covered with a complete three-dimensional coordinate point cloud, including not only the external contour but also complex concave surfaces and hidden areas. Through the coordinate points, the three-dimensional shape of the part can be fully constructed to ensure that the model has no holes or breaks, thus ensuring the integrity of the model and making subsequent point cloud fusion and registration smoother. The point cloud data taken from different angles can be integrated into the same coordinate system to form a seamless three-dimensional point cloud model.

[0076] It should be noted that the acquisition of three-dimensional coordinates is not only the basis for point cloud generation, but also provides core data for the subsequent reconstruction of the three-dimensional mesh model. The surface of the parts is constructed through coordinate points, and topological connections are made with coordinate points. The complete mesh structure is gradually generated to accurately obtain the coordinate position of each point, which effectively improves the smoothness and fineness of the mesh model, thereby increasing the accuracy of the constructed three-dimensional model.

[0077] In summary, by generating a three-dimensional point cloud based on the normal direction, and thus constructing a three-dimensional model of the part to be inspected, it is possible to analyze the normal changes of each point in the part and accurately identify the geometric features of the edges, surfaces and holes of the part. This not only helps to accurately measure the key parameters of the thickness and curvature of the part, but also can effectively detect geometric deviations and ensure that the constructed three-dimensional model of the part is consistent with the part to be inspected, so that the part size can be quickly detected and whether the part to be inspected meets the requirements of the standard part can be determined, thereby improving the rate of part size detection.

[0078] In the present invention, in step S5, the three-dimensional model is refined to increase the texture information of the model and improve the edge details of the model; and the smoothing process is to eliminate the sharp and uneven parts of the model surface.

[0079] In step S5, accurate size information of the part is obtained, including the following steps:

[0080] Step S51: using the constructed mesh model, detecting the edge and contour of the part, analyzing the normal change of the mesh vertex, and identifying the geometric features of the part;

[0081] Step S52: Calculate the dimensions based on the extracted geometric features of the parts, compare the measured dimensions of the parts with the standard dimension model, use a registration algorithm to match the three-dimensional model, analyze the deviations of each dimension, and determine whether the parts meet the design requirements;

[0082] Step S53: output the measurement result in numerical form.

[0083] In summary, during use, the present invention can place several parts to be inspected on a workbench, so that multiple parts to be inspected can be inspected at the same time, and parts in different placement situations can be quickly inspected, which can effectively improve the detection rate.

[0084] When the present invention is used, a part is placed in an irradiation area, the intensity of the light is adjusted by an adaptive lighting system, and lights at multiple angles are controlled to irradiate in sequence. A camera on one side is used to shoot and obtain two-dimensional images of different shadow shapes. After the image is obtained, the two-dimensional image is preprocessed, and the edge detection algorithm and image segmentation technology are used to identify and extract the boundary and shadow information of the part. After the image preprocessing is completed, based on the shadow image under different light source conditions, the light source angle is recorded and a relationship with the image brightness is established. The normal direction of each point is calculated using the light field method formula, and the feature points are extracted by integrating the normal direction with the boundary and shadow information using the feature detection algorithm, and their three-dimensional coordinates are calculated to generate a three-dimensional point cloud of the part surface. After the three-dimensional point cloud is obtained, the Poisson surface reconstruction technology is used to convert the point cloud into a three-dimensional mesh model, and the model is refined and smoothed, the geometric features of the three-dimensional model of the part are extracted and the size is calculated, and by comparing with the standard model, it is judged whether the part meets the design requirements, and the measurement results are output in numerical form.

[0085] The above is based on the ideal embodiment of the present invention. Through the above description, relevant personnel can make various changes and modifications without departing from the technical concept of the present invention. The technical scope of the present invention is not limited to the content in the specification, and the technical scope must be determined according to the scope of the claims.

Claims

1. A part size detection method based on image recognition, characterized in that: The following steps are involved: Step S1, placing the parts in the irradiation area of ​​the platform, adjusting the intensity of the light with the adaptive lighting system, controlling lights at several different angles to sequentially irradiate the parts, and taking pictures with a camera located on one side of the platform to obtain two-dimensional images of different shadow shapes; Step S2, preprocessing a plurality of two-dimensional images, using edge detection algorithm and image segmentation technology to identify and extract boundary information and shadow information of parts in the two-dimensional images; Step S3, based on lighting at different angles on the part, record the angular direction of the light source, as well as the shape and position of the shadow formed by the part, and establish a geometric relationship between each light source angle and the corresponding shadow shape to obtain the normal direction; Step S4: Generate a three-dimensional point cloud of the part surface based on the shadow information and the normal direction, and gradually convert the point cloud into a three-dimensional mesh model using computer vision and a three-dimensional reconstruction algorithm to construct the three-dimensional shape of the part; Step S5, refine and smooth the three-dimensional model, obtain accurate size information of the three-dimensional model of the part, output the measured part size information in a numerical form, and realize the detection of the part size.

2. The method for detecting part size based on image recognition according to claim 1, characterized in that: In step S2, the preprocessing includes: removing noise and enhancing image contrast to eliminate errors and outliers.

3. A part size detection method based on image recognition according to claim 1, characterized in that: In step S2, the boundary information includes: the edge and contour of the part; the shadow information includes: the coordinates, shape and curvature of the shadow boundary.

4. The method for detecting part size based on image recognition according to claim 1, characterized in that: In step S3, the method for obtaining the normal direction comprises the following steps: Step S31, recording the shadow image under each light source at different angles, and recording the direction of the light source, and performing noise elimination and contrast enhancement processing on the image; Step S32: measure the brightness of the obtained images to obtain the brightness value I of each image. i , I i is the brightness value of the reflected light intensity; Step S33: According to the known light source direction L i And the brightness value I obtained by shooting i , use the light field method formula to establish a linear equation system and calculate the normal direction N of each point.

5. The method for detecting part size based on image recognition according to claim 1, characterized in that: In step S4, the method for generating a three-dimensional point cloud of a part surface comprises the following steps: Step S41, integrating the normal direction obtained in step S3 with the boundary information and shadow information extracted in step S2; Step S42: Based on the two-dimensional images generated at different angles, feature points P of the part and shadow boundary in the two-dimensional image are extracted using a feature detection algorithm, and the three-dimensional coordinates of the feature points P are generated by extending them using the corresponding normal direction N. The three-dimensional coordinates of each feature point can be: Among them, (x0, y0, z0) is the two-dimensional projection coordinate of the sampling point, d is the depth value, and N is the normal direction; Step S43: fusing point cloud data from different angles, removing duplicate points and optimizing data to obtain a unified three-dimensional point cloud set, and storing the three-dimensional point cloud set in a point cloud array; Step S44: optimize the point cloud and use a point cloud registration algorithm to align multiple point cloud data sets to the same coordinate system to form a complete part surface point cloud.

6. The method for detecting part size based on image recognition according to claim 1, characterized in that: In step S4, the three-dimensional shape of the part is constructed. Specifically, the implicit function in the point cloud is solved by the Poisson equation to generate a continuous surface on the surface of the part. The surface divergence field is solved by the least squares method using Poisson surface reconstruction, the isosurface of the implicit surface is extracted, and the three-dimensional mesh model of the part is gradually generated.

7. The method for detecting part size based on image recognition according to claim 1, characterized in that: In step S5, the three-dimensional model is refined to increase the texture information of the model and improve the edge details of the model; and the smoothing process is to eliminate the sharp and uneven parts of the model surface.

8. The method for detecting part size based on image recognition according to claim 1, characterized in that: In step S5, obtaining accurate size information of the part includes the following steps: Step S51: using the constructed mesh model, detecting the edge and contour of the part, analyzing the normal change of the mesh vertex, and identifying the geometric features of the part; Step S52: Calculate the dimensions based on the extracted geometric features of the parts, compare the measured dimensions of the parts with the standard dimension model, use a registration algorithm to match the three-dimensional model, analyze the deviations of each dimension, and determine whether the parts meet the design requirements; Step S53: output the measurement result in numerical form.

9. The method for detecting part dimensions based on image recognition according to claim 8, characterized in that: In step S52, the geometric features of the part include: structural information of edges, contours, and holes.

Citation Information

Cited By

  • Automobile part defect detection method and detection system

    CN119863459A

  • Augmented reality projection-based part repair state real-time detection system and method

    CN121120519A