A method and system for hole position detection

Through the calibration and three-dimensional scanning technology of multi-viewing angle system, high-precision three-dimensional measurement of the surface holes of the part is achieved, solving the problems of artificial error and low efficiency in the prior art, and achieving stable and efficient hole position detection.

CN114638789BActive Publication Date: 2025-02-25XINTUO 3D TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210193441.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-01
Publication Date
2025-02-25
Estimated Expiration
2042-03-01

AI Technical Summary

Technical Problem

The existing hole position detection methods are prone to introduce manual errors, have low measurement efficiency, and cannot guarantee the stability of measurement accuracy and meet the requirements of detection efficiency.

Method used

The hole position detection is carried out using a multi-viewing angle system, including multiple viewing angle measurement modules, industrial-grade black and white cameras and projectors. Through global calibration, multi-viewing angle three-dimensional scanning, model alignment and hole three-dimensional reconstruction and detection, the hole position is realized. High-precision measurement.

Benefits of technology

It realizes three-dimensional high-precision measurement of the surface holes of the part, avoids manual errors, has stable measurement accuracy and high detection efficiency, and can quickly complete the measurement and quality evaluation of multiple holes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638789B_ABST
    Figure CN114638789B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for hole position detection, the method comprising: calibration of a measuring system: used to obtain calibration results; multi-view three-dimensional scanning: used to obtain three-dimensional data of an object to be measured and images of multiple view angles to obtain a three-dimensional model; model alignment: aligning the three-dimensional model of the object to be measured with the nominal model so that the features on the two models overlap; three-dimensional reconstruction and detection of holes: creating holes to be detected on the nominal model, then projecting them onto each image to constrain the range of edge detection, edge detection and edge screening of images within a specified range to obtain edge data of the holes, and then calculating the parameters of the surface circle of the holes based on a three-dimensional reconstruction algorithm of circles under multiple view angles, the parameters including the center of the circle, normal, and radius, and finally comparing with the holes on the nominal model to obtain deviations, the deviations including the center distance, radius deviation, and normal angle. The measurement accuracy is not affected by human factors, is relatively stable, and the measurement method is fast and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of machine vision and three-dimensional digital measurement technology, and in particular to a method and system for hole position detection. Background Technology

[0002] The inspection of holes on the surface of parts plays an extremely important role in the quality assessment of parts, and therefore has received extensive research in recent years. Due to its advantages such as non-contact, high precision, and automation, automated 3D inspection of holes based on machine vision is gradually becoming the direction of future development.

[0003] Currently, hole inspection mainly relies on manual measurement using precision measuring tools, including high-precision vernier calipers, plug gauges, and inside micrometers. However, this method is highly susceptible to human error and has low measurement efficiency. When large-scale inspections are required, this method cannot guarantee the stability of measurement accuracy or meet the requirements for inspection efficiency.

[0004] The above background information is provided only to aid in understanding the concept and technical solution of this invention. It does not necessarily belong to the prior art of this patent application. In the absence of clear evidence that the above information was disclosed on the filing date of this patent application, the above background information should not be used to evaluate the novelty and inventiveness of this application. Summary of the Invention

[0005] In order to solve the existing problems, the present invention provides a method and system for pore position detection.

[0006] To solve the above problems, the technical solution adopted by the present invention is as follows:

[0007] A method for hole location detection includes the following steps: S1: Calibration of a multi-view system: The multi-view system includes multiple view measurement modules, each of which includes two industrial-grade monochrome cameras and a projector. Global calibration is performed on the cameras to obtain calibration results, which include the intrinsic parameters of each camera and the exterior orientation parameters between the cameras; S2: Multi-view 3D scanning: This acquires 3D data of the object under test and images from multiple viewpoints, and based on the calibration results, unifies the 3D data from different viewpoints into a single coordinate system to obtain a 3D model; S3: Model alignment: Aligns the object under test... The three-dimensional model is aligned with the nominal model of the object to be tested, so that the features on the three-dimensional model and the nominal model coincide; S4: Three-dimensional reconstruction and detection of the hole: The hole to be detected is created on the nominal model, and then projected onto each of the images to constrain the range of edge detection. Edge detection and edge filtering are performed on the images within the specified range to obtain the edge data of the hole. Then, the parameters of the surface circle of the hole are calculated based on the three-dimensional reconstruction algorithm of the circle under multiple viewpoints. The parameters include the center, normal, and radius. Finally, the deviation is compared with the hole on the nominal model to obtain the deviation, which includes the center distance, radius deviation, and normal angle.

[0008] Preferably, in step S1, the camera is globally calibrated based on the principles of photogrammetry. The global calibration of the camera further includes calculating the positional relationships between the various cameras, specifically: designating the left camera in each measurement module as a reference camera, and designating one of the cameras as a global reference camera; calculating the positional relationships between the cameras in each measurement module; calculating the positional relationships between the reference cameras in different measurement modules; and calculating the positional relationships of all cameras relative to the global reference camera. The positional relationship between two cameras refers to the transformation matrix between the two camera coordinate systems.

[0009] Preferably, unifying the 3D data from different perspectives into a single coordinate system to obtain the 3D model includes: after a single measurement module completes the 3D reconstruction of the surface of the object to be measured, the coordinate system of the scanning data of the single measurement module is in the left camera coordinate system, and the calibration results are used to transform the scanning data of each measurement module into the global coordinate system to achieve the stitching of 3D data from multiple perspectives.

[0010] Preferably, the nominal model is a CAD model or a mesh model; if the nominal model is a CAD model, aligning the three-dimensional model of the object under test with the nominal model of the object under test includes: meshing the nominal model to obtain a nominal mesh model; aligning the centroid coordinates and three principal directions of the nominal mesh model and the three-dimensional model using a principal component analysis algorithm; and aligning the nominal mesh model and the three-dimensional model again using an iterative nearest point algorithm.

[0011] Preferably, step S4, creating a hole to be detected on the nominal model, includes: if the nominal model is a CAD model, picking the edge curve of the surface circle of the hole, discretizing the edge curve to obtain discrete points, and fitting a complete nominal three-dimensional circle based on the discrete points; if the nominal model is a mesh model, fitting a nominal three-dimensional circle by selecting three points on the edge of the hole.

[0012] Preferably, in step S4, when performing edge detection on the images under each of the aforementioned viewpoints, the method further includes filtering the viewpoints of the images and deleting viewpoints where the angle between the projection direction of the camera and the normal of the plane where the hole is located is large: obtaining the angle between the line direction connecting the center of the nominal three-dimensional circle and the origin of the camera coordinate system of each of the cameras and the normal of the nominal three-dimensional circle; if the angle is greater than a certain angle, the image of the corresponding viewpoint will not participate in the subsequent calculation.

[0013] Preferably, in step S4, constraining the edge detection range in the image using the nominal three-dimensional circle includes: discretizing the nominal three-dimensional circle to obtain a series of discrete three-dimensional points; projecting the three-dimensional points onto the image according to the projection model established during the calibration of the multi-view system; after completing the projection, calculating the size of the bounding box of the projection points of the nominal three-dimensional circle on each image, and adding a certain range outward in both the length and width directions of the bounding box image to obtain the edge detection area of ​​the image.

[0014] Preferably, in step S4, subpixel-level precision edge detection is performed on the edge detection area of ​​the image after the viewpoint filtering where the hole is located; the detected edges are filtered according to the edge points of the prior circle projected onto the image. The filtering principle is to calculate the nearest distance between all detected edge points and all edge points in the prior circle. Points with a nearest distance less than a certain value are retained, otherwise they are deleted.

[0015] Preferably, step S4 further includes filtering the image again after completing the edge detection and filtering of the hole, including the following steps: performing ellipse fitting on the filtered edges in all the images after viewpoint filtering to obtain the center point of the ellipse; randomly combining the cameras corresponding to all the images after viewpoint filtering into a set of binocular stereo vision systems to perform three-dimensional reconstruction of the center point of the ellipse; statistically analyzing the reprojection error and filtering again to obtain valid images where the reprojection error of the center point of the ellipse is less than a certain value; obtaining the deviation based on the valid images includes: using the center, radius, and normal of the three-dimensional circle created on the nominal model as the initial iteration values, using the edges in the valid images as the iteration data, performing Gauss-Newton method iteration based on the principle of multi-view stereo vision, and finally calculating the parameters of the surface circle of the hole based on the edges in the image; comparing the parameters with the nominal three-dimensional circle to obtain the deviation.

[0016] The present invention also provides a system for hole location detection, comprising: a measurement module with multiple viewpoints and a data processing unit, wherein the measurement modules with multiple viewpoints constitute a multi-view measurement system for acquiring three-dimensional data of the object to be measured and images from multiple viewpoints; the data processing unit is used to implement the hole location detection method as described above.

[0017] The beneficial effects of this invention are: it provides a method and system for hole position detection, which realizes three-dimensional measurement of holes on the surface of parts through the principle of multi-view stereo vision. The measurement accuracy is not affected by human factors, so the measurement accuracy is relatively stable and the measurement method is fast and efficient.

[0018] Furthermore, the present invention can measure multiple holes on the surface of a part with a single data acquisition, thereby measuring the center distance between two holes to evaluate related parameters such as hole processing quality and positioning accuracy.

[0019] Furthermore, this invention performs three-dimensional reconstruction of the three-dimensional morphology of the part surface while detecting the hole. Therefore, the method proposed in this invention provides a more intuitive hole detection method, and related detection operations can be performed on the three-dimensional model.

[0020] Finally, the hole detection method proposed in this invention is also applicable to situations where the area around the hole is a highly reflective surface. This is because the three-dimensional measurement of the hole using the multi-view stereo vision method only requires extracting the edge of the hole from the captured image to perform three-dimensional reconstruction of the surface circle of the hole, thereby realizing the detection of the hole. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of a method for hole position detection in an embodiment of the present invention.

[0022] Figure 2 This is a schematic diagram of a measurement module with multiple perspectives in an embodiment of the present invention.

[0023] Figure 3 This is a schematic diagram of the arrangement of a calibration plate in an embodiment of the present invention.

[0024] Figure 4 This is a schematic diagram of a method for calculating the positional relationship between the various cameras in an embodiment of the present invention.

[0025] Figure 5 This is a schematic diagram of a multi-view system scanning process in an embodiment of the present invention.

[0026] Figure 6 This is a schematic diagram illustrating the method for aligning the three-dimensional model of the object under test with the nominal model of the object under test in an embodiment of the present invention.

[0027] Figure 7 This is a schematic diagram of the three-dimensional reconstruction and detection process of holes in an embodiment of the present invention.

[0028] Figure 8 This is a schematic diagram illustrating the selection of viewing angles for the image in an embodiment of the present invention.

[0029] Figure 9 This is a schematic diagram of a method for constraining the edge detection range in an image using a nominal three-dimensional circle, as described in an embodiment of the present invention.

[0030] Figure 10 This is a schematic diagram of a method for further filtering of images in an embodiment of the present invention.

[0031] Figure 11 This is a schematic diagram of obtaining the deviation based on the effective image in an embodiment of the present invention.

[0032] Figure 12 This is a schematic diagram of a process for hole position detection in an embodiment of the present invention.

[0033] Figures 13(a)-13(f) These are, respectively, a schematic diagram of a nominal model, a schematic diagram of a three-dimensional model, a schematic diagram of the model alignment result, a schematic diagram of hole creation, the result of edge detection from different perspectives, and a schematic diagram of the three-dimensional reconstruction result of the hole in an embodiment of the present invention. Detailed Implementation

[0034] To make the technical problems, technical solutions, and beneficial effects of the embodiments of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.

[0035] It should be noted that when a component is referred to as "fixed to" or "set on" another component, it can be directly on or indirectly on that other component. When a component is referred to as "connected to" another component, it can be directly connected to or indirectly connected to that other component. Furthermore, a connection can be for both fixing and circuit connection purposes.

[0036] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", and "outer" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention.

[0037] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0038] like Figure 1 As shown, the present invention provides a method for borehole location detection, comprising the following steps:

[0039] S1: Calibration of the multi-view system: The multi-view system includes multiple view measurement modules. Each measurement module includes two industrial-grade black and white cameras and a projector. The cameras are globally calibrated to obtain calibration results. The calibration results include the intrinsic parameters of each camera and the exterior orientation parameters between the cameras.

[0040] S2: Multi-view 3D scanning: used to acquire 3D data of the object under test and images from multiple viewpoints, and to unify the 3D data from different viewpoints into a coordinate system based on the calibration results to obtain a 3D model;

[0041] S3: Model Alignment: Align the 3D model of the object under test with the nominal model of the object under test, so that the features on the 3D model and the nominal model overlap.

[0042] Model alignment is used to provide accurate reference data for subsequent 3D reconstruction and inspection of holes.

[0043] S4: 3D Reconstruction and Detection of Holes: A hole to be detected is created on the nominal model and then projected onto each of the images to constrain the range of edge detection. Edge detection and edge filtering are performed on the images within the specified range to obtain the edge data of the hole. Then, the parameters of the surface circle of the hole are calculated based on the 3D reconstruction algorithm of the circle under multiple viewpoints. The parameters include the center, normal, and radius. Finally, the deviation is compared with the hole on the nominal model to obtain the deviation, which includes the center distance, radius deviation, and normal angle.

[0044] It is understood that the multiple perspectives in this invention require as much overlap as possible.

[0045] like Figure 2 As shown, the present invention sets up measurement modules with multiple perspectives, or measurement modules M1-M5. The number of measurement modules can be determined according to the specific object to be measured. The five groups in the figure do not constitute a limitation on the present invention. Furthermore, the position of each measurement module is determined according to the size range of the object to be measured.

[0046] In one embodiment of the present invention, in step S1, the camera is globally calibrated based on the principle of photogrammetry; this provides high-precision three-dimensional point coordinates of the marker points on the calibration board for camera calibration, thus reducing the dependence of camera calibration accuracy on the accuracy of the calibration board.

[0047] like Figure 3 The diagram shown is a schematic diagram of the arrangement of a calibration plate in an embodiment of the present invention, in which the calibration plate is used to calibrate the multi-view system.

[0048] like Figure 4 As shown, global calibration of the cameras also includes calculating the positional relationships between the cameras, specifically including:

[0049] The left camera in each of the measurement modules is designated as the reference camera, and one of the cameras is designated as the global reference camera;

[0050] Calculate the positional relationship between the cameras in each measurement module;

[0051] Calculate the positional relationship between the reference cameras in different measurement modules;

[0052] Calculate the positional relationships of all the cameras relative to the global reference camera;

[0053] The positional relationship between the two cameras refers to the transformation matrix between the two camera coordinate systems.

[0054] After obtaining the calibration results, the measurement module is used to acquire images. The projector is used to project the coded grating onto the surface of the object under test, and the industrial-grade black and white camera is used to capture the grating image and the original image of the surface of the object under test. Then, the grating image is dephased and stereo matched based on the four-step phase shift and multi-frequency interpolation principle. Finally, the surface of the object under test is reconstructed in three dimensions based on the principle of binocular stereo vision.

[0055] like Figure 5 The diagram illustrates a multi-view scanning system flowchart in an embodiment of the present invention. During measurement, each measurement module M is performed sequentially to prevent interference between the grating images projected by different measurement modules. Each strategy module first performs grating projection and image acquisition during measurement. The grating image is used for 3D reconstruction of the surface topography of the object under test from that viewpoint, while the surface image is used for subsequent edge extraction and 3D reconstruction of holes. After a single measurement module completes the 3D reconstruction of the object's surface, the scanning data D from multiple measurement modules needs to be converted to the same coordinate system, i.e., the stitching of 3D data from multiple viewpoints.

[0056] In one specific embodiment, unifying the three-dimensional data from different perspectives into a single coordinate system to obtain the three-dimensional model includes:

[0057] After a single measurement module completes the three-dimensional reconstruction of the surface of the object to be measured, the coordinate system of the scanning data of the single measurement module is in the left camera coordinate system. The calibration results are used to transform the scanning data of each measurement module to the global coordinate system to realize the stitching of three-dimensional data from multiple perspectives.

[0058] In one specific embodiment, the nominal model is a CAD model or a mesh model;

[0059] like Figure 6 As shown, if the nominal model is a CAD model, aligning the 3D model of the object under test with the nominal model of the object under test includes:

[0060] The nominal model is meshed to obtain a nominal mesh model;

[0061] The centroid coordinates and three principal directions of the nominal mesh model and the 3D model are aligned using Principal Component Analysis (PCA); this step is a coarse alignment.

[0062] The nominal mesh model and the 3D model are re-aligned using the Iterative Closest Point (ICP) algorithm; this step is a precise alignment.

[0063] like Figure 7The diagram shown is a schematic representation of the three-dimensional reconstruction and detection process of holes in this invention, which will be described in detail below.

[0064] (1) Create a hole to be inspected.

[0065] In one embodiment of the present invention, step S4, creating a hole to be detected on the nominal model, includes:

[0066] If the nominal model is a CAD model, then the edge curve of the surface circle of the hole is picked, the edge curve is discretized to obtain discrete points, and a complete nominal three-dimensional circle is fitted based on the discrete points;

[0067] If the nominal model is a mesh model, then a nominal three-dimensional circle is fitted by selecting three points on the edge of the hole.

[0068] (2) Edge detection

[0069] Furthermore, in step S4, when performing edge detection on the images from each of the aforementioned viewpoints, the viewpoints are also filtered, and viewpoints with a large angle between the camera's projection direction and the normal to the plane containing the hole are deleted. This is because the edge distortion of the hole in the images from these viewpoints is relatively large, and including them in the calculation would reduce the calculation accuracy.

[0070] Obtain the angle between the direction of the line connecting the center of the nominal 3D circle to the origin of the camera coordinate system of each camera and the normal of the nominal 3D circle. If the angle is greater than a certain angle, the image of the corresponding viewpoint will not participate in the subsequent calculation.

[0071] like Figure 8 As shown, in one specific embodiment, the angle α is set to less than 75°, meaning that the image at the corresponding viewpoint greater than this angle is not included in subsequent calculations.

[0072] like Figure 9 As shown, in step S4, constraining the edge detection range in the image using the nominal three-dimensional circle includes:

[0073] Discretize the nominal three-dimensional circle to obtain a series of discrete three-dimensional points;

[0074] Based on the projection model established during the calibration of the multi-view system, the three-dimensional points are projected onto the image. After the projection is completed, the size of the bounding box of the nominal three-dimensional circle on each image is calculated, and a certain range is added outward in both the length and width directions of the bounding box to obtain the edge detection area of ​​the image.

[0075] In one specific embodiment, 50-100 pixels can be added, and when performing edge detection on the image, calculations only need to be performed within this area. This effectively constrains the range of image edge detection and greatly improves detection efficiency.

[0076] (3) Edge filtering

[0077] In step S4, subpixel-level precision edge detection is performed on the edge detection region of the image after the viewpoint filtering, where the hole is located;

[0078] The detected edges are filtered based on the edge points of the prior circle projected onto the image. The filtering principle is to calculate the nearest distance between all detected edge points and all edge points in the prior circle. Points with a nearest distance less than a certain value are retained, and others are deleted.

[0079] In one specific embodiment, this value is less than 5 pixels.

[0080] (4) Image filtering

[0081] like Figure 10 As shown, step S4 also includes, after completing the edge detection and filtering of the holes, to ensure the stability of the multi-view reconstruction accuracy, filtering the image again, including the following steps:

[0082] Ellipse fitting is performed on the filtered edges in all the images after perspective filtering to obtain the center point of the ellipse;

[0083] The cameras corresponding to all the images after the viewpoint filtering are randomly paired into a set of viewpoint binocular stereo vision system, and the center point of the ellipse is reconstructed in three dimensions.

[0084] The reprojection error is statistically analyzed, and images with a reprojection error of less than a certain value at the center point of the ellipse are selected as valid images.

[0085] In one specific embodiment, this fixed value is set to 1 or less.

[0086] (5) Three-dimensional reconstruction

[0087] like Figure 11 As shown, the deviation obtained based on the effective image includes:

[0088] Using the center, radius, and normal of the three-dimensional circle created on the nominal model as initial values ​​for iteration, and the edges in the effective image as iterative data, the Gauss-Newton method is used for iteration based on the principle of multi-view stereo vision. Finally, the parameters of the surface circle of the hole are calculated based on the edges in the image.

[0089] The deviation is obtained by comparing the parameter with the nominal three-dimensional circle. This deviation is used to evaluate the quality of the hole on the object under test.

[0090] The present invention also provides a system for hole position detection, characterized in that it includes: a measurement module with multiple viewing angles and a data processing unit.

[0091] The measurement modules with multiple perspectives constitute a multi-view measurement system, used to acquire three-dimensional data of the object under test and images from multiple perspectives;

[0092] The data processing unit is used to implement the method for hole position detection as described above.

[0093] like Figure 12 The diagram shown is a schematic flowchart of a hole position detection method according to the present invention.

[0094] Using the method and system of this invention, the holes in the object to be tested are detected according to the above process.

[0095] like Figures 13(a)-13(f) The figures shown are schematic diagrams of the nominal model, the three-dimensional model, the model alignment result, the hole creation, the edge detection result from different perspectives, and the three-dimensional reconstruction result of the hole, respectively, in a specific embodiment of the present invention. The nominal model in this embodiment is a CAD model.

[0096] This application also provides a control device, including a processor and a storage medium for storing a computer program; wherein, when the processor executes the computer program, it performs at least the method described above.

[0097] This application also provides a storage medium for storing a computer program, which, when executed, performs at least the methods described above.

[0098] This application also provides a processor that executes a computer program, at least performing the methods described above.

[0099] The storage medium can be implemented by any type of volatile or non-volatile storage device, or a combination thereof. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Sync Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM). The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0100] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0101] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0102] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0103] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0104] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0105] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0106] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0107] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0108] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or application, should be considered within the scope of protection of the present invention.

Claims

1. A method for hole position detection, characterized in that: The following steps are involved: S1: Calibration of a multi-view system: The multi-view system includes measurement modules of multiple view angles, each of which includes two industrial-grade black-and-white cameras and a projector. The cameras are globally calibrated to obtain calibration results, which include intrinsic parameters of each camera and external orientation parameters between the cameras. S2: multi-view 3D scanning: used to obtain 3D data of the object to be measured and images of multiple view angles, and unify the 3D data under different view angles in one coordinate system to obtain a 3D model based on the calibration results; S3: Model alignment: aligning the three-dimensional model of the object to be measured with the nominal model of the object to be measured so that features on the three-dimensional model and the nominal model overlap; The nominal model is a CAD model or a mesh model; If the nominal model is a CAD model, aligning the three-dimensional model of the object to be measured with the nominal model of the object to be measured comprises: meshing the nominal model to obtain a nominal mesh model; aligning the centroid coordinates and three main directions of the nominal mesh model and the three-dimensional model by a principal component analysis algorithm; and aligning the nominal mesh model with the three-dimensional model again by an iterative closest point algorithm; S4: Three-dimensional reconstruction and detection of holes: Create the holes to be detected on the nominal model, and then project them onto each of the images to constrain the range of edge detection. Perform edge detection and edge screening on the images within the specified range to obtain edge data of the holes. Then, based on the three-dimensional reconstruction algorithm of the circles under multiple viewing angles, calculate the parameters of the surface circle of the holes, the parameters include the center, normal, and radius. Finally, compare with the holes on the nominal model to obtain the deviation, the deviation includes the center distance, radius deviation, and normal angle.

2. The method for hole position detection according to claim 1, characterized in that: In step S1, the camera is globally calibrated based on the principle of photogrammetry; The global calibration of the cameras also includes calculating the positional relationship between the cameras, specifically including: Designate the left camera in each of the measurement modules as a reference camera, and designate one of the cameras as a global reference camera; Calculating the positional relationship between the cameras in each of the measurement modules; Calculating the positional relationship between the reference cameras in different measurement modules; Calculating the positional relationship of all the cameras relative to the global reference camera; The positional relationship between the two cameras refers to the transformation matrix between the two camera coordinate systems.

3. The method for hole position detection according to claim 2, characterized in that: Unifying the three-dimensional data at different viewing angles in one coordinate system to obtain the three-dimensional model includes: After a single measurement module completes the three-dimensional reconstruction of the surface of the object to be measured, the coordinate system of the scanning data of the single measurement module is in the left camera coordinate system. The calibration result is used to convert the scanning data of each measurement module into the global coordinate system to realize the splicing of three-dimensional data under multiple perspectives.

4. The method for hole position detection according to claim 1, characterized in that: In step S4, creating a hole to be detected on the nominal model includes: If the nominal model is a CAD model, picking up the edge curve of the surface circle of the hole, discretizing the edge curve to obtain discrete points, and fitting a complete nominal three-dimensional circle based on the discrete points; If the nominal model is a mesh model, a nominal three-dimensional circle is fitted by selecting three points on the edge of the hole.

5. The method for hole position detection according to claim 4, characterized in that: In step S4, edge detection of the image at each viewing angle also includes screening the viewing angle of the image, and deleting the viewing angles where the projection direction of the camera and the normal of the plane where the hole is located have a larger angle: The angle between the direction of the line connecting the center of the nominal three-dimensional circle and the origin of the camera coordinate system of each camera and the normal of the nominal three-dimensional circle is obtained. If the angle is greater than a certain angle, the image of the corresponding viewing angle does not participate in subsequent calculations.

6. The method for hole position detection according to claim 5, characterized in that: In step S4, constraining the edge detection range includes constraining the edge detection range in the image by the nominal three-dimensional circle, specifically including: Discretizing the nominal three-dimensional circle to obtain a series of discrete three-dimensional points; The three-dimensional points are projected onto the image according to the projection model established during the calibration of the multi-view system. After the projection is completed, the size of the bounding box of the projection point of the nominal three-dimensional circle on each of the images is calculated, and a certain range is additionally added outward in both the length and width directions of the bounding box to obtain the edge detection area of ​​the image.

7. The method for hole position detection according to claim 6, characterized in that: In step S4, edge detection with sub-pixel accuracy is performed on the edge detection area of ​​the image after viewing angle screening where the hole is located; The detected edges are screened according to the edge points of the prior circle projected onto the image. The screening principle is to calculate the shortest distance between all detected edge points and all edge points in the prior circle. Points whose shortest distance is less than a certain value are retained, otherwise deleted.

8. The method for hole position detection according to claim 7, characterized in that: Step S4 also includes screening the image again after completing the edge detection and screening of the hole, including the following steps: Performing ellipse fitting on the filtered edges in all the images after the viewing angle filtering to obtain the center point of the ellipse; The cameras corresponding to all the images after the viewing angle screening are randomly combined into a binocular stereo vision system with a viewing angle, and the center point of the ellipse is three-dimensionally reconstructed; Counting the reprojection errors and screening again to obtain a valid image in which the reprojection error of the center point of the ellipse is less than a certain value; Obtaining the deviation based on the valid image includes: Using the center, radius, and normal of the three-dimensional circle created on the nominal model as the initial values ​​of the iteration, and the edge in the effective image as the iteration data, the Gauss-Newton method is iterated based on the principle of multi-eye stereo vision, and finally the parameters of the surface circle of the hole are calculated according to the edge in the image; The deviation is obtained by comparing the parameter with the nominal three-dimensional circle.

9. A system for hole position detection, characterized in that: include: Measurement modules and data processing units with multiple viewing angles, The measurement modules of multiple viewing angles constitute a multi-viewing angle measurement system, which is used to collect three-dimensional data of the object to be measured and images of multiple viewing angles; The data processing unit is used to implement the method for hole position detection as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Edge detection method and system based on handheld three-dimensional scanner

    CN109341591A

  • Edge reconstruction method and system

    CN112381921A