CN-121999056-A - Visual measurement method based on STP model coordinate calibration
Abstract
The invention discloses a vision measurement method based on STP model coordinate calibration, which comprises the steps of analyzing STP model geometric features to extract measurement reference points and importing tolerance information of the features, then adopting multi-point calibration to construct a unified transformation relation of STP model coordinate system, motion mechanism coordinate system and camera coordinate system, realizing mapping of model coordinates to measured features under actual measurement coordinates and camera pixel coordinate system, planning a detection path and camera shooting pose based on model features, realizing automatic vision measurement of multiple features on a workpiece, carrying out gray threshold segmentation by utilizing standard height of geometric features in an image processing stage, distinguishing the bottom surface and feature surface of the workpiece, combining algorithms such as Blob region growth median feature extraction, circle fitting and plane fitting to obtain parameters such as size and height of template features, finally comparing a measurement result with model standard tolerance, and outputting a detection report and deviation statistics.
Inventors
- ZHANG KAIKAI
- WANG TANGMENG
- XU ZHIFEI
- LIU JIAKUI
Assignees
- 深丝智能科技(江苏)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260106
Claims (10)
- 1. The vision measurement method based on STP model coordinate calibration is characterized by comprising an STP model data module, a coordinate calibration module, a motion control module, a vision detection module and a result processing module, and comprising the following steps: Step 1, importing an STP model, setting a reference plane and a coordinate system, selecting a tolerance configuration parameter for detecting geometric features and importing the geometric features, and finally outputting a new coordinate system of the STP model and coordinates of the geometric features under the reference plane ; Step 2, calculating the coordinates of the geometric features under the new coordinate system of the STP model through nine-point calibration And coordinates in the motion mechanism coordinate system Conversion relation between them, solving coordinates And coordinates Homogeneous transformation matrix of (b) Thereby establishing a corresponding relation between the two coordinate systems and realizing the alignment of the model and the real object; step 3, performing external parameter calibration on the vision system by adopting a high-precision calibration plate, and performing lower coordinate of a camera image coordinate system by using a feature point on the calibration plate Coordinate in the motion mechanism coordinate system Correspondingly, solving homogeneous transformation matrix between image coordinate system and motion coordinate system The unification of STP model coordinates, motion mechanism coordinates and camera coordinates is realized; Step 4, the motion control module generates a detection path and a camera shooting position file according to geometric feature coordinates and tolerance information in the STP model; and 5, comparing the geometric feature data obtained by visual processing with product tolerance parameters by a result processing module, and judging whether the detection result is qualified or not.
- 2. The vision measurement method based on STP model coordinate calibration according to claim 1, wherein in step 1, the STP model data module is configured to parse the imported STP model file, and extract geometrical features of vision detection on the workpiece including cylindrical surface, hole site, corner point and plane.
- 3. A vision measurement method based on STP model coordinate calibration as defined in claim 2, characterized in that a new coordinate system is defined according to a user-set reference plane Importing tolerance configuration parameters of corresponding geometric features, and generating each detection geometric feature in a coordinate system Lower coordinates The output data are used for subsequent coordinate calibration and visual detection path planning.
- 4. A vision measurement method based on STP model coordinate calibration as defined in claim 1, wherein in step 2, at least 9 feature points are selected on the surface of the workpiece, namely corresponding to geometric feature coordinates respectively And motion mechanism coordinates , wherein, ; By calculating geometrical feature coordinates Coordinate with movement mechanism Rotation matrix between Translation vector To build homogeneous transformation matrix from model coordinates to motion coordinates , I.e. Wherein 。
- 5. The vision measurement method based on STP model coordinate calibration as defined in claim 4, wherein the coordinates of one of the geometric features and the coordinates of the motion mechanism are taught, and the other geometric features can be based on a transformation matrix And carrying out true-value teaching compensation on the coordinates of the determined geometric features and the coordinates of the motion mechanism, and calculating photographing positions of all feature points under the motion coordinates.
- 6. The vision measurement method based on STP model coordinate calibration according to claim 1, wherein the calculation mode of the relation between the image coordinate system and the motion coordinate system in step 3 is the same as the calculation mode of the relation between the coordinates of the geometric feature in the new coordinate system of the STP model and the coordinates in the motion mechanism coordinate system in step 2.
- 7. The vision measurement method based on STP model coordinate calibration according to claim 1, wherein in the step 4, a detection task path is planned and generated based on the XY direction according to the U-shaped path and the minimum number of movements, the movement control module drives the 3D vision camera to move to the photographing position of each feature point, and the vision detection module collects images.
- 8. The vision measurement method based on STP model coordinate calibration according to claim 7, wherein the standard height of geometric features is used for gray threshold segmentation to effectively remove interference, then the blob region growing median is used for extracting detection features, namely connected pixel regions, and the circle features and tukey algorithm planes are fitted to the extracted regions by using geohuber algorithm, so that diameter, geometric surface to bottom surface height and angle information of the circle are calculated.
- 9. The vision measurement method based on STP model coordinate calibration according to claim 1, wherein in step 5, a detection report is output, and statistical analysis and qualification rate statistical information are performed on the deviation data.
- 10. A vision measurement method based on STP model coordinate calibration as defined in claim 1, wherein the coordinate calibration module automatically updates the coordinate transformation matrix according to different STP models.
Description
Visual measurement method based on STP model coordinate calibration Technical Field The invention relates to the field of industrial automatic detection technology application, in particular to a vision measurement method based on STP model coordinate calibration. Background With the development of industrial automation and intelligent manufacturing technology, the requirements on the measurement of the size, shape and assembly precision of workpieces in the industrial production process are higher and higher. Traditional measuring methods mainly depend on manual measurement, mechanical measuring tools or simple digital sensors, and are low in efficiency, limited in precision, easy to influence by human factors and difficult to meet the requirements of modern manufacturing industry on mass production, precision requirements and real-time feedback. As a non-contact precision measurement means, vision measurement technology has been widely used in the fields of industrial inspection and automated manufacturing in recent years. Compared with the traditional contact type measurement mode, the visual measurement has the remarkable advantages of high detection speed, high measurement precision, adaptability to complex structures, easiness in realizing automation and the like, and particularly higher efficiency and flexibility are shown in the complex part detection and mass production process. However, existing vision measurement systems still have limitations in facing multiple inspection items or high precision inspection requirements. When a small-field high-resolution camera is adopted to improve measurement accuracy, images are often required to be acquired at a plurality of photographing positions respectively, so that the photographing and positioning process is complicated, and the requirement of quick online application is difficult to meet. Aiming at the problems, the invention provides a vision measurement method based on STP model coordinate calibration. Disclosure of Invention In order to solve the technical problems, the invention provides a vision measurement method based on STP model coordinate calibration, which realizes three-coordinate system unification by establishing a unified calibration relation among an STP model coordinate system, a motion mechanism coordinate system and a camera coordinate system, and enables the vision system to be automatically positioned to a detection position according to an STP model by a multi-point calibration and transformation technology, thereby realizing rapid identification and accurate measurement of workpiece features The technical scheme of the invention is that the vision measurement method based on STP model coordinate calibration comprises an STP model data module, a coordinate calibration module, a motion control module, a vision detection module and a result processing module, and comprises the following steps: Step 1, importing an STP model, setting a reference plane and a coordinate system, selecting a tolerance configuration parameter for detecting geometric features and importing the geometric features, and finally outputting a new coordinate system of the STP model and coordinates of the geometric features under the reference plane ; Step 2, calculating the coordinates of the geometric features under the new coordinate system of the STP model through nine-point calibrationAnd coordinates in the motion mechanism coordinate systemConversion relation between them, solving coordinatesAnd coordinatesHomogeneous transformation matrix of (b)Thereby establishing a corresponding relation between the two coordinate systems and realizing the alignment of the model and the real object; step 3, performing external parameter calibration on the vision system by adopting a high-precision calibration plate, and performing lower coordinate of a camera image coordinate system by using a feature point on the calibration plate Coordinate in the motion mechanism coordinate systemCorrespondingly, solving homogeneous transformation matrix between image coordinate system and motion coordinate systemThe unification of STP model coordinates, motion mechanism coordinates and camera coordinates is realized; Step 4, the motion control module generates a detection path and a camera shooting position file according to geometric feature coordinates and tolerance information in the STP model; and 5, comparing the geometric feature data obtained by visual processing with product tolerance parameters by a result processing module, and judging whether the detection result is qualified or not. Further, in the step 1, the STP model data module is configured to parse the imported STP model file, and extract geometric features of visual detection on the workpiece, including a cylindrical surface, a hole site, a corner point and a plane. Further, a new coordinate system is defined according to the reference plane set by the userImporting tolerance configuration parameters of correspond