An intelligent measurement method and measurement system for industrial parts dimensions
Through cameras and convolutional neural networks, the categories and locations of parts are identified, combined with the area of interest in front and top view, the problem of large measurement errors in curved parts is solved, and high-precision and low-cost part size measurement is achieved, which is suitable for the automated production of industrial parts.
Patent Information
- Application Number
- CN202411825777.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2044-12-12
AI Technical Summary
The existing machine vision methods have the problem of large measurement errors when measuring industrial parts with curved surfaces. Traditional manual measurement methods are inefficient, high cost and are prone to scratches on the surface of the parts, and have large artificial errors.
The camera is used to obtain real-time images of industrial parts, identify the category and position of parts through convolutional neural networks, combine the area of interest in front and top view, calculate the part size using the contour extraction algorithm and reference height, add a contour adjustment algorithm to eliminate the impact of lighting and surface unevenness, and use a daily camera for measurement.
High-precision dimensional measurement of curved parts is realized, noise interference is reduced, measurement robustness and versatility is improved, equipment costs are reduced, and deployment and promotion are facilitated.
Smart Images

Figure CN119540218B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of part size measurement, and in particular to an intelligent industrial part size measurement method and a measurement system. Background Art
[0002] With the rapid advancement of manufacturing technology, the dimensional accuracy requirements for industrial parts are becoming increasingly stringent. Dimensional measurement of industrial parts is a critical step in ensuring product quality and process accuracy. Traditional methods for measuring part dimensions typically rely on manual measurement, using mechanical tools such as vernier calipers, micrometers, and measuring instruments. However, traditional manual measurement methods inevitably involve contact between the mechanical tools and the surface of the industrial part, which can easily cause scratches if not handled properly. Furthermore, manual measurement methods require significant time and effort from the measurement personnel, resulting in high labor costs. Furthermore, manual measurement is cumbersome and time-consuming, and inefficient for large-scale measurements, making it difficult to meet the demands of automated production. Furthermore, manual measurement can introduce human errors, impacting the stability and consistency of measurement results. To improve measurement efficiency and stability, cameras are used to capture images of the parts, and machine vision methods are then used to calculate the dimensions of the industrial parts. However, existing machine vision methods do not account for curved surfaces, resulting in significant measurement errors when measuring industrial parts with curved surfaces. Summary of the Invention
[0003] The present invention provides an intelligent industrial part size measurement method and a measurement system to solve the problem of large measurement errors when measuring industrial parts with curved surfaces using existing machine vision methods.
[0004] In order to achieve the above object, the present invention is implemented through the following technical solutions:
[0005] In a first aspect, the present invention provides an intelligent measurement method for industrial part dimensions, comprising:
[0006] Acquire a real-time image of the part to be measured, and determine a front view and a top view of the part to be measured based on the real-time image;
[0007] Determining a part category of the part to be measured based on the front view and the top view, and determining a front view region of interest in the front view, and determining a top view region of interest in the top view;
[0008] Extracting the front view part outline based on the front view region of interest, and extracting the top view part outline based on the top view region of interest;
[0009] Calculating a part height and a reference height of the part to be measured based on the front view part outline and the part category, and calculating a part length and a part width of the part to be measured based on the top view part outline in combination with the part category and the reference height;
[0010] The part height, the part length and the part width are used as the size information of the part to be measured.
[0011] Optionally, determining the front view and top view of the part to be measured based on the real-time image includes:
[0012] Selecting a front view image taken at a front angle of view from the real-time image, and determining the front view center point of the part to be measured in the front view image;
[0013] intercepting the front view image based on the front view center point so that the center point of the intercepted image corresponds to the position of the front view center point, and using the intercepted image as the front view of the part to be measured;
[0014] Selecting a top-view image taken from a top-down perspective in the real-time image, and determining a top-view center point of the part to be measured in the top-view image;
[0015] The top view image is intercepted based on the top view center point so that the position of the center point of the intercepted image corresponds to the position of the top view center point, and the intercepted image is used as the top view of the part to be measured.
[0016] Optionally, extracting the front view part contour based on the front view region of interest, and extracting the top view part contour based on the top view region of interest, includes:
[0017] Performing contour extraction on the front view region of interest to obtain all candidate contours in the front view, and calculating the areas of all candidate contours obtained from the front view and the area of the front view region of interest;
[0018] Comparing the area of the candidate contour obtained in the front view with the area of the region of interest in the front view in sequence to obtain a duty ratio corresponding to the candidate contour in the front view, and comparing the duty ratio with a specified threshold value; if the duty ratio is less than the specified threshold value, the candidate contour is considered a non-part contour, and the candidate contour is deleted until a candidate contour obtained in the front view is found whose duty ratio obtained by comparing the area of the candidate contour obtained in the front view with the area of the region of interest in the front view is greater than or equal to the specified threshold value, and the candidate contour at this time is considered as the part contour in the front view;
[0019] Performing contour extraction on the region of interest in the top view to obtain all candidate contours in the top view, and calculating the areas of all candidate contours obtained from the top view and the area of the region of interest in the top view;
[0020] The area of the candidate contour obtained in the top view is compared with the area of the region of interest of the top view in sequence to obtain the duty cycle corresponding to the candidate contour of the top view, and the duty cycle is compared with a specified threshold value. If the duty cycle is less than the specified threshold value, the candidate contour is a non-part contour, and the candidate contour is deleted until the duty cycle obtained by comparing the area of the candidate contour obtained in the top view with the area of the region of interest of the top view is found to be greater than or equal to the specified threshold value. At this time, the candidate contour is used as the part contour of the top view.
[0021] Optionally, the extracting of the front view part contour based on the front view region of interest, and the extracting of the top view part contour based on the top view region of interest, further includes:
[0022] Selecting a corresponding preset front view shape and a preset top view shape based on the part category;
[0023] The front view part contour and the top view part contour are respectively adjusted according to the preset front view shape and the preset top view shape to obtain an adjusted front view part contour and an adjusted top view part contour, and the adjusted front view part contour is used as the front view part contour of the part to be measured, and the adjusted top view part contour is used as the top view part contour of the part to be measured.
[0024] Optionally, the method further includes:
[0025] Scaling the preset front view shape to the same pixel length as the front view part outline;
[0026] Mapping the preset front view shape to the front view so that the preset front view shape coincides with the front view part outline;
[0027] Traversing the points on the front view part outline in sequence, calculating the shortest distance between the point and the preset front view shape using a KD-tree, deleting the point from the front view outline if the shortest distance is greater than a specified threshold, and obtaining the adjusted front view part outline after traversal;
[0028] The points on the top view part contour are traversed in sequence, and the shortest distance from the point to the preset top view shape is calculated using KD-tree. If the shortest distance is greater than a specified threshold, the point is deleted from the top view contour. After traversal, the adjusted top view part contour is obtained.
[0029] Optionally, the calculating the part height and the reference height of the part to be measured according to the part outline in the front view and the part category includes:
[0030] The front view part contour is processed to calculate the pixel width of the part to be measured at different heights, and the corresponding reference height calculation method is selected according to the part category to calculate the reference height of the part to be measured and the pixel value of the part height.
[0031] The reference height of the part and the real physical value of the part height are calculated based on the parameters obtained when the system is initialized.
[0032] Optionally, the calculating the length and width of the part to be measured by combining the top view part outline with the part category and the reference height includes:
[0033] Processing the top view part contour to obtain pixel values corresponding to the length and width of the part to be measured;
[0034] The actual physical values of the length and width of the part are calculated based on the parameters obtained when the system is initialized and the reference height.
[0035] In a second aspect, an embodiment of the present application provides an intelligent measurement system for industrial part dimensions, comprising:
[0036] System initialization module, used to calibrate the camera, adjust the camera posture, calculate the distance between the camera and the reference surface, and calculate system parameters;
[0037] An image acquisition module is used to obtain a front view and a top view of the part to be tested captured by a camera;
[0038] The image preprocessing module is used to identify the part category based on the trained convolutional neural network model, determine the position of the part in the camera image, assist in adjusting the placement of the part, and process the part prediction frame identified by the convolutional neural network model to obtain the region of interest in the front view and the region of interest in the top view;
[0039] The contour extraction module is used to extract the contours from the ROI of the front view and the ROI of the top view obtained by the image preprocessing module, and filter out the contours that are not part contours according to the duty cycle to obtain the part contours in the front view and the top view;
[0040] The height processing module is used to process the part outline of the front view of the part to be tested, select the appropriate reference height calculation scheme according to the part category, and calculate the actual physical value of the part height and the reference height based on the system parameters obtained during system initialization;
[0041] The length and width calculation module is used to process the part outline of the top view of the part to be measured. According to the reference height obtained by the height processing module and the system parameters obtained during system initialization, the real physical values of the length and width of the part are calculated.
[0042] Beneficial effects:
[0043] The intelligent industrial part size measurement method provided by the present invention introduces the concept of reference height, which can achieve higher-precision size measurement of some parts with curved surfaces, including measurement indicators such as length, width, and height. In addition, a convolutional neural network model is added to the size measurement process to assist the contour extraction algorithm. In addition to filtering non-part contours and reducing noise interference, it can also identify the category of parts, thereby facilitating the flexible expansion of the system's measurable part types according to part categories. At the same time, the threshold in the contour screening algorithm uses a percentage instead of the previous fixed area value, which can achieve contour screening of parts of different sizes, and is more robust and versatile.
[0044] It is further worth mentioning that after contour screening, the present invention also provides a contour adjustment algorithm to eliminate the influence of ambient light and uneven surface of parts on the recognition of part contour shape, so that the adjusted contour fits the edge of the part more closely, thereby giving the system a higher anti-interference ability; in addition, the industrial part size intelligent measurement system provided by the present invention does not require the purchase of expensive professional equipment, and can use everyday cameras, so it is easy to deploy and promote. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a schematic flow chart of the part size measurement method provided by the present invention;
[0046] Figure 2 It is a structural diagram of the image acquisition module of the part size measuring device provided by the present invention;
[0047] Figure 3 It is a structural schematic diagram of the part size measuring device provided by the present invention;
[0048] Figure 4 It is a checkerboard calibration plate used in the calibration process of the present invention;
[0049] Figure 5 The present invention is a structural diagram of an industrial part with a curved surface that can be measured by the present invention, wherein (a) is a three-dimensional structural diagram of the industrial part, (b) is a front view of the industrial part, and (c) is a top view of the industrial part;
[0050] In the figure, 1. Vertical camera; 2. Horizontal camera; 3. Retractable rod; 4. Desktop reference line; 5. Reference object for calibration. DETAILED DESCRIPTION
[0051] The following is a clear and complete description of the technical solutions of the present invention. It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.
[0052] Unless otherwise defined, the technical or scientific terms used in the present invention shall have the usual meanings understood by persons of ordinary skill in the field to which the present invention belongs. The words "first", "second" and similar terms used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "a" do not indicate a quantity limitation, but rather indicate the existence of at least one. Words such as "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.
[0053] See Figure 1-2 、5, such as Figure 1 As shown, the embodiment of the present application provides an intelligent measurement method for industrial part size, which includes at least the following steps:
[0054] S100, two cameras capture images in real time, move the parts to a specific position based on the captured images, and collect the front view and top view of the parts to be tested.
[0055] Place the part flat on the table so that its bottom surface is parallel to the table. Input the image captured by the vertical camera into the trained convolutional neural network model to identify the part category and locate the part to obtain the object's position in the image. Move the center point of the part to the center point of the vertical camera's image according to the prompts in the camera image to obtain a top view of the part.
[0056] Align the front surface of the part with reference line 4 and make it perpendicular to the table. Input the image captured by the horizontal camera into the trained convolutional neural network model to locate the part and obtain the position of the object in the image. Adjust the telescopic rod 3 and move the position of the part on reference line 4 at the same time. According to the prompts in the image, move the part to the center point of the horizontal camera image to obtain the front view of the part.
[0057] S200: Input the collected front view and top view into the trained convolutional neural network model, identify the part category and locate the position of the part in the image, and obtain the region of interest in the front view and top view respectively.
[0058] The regions of interest (ROIs) of the front and top views obtained in the previous steps are fed into the pre-trained Yolo model to identify the part category and the predicted box of the part in the image. The center position of the predicted box remains unchanged, and the length and width are expanded to 1.15 times.
[0059] According to the expanded part prediction frame, the front view and top view are respectively intercepted to obtain the regions of interest of the front view and top view.
[0060] S300, performing contour extraction on the regions of interest in the front view and the top view, filtering out non-part contours according to the duty cycle, and obtaining part contours in the front view and the top view;
[0061] Perform grayscale processing and Gaussian filtering on the region of interest in the front view of the part, then extract edge points based on the Canny operator, perform dilation and erosion operations on the edge points, and finally use OpenCV's findContours function to find the object contour from the edge point image;
[0062] Due to factors such as lighting and object material, some non-part contours may be identified in the image. However, since the region of interest has been captured in the previous steps, the area occupancy ratio of the non-part contours in the region of interest cannot be greater than 50%. The identified object contours are filtered according to the area occupancy ratio, and contours with an area occupancy ratio of less than 50% are deleted to obtain the part contours in the front view and top view.
[0063] S400, respectively adjusting the front view part contour and the top view part contour to obtain adjusted front view part contour and top view part contour;
[0064] Due to factors such as lighting and part surface flatness, the identified part contour may not fit the actual shape of the part very well, resulting in large distortion. However, if we know the approximate contour of the part in advance, we can make slight adjustments to the identified part contour toward that shape. This will not affect the size of the identified contour and will also make the identified part contour shape more consistent with the actual shape of the part.
[0065] First, select the corresponding front view preset shape outline and top view preset shape outline of the part according to the identified part category.
[0066] Calculate the pixel length of the identified front view part outline, scale the front view preset outline to the same pixel length as the outline and map it to the front view, ensuring that the center of the front view preset outline coincides with the center of the identified front view part outline.
[0067] Traverse each point on the identified front view part outline and use the KDtree algorithm to calculate the shortest distance from each point to the preset front view outline. Determine whether the distance is greater than a tolerable threshold. If so, remove the point from the identified front view outline. After the traversal is complete, the adjusted front view part outline is obtained.
[0068] Calculate the pixel length of the identified top view part outline, scale the top view preset outline to the same pixel length as the outline, and map it to the top view, ensuring that the top view preset outline coincides with the center of the identified top view part outline.
[0069] Traverse each point on the identified top view part outline and use the KDtree algorithm to calculate the shortest distance from each point to the preset top view outline. Determine whether the distance is greater than a tolerable threshold. If so, delete the point from the identified top view outline. After the traversal is complete, the adjusted top view part outline is obtained.
[0070] S500. Process the part outline in the front view to obtain the pixel width of the part at different heights. According to the part category identified in the previous step, select the corresponding reference height calculation method to calculate the actual physical value of the part height and the reference height.
[0071] First, we need a parts database that stores part categories and the corresponding heights, reference heights, and length and width calculation methods. When new parts need to be tested, we only need to expand the database.
[0072] Process the outline of the part in the front view and use the minAreaRect function of the OpenCV library to obtain the minimum rectangle that can include the outline. The pixel height of the rectangle is also the pixel height of the part, which is recorded as H. p ;
[0073] From the bottom of the part outline, follow a certain step size (e.g. 3 pixels) to get the pixel width of the part at different heights. According to the part type determined in the previous step, select the corresponding reference height calculation method from the part database. The judgment standard of the part reference height mentioned in this example is the height with the largest pixel width. Therefore, after traversing the pixel widths of different heights according to this standard, the pixel value of the part reference height can be obtained, which is recorded as H 1p ;
[0074] Furthermore, according to the plane system parameter P2 along the reference line 4 perpendicular to the desktop obtained during system initialization, according to the formula The actual physical values of the part height and reference height are calculated and recorded as H r and H 1r ;
[0075] S600: Select a corresponding length and width calculation method based on the identified part category to process the part outline in the top view, and calculate the actual physical values of the length and width of the part in combination with the reference height calculated in the previous step.
[0076] Process the outline of the part in the top view and use the minAreaRect function of the opencv library to obtain the minimum rectangle that can include the outline of the part. The length and width of the rectangle represent the pixel length and pixel width of the part, which are recorded as L and p and W p ;
[0077] Select the corresponding length and width calculation method in the parts database according to the part category. For example, the length and width calculation method of the part mentioned in this example is to use the reference height as the plane height of the part top view outline to calculate. According to the formula and Calculate the real physical value L of the length and width of the object r and W r .
[0078] See Figure 2-4 ,like Figure 3 As shown, the embodiment of the present application provides an industrial parts size intelligent system, including:
[0079] System initialization module 210: used to calibrate the camera, adjust the camera posture, calculate the distance between the camera and the reference surface, and calculate some system parameters;
[0080] Image acquisition module 220: used to obtain the front view and top view of the part to be tested captured by the camera;
[0081] Image preprocessing module 230: used to identify the part category based on the trained convolutional neural network model, determine the position of the part in the camera image, assist in adjusting the position of the part, identify and process the part prediction frame based on the convolutional neural network model, and obtain the region of interest in the front view and top view;
[0082] Contour extraction module 240: used to extract the contour from the region of interest obtained by the image preprocessing module, and filter out non-part contours according to the duty cycle to obtain the contour of the part in the front view and the top view;
[0083] Height processing module 250: used to process the outline of the part in the front view, select an appropriate reference height calculation scheme according to the part type, and calculate the actual physical value of the part height and the reference height based on the system parameters obtained during system initialization;
[0084] Length and width calculation module 260: used to process the outline of the part in the top view, and calculate the real physical values of the length and width of the part based on the reference height obtained by the height processing module and the system parameters obtained during system initialization.
[0085] The system initialization module calibrates the camera, adjusts the camera posture, and calculates the distance from the camera to the reference surface, including:
[0086] Place the chessboard calibration plate horizontally on the desktop, fix the vertical camera chessboard calibration plate, input the vertical camera image into the image preprocessing module, calibrate the camera according to Zhang Zhengyou calibration method, calculate the normal vector size of the camera relative to the chessboard plane, if it is less than the specified threshold, it is considered that the vertical camera is perpendicular to the desktop, otherwise continue to adjust the vertical camera posture until the vertical camera is perpendicular to the desktop, and the vertical camera posture calibration is completed. The chessboard calibration plate is as follows Figure 4 shown.
[0087] Next, place the chessboard calibration board vertically on the table along reference line 4, and place the horizontal camera perpendicular to the chessboard calibration board. Input the horizontal camera image into the image preprocessing module, and calibrate the camera according to the Zhang Zhengyou calibration method. Calculate the size of the camera's normal vector relative to the chessboard plane. If it is less than the specified threshold, it is considered that the horizontal camera is parallel to the table. Otherwise, continue to adjust the posture of the horizontal camera until the horizontal camera is parallel to the table. The horizontal camera posture calibration is completed.
[0088] Figure 2 The middle reference object 5 is composed of two cubes, the lower cube has a side length of 4 cm, and the upper cube has a side length of 2 cm.
[0089] Next, place the reference object 5 vertically on the tabletop so that its lower surface is parallel to the tabletop. Observe the image in the vertical camera and follow the prompts to move the center of the reference object 5 to the center of the vertical camera image. The pixel side lengths of the upper and lower cubes in the image are processed and calculated separately, and the ratio of the pixel side lengths of the upper and lower cubes is obtained, which is recorded as K1. Assuming the distance from the vertical camera to the tabletop is D1, the formula can be obtained based on the perspective principle of the camera: , further deduced that The distance D1 from the vertical camera to the desktop is calculated according to the formula.
[0090] Assume that the product of the real physical value represented by each pixel on the desktop plane and its distance to the camera is P1, and the side length pixel value of the upper plane of the upper cube in the vertical camera is L1. According to the perspective principle of the camera, the parameters of the vertical camera can be obtained .
[0091] Next, place the bottom of reference object 5 horizontally on the table along reference line 4, so that the lower surface of reference object 5 is perpendicular to the table and intersects with reference line 4. Observe the image in the horizontal camera and follow the prompts to move the center of reference object 5 to the center of the horizontal camera image. Calculate the pixel side lengths of the upper and lower cubes in the image and obtain the ratio of the pixel side lengths, which is recorded as K2. Assuming the distance from the horizontal camera to the table is D2, the formula can be obtained. , further deduced that The distance D2 from the horizontal camera to the plane perpendicular to the desktop along the reference line 4 is calculated according to the formula.
[0092] Assume that the product of the real physical value represented by each pixel point on the plane perpendicular to the desktop along the reference line 4 and its distance to the camera is P2, and the pixel value of the side length of the upper plane of the upper cube in the vertical camera is L2. Then, according to the perspective principle of the camera, the parameters of the horizontal camera can be obtained. .
[0093] After the system is initialized, the distance D1 from the vertical camera to the desktop, the distance D2 from the horizontal camera to the plane perpendicular to the desktop along the reference line 4, the system parameters P1 on the desktop plane, and the system parameters P2 on the plane perpendicular to the desktop along the reference line 4 are obtained.
[0094] The above describes in detail the preferred embodiments of the present invention. It should be understood that those skilled in the art can make numerous modifications and variations based on the concepts of the present invention without inventive effort. Therefore, any technical solutions that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined by the claims.
Claims
1. An intelligent measurement method for industrial parts dimensions, characterized in that: include: Acquire a real-time image of the part to be measured, and determine a front view and a top view of the part to be measured based on the real-time image; Determining a part category of the part to be measured based on the front view and the top view, and determining a front view region of interest in the front view, and determining a top view region of interest in the top view; Extracting the front view part outline based on the front view region of interest, and extracting the top view part outline based on the top view region of interest; Calculating a part height and a reference height of the part to be measured based on the front view part outline and the part category, and calculating a part length and a part width of the part to be measured based on the top view part outline in combination with the part category and the reference height; Taking the part height, the part length and the part width as the size information of the part to be measured; Wherein, determining the front view and top view of the part to be measured based on the real-time image includes: Selecting a front view image taken at a front angle of view from the real-time image, and determining the front view center point of the part to be measured in the front view image; intercepting the front view image based on the front view center point so that the center point of the intercepted image corresponds to the position of the front view center point, and using the intercepted image as the front view of the part to be measured; Selecting a top-view image taken from a top-down perspective in the real-time image, and determining a top-view center point of the part to be measured in the top-view image; The top view image is intercepted based on the top view center point so that the position of the center point of the intercepted image corresponds to the position of the top view center point, and the intercepted image is used as the top view of the part to be measured.
2. The intelligent measurement method for industrial parts size according to claim 1, characterized in that: The extracting of the front view part contour based on the front view region of interest, and the extracting of the top view part contour based on the top view region of interest, comprises: Performing contour extraction on the front view region of interest to obtain all candidate contours in the front view, and calculating the areas of all candidate contours obtained from the front view and the area of the front view region of interest; Comparing the areas of the candidate contours obtained in the front view with the areas of the region of interest in the front view in sequence to obtain a first duty cycle corresponding to the candidate contours in the front view, and comparing the first duty cycle with a specified threshold value; if the first duty cycle is less than the specified threshold value, the candidate contour is considered a non-part contour, and the candidate contour is deleted until a candidate contour obtained in the front view is found whose first duty cycle is greater than or equal to the specified threshold value when the areas of the candidate contours obtained in the front view are compared with the areas of the region of interest in the front view; the candidate contour at this time is considered a part contour in the front view; Performing contour extraction on the region of interest in the top view to obtain all candidate contours in the top view, and calculating the areas of all candidate contours obtained from the top view and the area of the region of interest in the top view; The areas of the candidate contours obtained in the top view are compared with the areas of the regions of interest in the top view in sequence to obtain a second duty cycle corresponding to the candidate contours in the top view, and the second duty cycle is compared with a specified threshold value. If the second duty cycle is less than the specified threshold value, the candidate contour is a non-part contour, and the candidate contour is deleted until a second duty cycle obtained by comparing the areas of the candidate contours obtained in the top view with the areas of the regions of interest in the top view is found to be greater than or equal to the specified threshold value. At this time, the candidate contour is used as the part contour in the top view.
3. The intelligent measurement method for industrial parts size according to claim 2, characterized in that: The extracting of the front view part contour based on the front view region of interest, and the extracting of the top view part contour based on the top view region of interest, further comprises: Selecting a corresponding preset front view shape and a preset top view shape based on the part category; The front view part contour and the top view part contour are respectively adjusted according to the preset front view shape and the preset top view shape to obtain an adjusted front view part contour and an adjusted top view part contour, and the adjusted front view part contour is used as the front view part contour of the part to be measured, and the adjusted top view part contour is used as the top view part contour of the part to be measured.
4. The intelligent measurement method for industrial parts size according to claim 3, characterized in that: The method further comprises: Scaling the preset front view shape to the same pixel length as the front view part outline; Mapping the preset front view shape to the front view so that the preset front view shape coincides with the front view part outline; Traversing the points on the front view part outline in sequence, calculating the shortest distance between the point and the preset front view shape using a KD-tree, deleting the point from the front view outline if the shortest distance is greater than a specified threshold, and obtaining the adjusted front view part outline after traversal; The points on the top view part contour are traversed in sequence, and the shortest distance from the point to the preset top view shape is calculated using KD-tree. If the shortest distance is greater than a specified threshold, the point is deleted from the top view contour. After traversal, the adjusted top view part contour is obtained.
5. The intelligent measurement method for industrial parts size according to claim 1, characterized in that: The calculating the part height and the reference height of the part to be measured according to the part outline of the front view and the part category includes: The front view part contour is processed to calculate the pixel width of the part to be measured at different heights, and the corresponding reference height calculation method is selected according to the part category to calculate the reference height of the part to be measured and the pixel value of the part height. The reference height of the part and the real physical value of the part height are calculated based on the parameters obtained when the system is initialized.
6. The intelligent measurement method for industrial parts dimensions according to claim 1, characterized in that: The calculating the part length and the part width of the part to be measured by combining the top view part outline with the part category and the reference height includes: Processing the top view part contour to obtain pixel values corresponding to the length and width of the part to be measured; The actual physical values of the length and width of the part are calculated based on the parameters obtained when the system is initialized and the reference height.
7. An intelligent measurement system for industrial part dimensions, configured to implement the method according to any one of claims 1 to 6, wherein: The system comprises: System initialization module, used to calibrate the camera, adjust the camera posture, calculate the distance between the camera and the reference surface, and calculate system parameters; An image acquisition module is used to obtain a front view and a top view of the part to be tested captured by a camera; The image preprocessing module is used to identify the part category based on the trained convolutional neural network model, determine the position of the part in the camera image, assist in adjusting the placement of the part, and process the part prediction frame identified by the convolutional neural network model to obtain the region of interest in the front view and the region of interest in the top view; The contour extraction module is used to extract the contours from the ROI of the front view and the ROI of the top view obtained by the image preprocessing module, and filter out the contours that are not part contours according to the duty cycle to obtain the part contours in the front view and the part contours in the top view; The height processing module is used to process the part outline of the front view of the part to be tested, select the appropriate reference height calculation scheme according to the part category, and calculate the actual physical value of the part height and the reference height based on the system parameters obtained during system initialization; The length and width calculation module is used to process the part outline of the top view of the part to be measured. According to the reference height obtained by the height processing module and the system parameters obtained during system initialization, the real physical values of the length and width of the part are calculated.
Citation Information
Patent Citations
Precision hole part geometrical characteristic detection method and system based on machine vision
CN111862037A
Industrial part classification measurement method under flexible visual angle
CN117232401A