CN114549408A - Position size comparison method based on graphic image - Google Patents

Position size comparison method based on graphic image Download PDF

Info

Publication number
CN114549408A
CN114549408A CN202210029494.0A CN202210029494A CN114549408A CN 114549408 A CN114549408 A CN 114549408A CN 202210029494 A CN202210029494 A CN 202210029494A CN 114549408 A CN114549408 A CN 114549408A
Authority
CN
China
Prior art keywords
coordinate system
point
coordinates
finished product
hole
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210029494.0A
Other languages
Chinese (zh)
Inventor
秦志英
赵月静
张鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei University of Science and Technology
Original Assignee
Hebei University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hebei University of Science and Technology filed Critical Hebei University of Science and Technology
Priority to CN202210029494.0A priority Critical patent/CN114549408A/en
Publication of CN114549408A publication Critical patent/CN114549408A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0006Industrial image inspection using a design-rule based approach
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/002Measuring arrangements characterised by the use of optical techniques for measuring two or more coordinates
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/08Measuring arrangements characterised by the use of optical techniques for measuring diameters
    • G01B11/12Measuring arrangements characterised by the use of optical techniques for measuring diameters internal diameters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/168Segmentation; Edge detection involving transform domain methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C3/00Registering or indicating the condition or the working of machines or other apparatus, other than vehicles
    • G07C3/14Quality control systems
    • G07C3/143Finished product quality control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20061Hough transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Automation & Control Theory (AREA)
  • Machine Tool Sensing Apparatuses (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a position and size comparison method based on a graphic image, which comprises the steps of obtaining a design size through a graphic file, calibrating pixel equivalent, collecting an image file of a processed finished product, extracting a position and a size from an image of the processed finished product, calculating and correcting the pixel equivalent, converting the position and the size of the processed finished product from a pixel coordinate system to a processing coordinate system, establishing the processing coordinate system, realizing the conversion from a world coordinate system to the processing coordinate system, and detecting the precision of a processed workpiece. The invention solves the problem of comparison between hole characteristic fitting size data and design size data, analyzes the comparison method and errors of position coordinates and diameter sizes of all holes after sequencing, can quickly and accurately detect the hole machining position size errors in batches, and saves the cost.

Description

Position size comparison method based on graphic image
Technical Field
The invention relates to a position size comparison method, in particular to a position size comparison method based on a graphic image.
Background
Mechanical parts are generally processed according to design drawings, and when the detection mode of a processed finished product is manual detection, the requirements of processing standards are difficult to meet, and the installation quality of a mechanical device cannot be guaranteed. For a space truss structure with a large number of connecting members and a large volume like an iron tower, a large number of holes which are irregularly arranged at positions need to be machined on the connecting members, the position and size precision of the holes on the connecting members must meet the machining requirement, otherwise, the installation quality is greatly influenced. For the components, manual inspection consumes time and labor, and has large detection errors, so that a method for comparing the position and the size of the contour of the finished product in batch, which can be quickly and accurately detected, is urgently needed.
Disclosure of Invention
The invention provides a position size comparison method based on a graphic image.
In order to solve the technical problems, the technical scheme provided by the invention is as follows:
a position size comparison method based on a graphic image comprises the following steps:
step 1: obtaining a design size through a graphic file: the design size comprises the number of contour edge points, the design number o of holes, the center design coordinate and the design diameter of each hole and the design coordinate of each contour edge point;
and 2, step: calibrating pixel equivalent: the calibration plate is parallel to the machine vision acquisition equipment; the pixel equivalent is the ratio K' of the actual length of the calibration line segment to the corresponding pixel distance of the calibration line segment in the image;
and step 3: collecting an image file of a processed finished product: acquiring an image file of a processed finished product by using the machine vision acquisition equipment calibrated in the step 2, wherein the processed finished product and the machine vision acquisition equipment are placed in parallel;
and 4, step 4: extracting position and size from the finished product image: extraction ofThe number m of contour edge points and the number of holes to be processed of the finished product
Figure 100002_DEST_PATH_IMAGE001
Figure 100002_DEST_PATH_IMAGE002
Detecting the pixel coordinates of edge points of each contour, the central pixel coordinates of each hole and the pixel diameter;
and 5: calculating a corrected pixel equivalent
Figure 100002_DEST_PATH_IMAGE004
Figure 100002_DEST_PATH_IMAGE006
Figure 100002_DEST_PATH_IMAGE008
Is the distance between the camera and the finished product,
Figure 100002_DEST_PATH_IMAGE010
the thickness of the finished product is processed;
step 6: converting the position and size of the finished product from the pixel coordinate system to the machining coordinate system: converting the pixel coordinates of the edge points of each contour of the finished product and the central pixel coordinates of each hole into coordinates under a world coordinate system:
Figure 100002_DEST_PATH_IMAGE012
in the formula
Figure 100002_DEST_PATH_IMAGE014
Coordinates in a world coordinate system;
Figure 100002_DEST_PATH_IMAGE016
is a coordinate in a pixel coordinate system;
converting the pixel diameter of each hole into a corresponding processing diameter under a world coordinate system;
Figure 100002_DEST_PATH_IMAGE018
and 7: establishing a machining coordinate system:
step 7-1: selecting a point A closest to an X axis of a world coordinate system and a point B closest to a Y axis of the world coordinate system;
step 7-2: selecting an edge point adjacent to the point A along the anticlockwise direction as a point C; judging whether the point B is collinear with the point A and the point C; if yes, turning to step 7-3, otherwise, turning to step 7-4;
and 7-3: selecting a point adjacent to the point A along the clockwise direction as a point C;
and 7-4: calculating the tilt angle
Figure 100002_DEST_PATH_IMAGE020
Figure 100002_DEST_PATH_IMAGE022
Wherein a is the slope of a straight line L1 passing through the point A and the point C;
and 7-5: a straight line L2 passing through the point B and perpendicular to the straight line L1 is established;
and 7-6: the origin of the machining coordinate system is determined by the simultaneous straight line L1 and straight line L2
Figure 100002_DEST_PATH_IMAGE024
Coordinates in the world coordinate system
Figure 100002_DEST_PATH_IMAGE026
And 8: and (3) realizing the conversion from a world coordinate system to a machining coordinate system:
Figure 100002_DEST_PATH_IMAGE028
in the formula (I), the compound is shown in the specification,
Figure 100002_DEST_PATH_IMAGE030
Figure 100002_DEST_PATH_IMAGE032
Figure DEST_PATH_IMAGE020A
is the rotation angle;
Figure DEST_PATH_IMAGE026A
is the origin of the machining coordinate system;
Figure 100002_DEST_PATH_IMAGE034
is the coordinate of the processing coordinate system;
Figure DEST_PATH_IMAGE014A
coordinates of a world coordinate system;
and step 9: detecting the precision of the processed workpiece:
step 9-1: comparing the center design coordinates of each hole of the finished product with the corresponding center processing coordinates, calculating the position error of each hole one by one, judging whether the position error is greater than a preset hole position error value, and if the position of the hole greater than the preset hole position error value appears, judging that the finished product is an unqualified product;
step 9-2: and comparing the diameter design coordinates of the holes of the processed finished product with the corresponding diameter processing coordinates, calculating the diameter errors one by one, judging whether the diameter errors are larger than the preset diameter error value, and if the holes larger than the preset diameter error value appear, judging that the processed finished product is an unqualified product.
Further, in step 1, the design size is obtained by loading a DXF graphic file, starting scanning the group code and the group value from the beginning of the text file, searching the start mark of the entity segment, if the read group code is 0 and the group value is EOF, immediately ending the file scanning, or scanning until the group code is 0 and the group value is SECTION; when the group code and the group value are code segment identifiers, if the group code, the group value and the event corresponding to the segment are 2 and entites, the segment is judged as an entity segment, and the following group code and the group value are continuously read; when the read group code is 0, judging the corresponding group value character string, if the character string is LINE, indicating that the part is the relevant data information of the straight LINE; if the part is CIRCLE, the data information is related to the CIRCLE; and POINT indicates the relevant data information of the POINT.
Further, in the step 2, the calibration plate comprises n holes, n>1, average pixel equivalent
Figure 100002_DEST_PATH_IMAGE036
The calculation method of (c) is as follows:
Figure 100002_DEST_PATH_IMAGE038
lito calibrate the actual distance between the ith and (i + 1) th wells on the plate, piIs the pixel center distance between the ith and (i + 1) th wells on the calibration plate.
Further, in step 9, the hole position error calculation method includes:
Figure 100002_DEST_PATH_IMAGE040
in the formula (I), the compound is shown in the specification,
Figure 100002_DEST_PATH_IMAGE042
and
Figure 100002_DEST_PATH_IMAGE044
respectively designing coordinates for the center of the hole and processing coordinates for the center of the hole;
the diameter error is:
Figure 100002_DEST_PATH_IMAGE046
in the formula (I), the compound is shown in the specification,
Figure 100002_DEST_PATH_IMAGE048
and
Figure DEST_PATH_IMAGE050
respectively the design diameter and the machining diameter of the hole.
By adopting the technical scheme, the invention has the beneficial effects that:
1. according to the invention, the machine vision image is used for replacing manual detection of the precision of the machined workpiece, so that the error caused by manual operation can be reduced;
the position size comparison is carried out by using the DXF graphic file, the integrated management of design data and processing quality can be realized, the waste of manpower and material resources is reduced, and the cost is saved for factory production.
Drawings
FIG. 1 is a schematic diagram of a calibration pixel equivalent of a machine vision acquisition device according to embodiment 1 of the present invention;
FIG. 2 is a schematic diagram of an embodiment 1 of the present invention illustrating a counterclockwise rotation of a processing coordinate system relative to a world coordinate system;
FIG. 3 is a schematic diagram of a clockwise rotation of the processing coordinate system relative to the world coordinate system in embodiment 1 of the present invention;
FIG. 4 is a drawing of a graphic according to a design size in a graphic file according to embodiment 1 of the present invention;
FIG. 5 is a schematic diagram of hole position error calculation according to example 1 of the present invention;
FIG. 6 is a schematic diagram showing the calculation of the error in the diameter dimension of the hole in example 1 of the present invention;
wherein:
1-machine vision acquisition equipment; 2-processing a finished product; 3-calibrating the position of the plate; 4-a table plane; 5-design diameter; 6-machining diameter.
Detailed Description
Example 1:
a position size comparison method based on a graphic image comprises the following steps:
step 1: obtaining a design size through a graphic file: the design size comprises the number of contour edge points, the design number o of holes, the center design coordinate and the design diameter of each hole, and the design coordinate of each contour edge point;
in the step 1, the design size is obtained by loading a DXF graphic file, starting scanning the group code and the group value from the beginning of the text file, searching the start mark of the entity segment, if the read group code is 0 and the group value is EOF, immediately ending the file scanning, and if not, scanning until the group code is 0 and the group value is SECTION; when the group code and the group value are code segment identifiers, if the group code, the group value and the event corresponding to the segment are 2 and entites, the segment is judged as an entity segment, and the following group code and the group value are continuously read; when the read group code is 0, judging the corresponding group value character string, and if the read group code is LINE, indicating that the part is relevant data information of a straight LINE; if the part is CIRCLE, the data information is related to the CIRCLE; and POINT indicates the relevant data information of the POINT.
Step 2: calibrating pixel equivalent: the calibration plate is parallel to the machine vision acquisition equipment; the pixel equivalent is the ratio of the actual length of the calibration line segment to the corresponding pixel distance in the image
Figure DEST_PATH_IMAGE036A
The calibration plate comprises n holes, n>1, average pixel equivalent
Figure DEST_PATH_IMAGE036AA
The calculation method of (c) is as follows:
Figure DEST_PATH_IMAGE038A
lito calibrate the actual distance between the ith and (i + 1) th wells on the plate, piIs the pixel center distance between the ith and (i + 1) th wells on the calibration plate.
And step 3: collecting an image file of a processed finished product: acquiring an image file of a processed finished product by using the machine vision acquisition equipment calibrated in the step 2, wherein the processed finished product and the machine vision acquisition equipment are placed in parallel;
and 4, step 4: extracting position and size from the finished product image: extracting the number m of contour edge points and the processing number of holes of the processed finished product
Figure 241238DEST_PATH_IMAGE001
Figure 548591DEST_PATH_IMAGE002
Detecting the pixel coordinates of edge points of each contour, the central pixel coordinates of each hole and the pixel diameter;
and 5: calculating a corrected pixel equivalent
Figure DEST_PATH_IMAGE004A
Figure DEST_PATH_IMAGE006A
Figure DEST_PATH_IMAGE008A
Is the distance between the camera and the finished product,
Figure DEST_PATH_IMAGE010A
the thickness of the finished product is processed;
step 6: converting the position and size of the finished product from the pixel coordinate system to the machining coordinate system: converting the pixel coordinates of the edge points of each contour of the finished product and the central pixel coordinates of each hole into coordinates under a world coordinate system:
Figure DEST_PATH_IMAGE012A
in the formula (x)w,yw) Coordinates in a world coordinate system; (u, v) are coordinates in a pixel coordinate system;
converting the pixel diameter of each hole into a corresponding processing diameter under a world coordinate system;
Figure DEST_PATH_IMAGE018A
and 7: establishing a machining coordinate system:
step 7-1: selecting a point A closest to an X axis of a world coordinate system and a point B closest to a Y axis of the world coordinate system;
step 7-2: selecting an edge point adjacent to the point A along the counterclockwise direction as a point C; judging whether the point B is collinear with the point A and the point C; if yes, turning to step 7-3, otherwise, turning to step 7-4;
and 7-3: selecting a point adjacent to the point A along the clockwise direction as a point C;
and 7-4: calculating the tilt angle
Figure DEST_PATH_IMAGE020AA
Figure 100002_DEST_PATH_IMAGE022A
Wherein a is the slope of a straight line L1 passing through the point A and the point C;
and 7-5: a straight line L2 passing through the point B and perpendicular to the straight line L1 is established;
and 7-6: the origin of the machining coordinate system is obtained from the straight line L1 and the straight line L2
Figure DEST_PATH_IMAGE024A
Coordinates in the world coordinate system
Figure DEST_PATH_IMAGE026AA
And 8: and (3) realizing the conversion from a world coordinate system to a machining coordinate system:
Figure DEST_PATH_IMAGE028A
in the formula (I), the compound is shown in the specification,
Figure DEST_PATH_IMAGE030A
Figure DEST_PATH_IMAGE032A
Figure DEST_PATH_IMAGE020AAA
is the rotation angle;
Figure DEST_PATH_IMAGE026AAA
is the origin of the machining coordinate system;
Figure DEST_PATH_IMAGE034A
is the coordinate of the processing coordinate system;
Figure DEST_PATH_IMAGE014AA
coordinates of a world coordinate system;
and step 9: detecting the precision of the processed workpiece:
step 9-1: comparing the center design coordinates of each hole of the finished product with the corresponding center processing coordinates, calculating the position error of each hole one by one, judging whether the position error is greater than a preset hole position error value, and if the position of the hole greater than the preset hole position error value appears, judging that the finished product is an unqualified product;
step 9-2: and comparing the diameter design coordinates of the holes of the processed finished product with the corresponding diameter processing coordinates, calculating the diameter errors one by one, judging whether the diameter errors are larger than the preset diameter error value, and if the holes larger than the preset diameter error value appear, judging that the processed finished product is an unqualified product.
The embodiment aims at the characteristics of large scale of iron tower component processing production and few detection covering samples, and adopts a graphic object method to realize the automatic detection of the position size of the iron tower component processing hole. The embodiment realizes image characteristic edge extraction based on a Zernike moment sub-pixel edge detection algorithm; the method adopts a least square method to fit the hole edge, improves the Hough transformation straight line detection algorithm through a pixel point clustering method, and solves the problem of incomplete identification of the outer contour line segment. The method has the advantages that structural composition of the DXF file is analyzed, a size data extraction process is formulated, the feature data are converted into world coordinates from pixel coordinates, and then further converted into machining coordinates, the purpose of hole making size comparison of the iron tower component based on the DXF file is achieved, and the position size of the iron tower component after feature hole machining measurement is detected.
The pixel equivalent method utilizes a high-precision object with a known size to obtain the pixel size of the object after being shot by a camera, and calculates the actual physical size corresponding to each pixel unit, thereby obtaining the corresponding relation between the actual physical size and the pixel distance size. This embodiment is achieved byHough circle detection is used for identifying each circle on the circular array calibration target, calculating the circle center position of each circle, then calculating the center pixel distance of each circle in the horizontal direction and the vertical direction, and then respectively calculating the ratio relation between the actual physical size and the pixel distance size between adjacent circle centers to obtain the pixel equivalent value between the adjacent circle centers. To reduce the effect of accidental errors, the present embodiment calculates the average value of all pixel equivalent values as the pixel equivalent of the camera under the current plane of the calibration plate. In this embodiment, when the calibration plate is placed on the workbench for calibration, the plane of the calibration plate and the plane of the workpiece to be measured are not located on the same plane due to the fact that the workpiece has a certain thickness. If the pixel equivalent of the calibration plate is directly used for calculation, the calculated average pixel equivalent value at the surface height of the workpiece is inaccurate. The distance between the known camera and the plane of the workpiece to be measured is
Figure DEST_PATH_IMAGE008AA
The distance between the calibration plane and the plane of the workpiece to be measured is
Figure DEST_PATH_IMAGE052
I.e. the thickness of the workpiece to be measured. The actual physical size of the center distance of any group of circles in the plane of the calibration plate is assumed to be
Figure DEST_PATH_IMAGE054
The actual physical dimension at the inspection plane of the workpiece corresponds to
Figure DEST_PATH_IMAGE056
. Converting the actual physical size measured by the calibration board to obtain the actual physical size corresponding to the detection plane of the workpiece to be measured, calculating the pixel equivalent value,
Figure DEST_PATH_IMAGE056A
and
Figure DEST_PATH_IMAGE054A
the conversion of (d) is as follows:
Figure DEST_PATH_IMAGE058
setting the pixel distance between each hole on the calibration plate to be
Figure DEST_PATH_IMAGE060
Then, then
Figure DEST_PATH_IMAGE062
Average pixel equivalent at group pixel equivalent value
Figure DEST_PATH_IMAGE004AA
The calculation method of (c) is as follows:
Figure DEST_PATH_IMAGE064
world coordinate system (O)w-XwYwZw): the world coordinate system is an absolute coordinate system in a real environment, and is used for describing the position of the camera, and the world coordinate system is established at a position vertical to the workbench to facilitate the detection of the workpiece. Certain displacement and angle deviation exist between the world coordinate system and the processing coordinate system, so that the world coordinate of the workpiece to be detected needs to be transformed, and the characteristic dimension data of the workpiece to be detected in the processing coordinate system can be obtained. The world coordinate system is rotated by a specific angle and then is followed
Figure DEST_PATH_IMAGE066
Shaft and
Figure DEST_PATH_IMAGE068
after the axis direction is translated for a certain distance, the conversion from the world coordinate system to the workpiece machining coordinate system is realized. During detection, the placing positions of the workpieces are generally shifted clockwise and anticlockwise. Establishing a coordinate system on the workpiece, assuming an offset angle of
Figure DEST_PATH_IMAGE070
World coordinate system
Figure DEST_PATH_IMAGE072
The machining coordinate system of the workpiece after transformation
Figure DEST_PATH_IMAGE074
The process of the transformation step of the object coordinate system is as follows:
referring to fig. 2-3, the origin in the machining coordinate system is
Figure DEST_PATH_IMAGE026AAAA
Edge of work
Figure DEST_PATH_IMAGE076
If the coordinates of the points are known, a straight line is obtained
Figure DEST_PATH_IMAGE078
Slope of (2)
Figure DEST_PATH_IMAGE080
Figure DEST_PATH_IMAGE082
Angle of inclination
Figure DEST_PATH_IMAGE070A
Figure DEST_PATH_IMAGE022AA
The origin of the machining coordinate system can be obtained by a simultaneous straight line formula
Figure DEST_PATH_IMAGE024AA
Coordinates in world coordinates
Figure DEST_PATH_IMAGE026_5A
Figure DEST_PATH_IMAGE084
Figure DEST_PATH_IMAGE086
In this embodiment, the finished product is a steel tower member, and all the point edges of the steel tower member in the world coordinate system
Figure DEST_PATH_IMAGE088
Axial negative translation
Figure DEST_PATH_IMAGE090
Unit of coordinate, parallel edge
Figure DEST_PATH_IMAGE092
Axial negative translation
Figure DEST_PATH_IMAGE094
The coordinates of the iron tower member after translation are all rotated by an angle in each coordinate unit
Figure DEST_PATH_IMAGE070AA
The transformation between the world coordinate system and the workpiece machining coordinate system can be completed. The coordinate system transformation calculation expression is:
Figure DEST_PATH_IMAGE096
when the utility model is placed in a counter-clockwise way,
Figure DEST_PATH_IMAGE070AAA
when the utility model is positive and placed clockwise,
Figure DEST_PATH_IMAGE070AAAA
is negative.
After the transformation of the coordinate system is completed, calculating the size error of the iron tower component hole making is the last step for realizing whether the workpiece is qualified or not. The measurement parameters of the iron tower component hole making include the position and the diameter size of each processing hole on the surface, and the workpiece can be judged to be qualified only when the position error and the diameter size error of each processing hole are within the allowable range. The positions and the diameters of hole making designs of iron tower components with different models are different, and in order to ensure that error values calculated by all holes have real reference significance, before the error of each hole is calculated, the sequence number matching of each hole after image recognition and DXF file extraction is carried out. In the embodiment, the origin of the workpiece processing coordinate system of the identification image is aligned and matched with the origin of the design coordinate system in the DXF file, and the comparison method is more suitable for the actual condition of workpiece processing in a factory. The workpiece machining coordinate system and the DXF file design coordinate system in an ideal state have the same original point and coordinate axis directions, but the workpiece machining coordinate system and the DXF file coordinate system cannot be completely superposed due to the factors that the edge machining of a steel plate of an iron tower member is not standard or the workpiece is not aligned with a top plate during machining and installation, and the like, and detection errors can also be caused. The sequencing mode of all the measurement holes is as follows: the hole serial numbers are integrally arranged from small to large according to the size of the abscissa value of the center of each hole, and then are arranged from large to small according to the ordinate value.
The hole position error is calculated as follows:
Figure DEST_PATH_IMAGE098
in practical cases, the origin and coordinate axes between the machining coordinate system of the workpiece and the DXF file design coordinate system
Incomplete coincidence exists, an angle error and a displacement error exist in the two coordinate systems, and the error calculation is carried out as follows:
assume that the angle between the two coordinate systems is
Figure DEST_PATH_IMAGE070_5A
The circle center position of the circular hole in the workpiece processing coordinate system is detected as
Figure DEST_PATH_IMAGE100
And calculating the coordinates in the DXF file design coordinate system as follows:
Figure DEST_PATH_IMAGE102
the hole position error is calculated as follows:
Figure DEST_PATH_IMAGE040A
after the position error of each hole of the workpiece is calculated, the maximum error of the hole is used as the judgment whether the hole is qualified or not
And judging each hole according to the failure criterion, and judging that the hole is unqualified when the error value is greater than the maximum error by 0.5mm, so that the workpiece to be detected is an unqualified product.
The hole diameter measurement is to calculate the error value of each hole diameter, and the error value calculated by judging is
Whether the diameter of the hole is qualified or not is judged within an allowable range. Suppose that the DXF file hole diameter and the inspection hole diameter of the workpiece are respectively
Figure DEST_PATH_IMAGE048A
And
Figure DEST_PATH_IMAGE104
then the diameter error is:
Figure DEST_PATH_IMAGE046A

Claims (4)

1. a position size comparison method based on a graphic image is characterized by comprising the following steps:
step 1: obtaining a design size through a graphic file: the design size comprises the number of contour edge points, the design number o of holes, the center design coordinate and the design diameter of each hole and the design coordinate of each contour edge point;
step 2: calibrating pixel equivalent: the calibration plate is parallel to the machine vision acquisition equipment; the pixel equivalent is the ratio K' of the actual length of the calibration line segment to the corresponding pixel distance of the calibration line segment in the image;
and step 3: collecting an image file of a processed finished product: acquiring an image file of a processed finished product by using the machine vision acquisition equipment calibrated in the step 2, wherein the processed finished product and the machine vision acquisition equipment are placed in parallel;
and 4, step 4: extracting position and size from the finished product image: extracting the number m of contour edge points and the processing number of holes of the processed finished product
Figure DEST_PATH_IMAGE001
Figure DEST_PATH_IMAGE002
Detecting the pixel coordinates of edge points of each contour, the central pixel coordinates of each hole and the pixel diameter;
and 5: calculating a corrected pixel equivalent
Figure DEST_PATH_IMAGE004
Figure DEST_PATH_IMAGE006
Figure DEST_PATH_IMAGE008
Is the distance between the camera and the finished product,
Figure DEST_PATH_IMAGE010
the thickness of the finished product is processed;
step 6: converting the position and size of the finished product from the pixel coordinate system to the machining coordinate system: converting the pixel coordinates of each contour edge point of the finished product and the central pixel coordinates of each hole into coordinates under a world coordinate system:
Figure DEST_PATH_IMAGE012
in the formula (x)w,yw) In the world coordinate systemThe coordinates of (a); (u, v) are coordinates in a pixel coordinate system;
converting the pixel diameter of each hole into a corresponding processing diameter under a world coordinate system;
Figure DEST_PATH_IMAGE014
and 7: establishing a machining coordinate system:
step 7-1: selecting a point A closest to an X axis of a world coordinate system and a point B closest to a Y axis of the world coordinate system;
step 7-2: selecting an edge point adjacent to the point A along the counterclockwise direction as a point C; judging whether the point B is collinear with the point A and the point C; if yes, turning to step 7-3, otherwise, turning to step 7-4;
and 7-3: selecting a point adjacent to the point A along the clockwise direction as a point C;
and 7-4: calculating the tilt angle
Figure DEST_PATH_IMAGE016
Figure DEST_PATH_IMAGE018
Wherein a is the slope of a straight line L1 passing through the point A and the point C;
and 7-5: a straight line L2 passing through the point B and perpendicular to the straight line L1 is established;
and 7-6: the origin of the machining coordinate system is determined by the simultaneous straight line L1 and straight line L2
Figure DEST_PATH_IMAGE020
Coordinates in the world coordinate System
Figure DEST_PATH_IMAGE022
And 8: and (3) realizing the conversion from a world coordinate system to a machining coordinate system:
Figure DEST_PATH_IMAGE024
in the formula (I), the compound is shown in the specification,
Figure DEST_PATH_IMAGE026
Figure DEST_PATH_IMAGE028
Figure DEST_PATH_IMAGE016A
is the rotation angle;
Figure DEST_PATH_IMAGE022A
is the origin of the machining coordinate system;
Figure DEST_PATH_IMAGE030
is the coordinate of the processing coordinate system;
Figure DEST_PATH_IMAGE032
coordinates of a world coordinate system;
and step 9: detecting the precision of the processed workpiece:
step 9-1: comparing the center design coordinates of each hole of the finished product with the corresponding center processing coordinates, calculating the position error of each hole one by one, judging whether the position error is greater than a preset hole position error value, and if the position of the hole greater than the preset hole position error value appears, judging that the finished product is an unqualified product;
step 9-2: and comparing the diameter design coordinates of the holes of the processed finished product with the corresponding diameter processing coordinates, calculating the diameter errors one by one, judging whether the diameter errors are larger than the preset diameter error value, and if the holes larger than the preset diameter error value appear, judging that the processed finished product is an unqualified product.
2. The method according to claim 1, wherein in step 1, the design size is obtained by loading a DXF graphic file, starting with scanning a group code and a group value from the beginning of the text file, searching for a start mark of a solid segment, and if the read group code is 0 and the group value is EOF, immediately ending the file scanning, otherwise, scanning until the group code is 0 and the group value is SECTION; when the group code and the group value are code segment identifiers, if the group code, the group value and the event corresponding to the segment are 2 and entites, the segment is judged as an entity segment, and the following group code and the group value are continuously read; when the read group code is 0, judging the corresponding group value character string, if the character string is LINE, indicating that the part is the relevant data information of the straight LINE; if the part is CIRCLE, the data information is related to the CIRCLE; and POINT indicates the relevant data information of the POINT.
3. The method according to claim 1, wherein the method further comprises: the calibration plate comprises n holes, n>1, average pixel equivalent
Figure DEST_PATH_IMAGE034
The calculation method of (c) is as follows:
Figure DEST_PATH_IMAGE036
lito calibrate the actual distance between the ith and (i + 1) th wells on the plate, piIs the pixel center distance between the ith and (i + 1) th wells on the calibration plate.
4. The method according to claim 1, wherein the comparing step comprises:
the hole position error calculation method comprises the following steps:
Figure DEST_PATH_IMAGE038
in the formula (I), the compound is shown in the specification,
Figure DEST_PATH_IMAGE040
and
Figure DEST_PATH_IMAGE042
respectively designing coordinates for the center of the hole and processing coordinates for the center of the hole;
the diameter error is:
Figure DEST_PATH_IMAGE044
in the formula (I), the compound is shown in the specification,
Figure DEST_PATH_IMAGE046
and
Figure DEST_PATH_IMAGE048
respectively the design diameter and the machining diameter of the hole.
CN202210029494.0A 2022-01-12 2022-01-12 Position size comparison method based on graphic image Pending CN114549408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210029494.0A CN114549408A (en) 2022-01-12 2022-01-12 Position size comparison method based on graphic image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210029494.0A CN114549408A (en) 2022-01-12 2022-01-12 Position size comparison method based on graphic image

Publications (1)

Publication Number Publication Date
CN114549408A true CN114549408A (en) 2022-05-27

Family

ID=81672041

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210029494.0A Pending CN114549408A (en) 2022-01-12 2022-01-12 Position size comparison method based on graphic image

Country Status (1)

Country Link
CN (1) CN114549408A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115035123A (en) * 2022-08-15 2022-09-09 成都三是汇科技有限公司 Method, system and device for detecting hot end of tube bottle and storage medium
CN115760860A (en) * 2023-01-05 2023-03-07 广东技术师范大学 Multi-type workpiece dimension visual measurement method based on DXF file import
CN117405054A (en) * 2023-10-26 2024-01-16 浙江巨丰模架有限公司 On-line detection method and system for precision of die carrier precision based on three-coordinate measurement
CN117968522A (en) * 2023-12-08 2024-05-03 盐城市日盛机械有限公司 Flywheel detection system and detection method for flywheel production line
CN117968522B (en) * 2023-12-08 2024-07-30 盐城腾鸿金属制品有限公司 Flywheel detection system and detection method for flywheel production line

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115035123A (en) * 2022-08-15 2022-09-09 成都三是汇科技有限公司 Method, system and device for detecting hot end of tube bottle and storage medium
CN115760860A (en) * 2023-01-05 2023-03-07 广东技术师范大学 Multi-type workpiece dimension visual measurement method based on DXF file import
CN117405054A (en) * 2023-10-26 2024-01-16 浙江巨丰模架有限公司 On-line detection method and system for precision of die carrier precision based on three-coordinate measurement
CN117405054B (en) * 2023-10-26 2024-04-30 浙江巨丰模架有限公司 On-line detection method and system for precision of die carrier precision based on three-coordinate measurement
CN117968522A (en) * 2023-12-08 2024-05-03 盐城市日盛机械有限公司 Flywheel detection system and detection method for flywheel production line
CN117968522B (en) * 2023-12-08 2024-07-30 盐城腾鸿金属制品有限公司 Flywheel detection system and detection method for flywheel production line

Similar Documents

Publication Publication Date Title
CN114549408A (en) Position size comparison method based on graphic image
CN114037675B (en) Airplane sample plate defect detection method and device
CN111047588A (en) Imaging measurement method for size of shaft type small part
CN112614098B (en) Blank positioning and machining allowance analysis method based on augmented reality
CN111062940B (en) Screw positioning and identifying method based on machine vision
CN114799849B (en) Screw machine operation parameter acquisition and analysis system based on machine vision
JP2008036918A (en) Screen printing equipment, and method for image recognition and alignment
CN112729112B (en) Engine cylinder bore diameter and hole site detection method based on robot vision
CN107804708A (en) A kind of pivot localization method of placement equipment feeding rotary shaft
CN109489581B (en) Large-pitch conical external thread detection device and method
CN113414248B (en) Method and device for detecting workpiece forming process
CN108627103A (en) A kind of 2D laser measurement methods of parts height dimension
CN117718799A (en) CCD online positioning online measurement and control system and method
CN105300280A (en) Connector dimension vision measurement method
CN114295056B (en) Rapid correction method and application of visual positioning system of laser processing equipment
CN112146593A (en) Machine vision-based external thread detection method and real-time detection system
CN112109374A (en) Method for positioning and controlling assembling and disassembling of bending die based on computer vision system
CN114918723B (en) Workpiece positioning control system and method based on surface detection
CN115430925B (en) Workpiece positioning method and system
CN113989513A (en) Method for recognizing reading of square pointer type instrument
CN110500951B (en) Car light glass shell size detection method based on machine vision
CN112171277B (en) Coordinate conversion method between two oblique coordinate systems
CN112223102A (en) Honing method and device based on visual positioning
CN116061438B (en) Detection system and method for 3D printing repair of blade
CN115139223B (en) Method for batch processing of parts by adopting grinding automatic processing unit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination