CN114549408A - Position size comparison method based on graphic image - Google Patents
Position size comparison method based on graphic image Download PDFInfo
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 24
- 238000013461 design Methods 0.000 claims abstract description 40
- 238000012545 processing Methods 0.000 claims abstract description 33
- 238000003754 machining Methods 0.000 claims abstract description 32
- 238000006243 chemical reaction Methods 0.000 claims abstract description 6
- 238000004364 calculation method Methods 0.000 claims description 11
- 150000001875 compounds Chemical class 0.000 claims description 7
- 239000007787 solid Substances 0.000 claims 1
- 238000012163 sequencing technique Methods 0.000 abstract description 2
- XEEYBQQBJWHFJM-UHFFFAOYSA-N Iron Chemical compound [Fe] XEEYBQQBJWHFJM-UHFFFAOYSA-N 0.000 description 20
- 238000001514 detection method Methods 0.000 description 12
- 229910052742 iron Inorganic materials 0.000 description 10
- 238000010586 diagram Methods 0.000 description 5
- 230000009466 transformation Effects 0.000 description 5
- 238000005259 measurement Methods 0.000 description 4
- 229910000831 Steel Inorganic materials 0.000 description 3
- 238000000605 extraction Methods 0.000 description 3
- 238000007689 inspection Methods 0.000 description 3
- 238000009434 installation Methods 0.000 description 3
- 239000010959 steel Substances 0.000 description 3
- 238000013519 translation Methods 0.000 description 3
- 238000006073 displacement reaction Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013075 data extraction Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/0006—Industrial image inspection using a design-rule based approach
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/002—Measuring arrangements characterised by the use of optical techniques for measuring two or more coordinates
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/08—Measuring arrangements characterised by the use of optical techniques for measuring diameters
- G01B11/12—Measuring arrangements characterised by the use of optical techniques for measuring diameters internal diameters
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/168—Segmentation; Edge detection involving transform domain methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/66—Analysis of geometric attributes of image moments or centre of gravity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/80—Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07C—TIME 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/00—Registering or indicating the condition or the working of machines or other apparatus, other than vehicles
- G07C3/14—Quality control systems
- G07C3/143—Finished product quality control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20048—Transform domain processing
- G06T2207/20061—Hough transform
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30164—Workpiece; Machine component
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing 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
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,Detecting the pixel coordinates of edge points of each contour, the central pixel coordinates of each hole and the pixel diameter;
Is the distance between the camera and the finished product,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:
in the formulaCoordinates in a world coordinate system;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;
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;
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 L2Coordinates in the world coordinate system;
And 8: and (3) realizing the conversion from a world coordinate system to a machining coordinate system:
in the formula (I), the compound is shown in the specification,,,is the rotation angle;is the origin of the machining coordinate system;is the coordinate of the processing coordinate system;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 equivalentThe calculation method of (c) is as follows:
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:
in the formula (I), the compound is shown in the specification,andrespectively designing coordinates for the center of the hole and processing coordinates for the center of the hole;
the diameter error is:
in the formula (I), the compound is shown in the specification,andrespectively 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;
The calibration plate comprises n holes, n>1, average pixel equivalentThe calculation method of (c) is as follows:
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,Detecting the pixel coordinates of edge points of each contour, the central pixel coordinates of each hole and the pixel diameter;
Is the distance between the camera and the finished product,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:
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;
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;
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 L2Coordinates in the world coordinate system;
And 8: and (3) realizing the conversion from a world coordinate system to a machining coordinate system:
in the formula (I), the compound is shown in the specification,,,is the rotation angle;is the origin of the machining coordinate system;is the coordinate of the processing coordinate system;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 isThe distance between the calibration plane and the plane of the workpiece to be measured isI.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 beThe actual physical dimension at the inspection plane of the workpiece corresponds to. 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,andthe conversion of (d) is as follows:
setting the pixel distance between each hole on the calibration plate to beThen, thenAverage pixel equivalent at group pixel equivalent valueThe calculation method of (c) is as follows:
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 followedShaft andafter 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 ofWorld coordinate systemThe machining coordinate system of the workpiece after transformationThe 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 isEdge of workIf the coordinates of the points are known, a straight line is obtainedSlope of (2):
The origin of the machining coordinate system can be obtained by a simultaneous straight line formulaCoordinates in world coordinates。
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 systemAxial negative translationUnit of coordinate, parallel edgeAxial negative translationThe coordinates of the iron tower member after translation are all rotated by an angle in each coordinate unitThe transformation between the world coordinate system and the workpiece machining coordinate system can be completed. The coordinate system transformation calculation expression is:
when the utility model is placed in a counter-clockwise way,when the utility model is positive and placed clockwise,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:
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 isThe circle center position of the circular hole in the workpiece processing coordinate system is detected asAnd calculating the coordinates in the DXF file design coordinate system as follows:
the hole position error is calculated as follows:
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 respectivelyAndthen the diameter error is:
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,Detecting the pixel coordinates of edge points of each contour, the central pixel coordinates of each hole and the pixel diameter;
Is the distance between the camera and the finished product,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:
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;
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;
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 L2Coordinates in the world coordinate System;
And 8: and (3) realizing the conversion from a world coordinate system to a machining coordinate system:
in the formula (I), the compound is shown in the specification,,,is the rotation angle;is the origin of the machining coordinate system;is the coordinate of the processing coordinate system;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 equivalentThe calculation method of (c) is as follows:
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:
in the formula (I), the compound is shown in the specification,andrespectively designing coordinates for the center of the hole and processing coordinates for the center of the hole;
the diameter error is:
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)
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 |
-
2022
- 2022-01-12 CN CN202210029494.0A patent/CN114549408A/en active Pending
Cited By (6)
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 |