CN114037676A - Workpiece target positioning hole positioning and posture judging method - Google Patents

Workpiece target positioning hole positioning and posture judging method Download PDF

Info

Publication number
CN114037676A
CN114037676A CN202111305787.9A CN202111305787A CN114037676A CN 114037676 A CN114037676 A CN 114037676A CN 202111305787 A CN202111305787 A CN 202111305787A CN 114037676 A CN114037676 A CN 114037676A
Authority
CN
China
Prior art keywords
workpiece
target
positioning
positioning hole
angle
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
CN202111305787.9A
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.)
Guilin University of Aerospace Technology
Original Assignee
Guilin University of Aerospace 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 Guilin University of Aerospace Technology filed Critical Guilin University of Aerospace Technology
Priority to CN202111305787.9A priority Critical patent/CN114037676A/en
Publication of CN114037676A publication Critical patent/CN114037676A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • 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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of pattern recognition, in particular to a workpiece target positioning hole positioning and posture judging method which is mainly realized in two steps and comprises two processes of workpiece target positioning hole positioning and workpiece target posture judging.

Description

Workpiece target positioning hole positioning and posture judging method
Technical Field
The invention relates to the technical field of pattern recognition, in particular to a workpiece target positioning hole positioning and posture judging method.
Background
With the continuous development of the intelligent manufacturing technology industry, the robot technology has become the main technical support for the intelligent production in the industrial field. Traditional robot sorting based on robot vision adopts the mode of carrying out simple teaching to the robot to go on, has strict requirements to information such as the locating position and the gesture (including the rotation angle and the inclination of work piece target) of robot and work piece, in case work piece target location, gesture, inclination change, the efficiency that can very big influence snatchs, sorts.
Disclosure of Invention
The invention aims to provide a workpiece target positioning hole positioning and posture judging method, and aims to solve the technical problem that the traditional robot based on robot vision is low in sorting and sorting efficiency.
In order to achieve the above object, the present invention provides a method for positioning a target positioning hole of a workpiece and determining an attitude thereof, comprising the steps of:
step1, acquiring a target image of a workpiece;
step 2, preprocessing the workpiece target image;
step 3, marking the circumferential outline and the circle center of the target positioning hole of the workpiece;
step 4, obtaining positioning hole circumference information and circle center coordinates;
step 5, repeating the steps 1 to 4, obtaining the circumferential outline of the target positioning hole of the workpiece, and marking the minimum circumscribed rectangle of the circumferential outline of the target positioning hole of the workpiece;
step 6, detecting whether the minimum circumscribed rectangle is a square or not,
if the detection result is square, the workpiece target is not inclined relative to the XY axis plane of the image coordinate system;
if the detection result is negative, executing the step 7;
and 7, calculating and obtaining the inclination angle and the rotation angle of the workpiece target, and finishing the judgment of the posture of the workpiece target.
Wherein, the step1 to the step 4 are the positioning process of the target positioning hole of the workpiece, and the step 5 to the step 7 are the judgment process of the target posture of the workpiece.
And preprocessing the workpiece target image by adopting a mode of enhancing image contrast and histogram processing.
The process of detecting whether the minimum circumscribed rectangle is a square or not comprises the following steps:
detecting the lengths of two adjacent sides of the minimum circumscribed rectangle;
comparing whether the lengths of the two adjacent sides are equal,
if the detection result is equal, the detection result is square;
if not, the detection result is negative.
Wherein, calculate the inclination angle and the rotation angle of acquireing the work piece target, include the following step:
judging that the minimum circumscribed rectangle is a rectangle, and marking the length of the long side and the length of the short side of the rectangle respectively;
calculating and obtaining an inclination angle relative to an XY axis plane of an image coordinate system by using the length of the long side and the length of the short side;
acquiring an included angle between the long side of the rectangle and the positive direction of the X axis of the image coordinate system;
and calculating the rotation angle according to the included angle.
And the length of the long side is the diameter length of the circumferential outline of the positioning hole.
The process of calculating the rotation angle according to the included angle comprises the following steps:
judging the size of the included angle and 90 degrees,
if the included angle is smaller than or equal to 90 degrees, the inclined angle of the workpiece relative to the X axis is equal to the included angle;
if the included angle is larger than 90 degrees, the inclined angle of the workpiece relative to the X axis is equal to 180 degrees minus the included angle.
The method for positioning the target positioning hole of the workpiece and judging the posture of the target positioning hole of the workpiece comprises two processes of positioning the target positioning hole of the workpiece and judging the posture of the target workpiece, firstly, the position of the positioning hole of the target workpiece is determined by detecting and identifying the target positioning hole of the workpiece, and then, the information of the rotating angle, the inclination angle, the diameter of the positioning hole and the like of the target workpiece is determined by detecting the side length change of an circumscribed rectangle of the positioning hole, so that the method has important significance for reducing labor cost, ensuring product quality and improving production efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for positioning a target positioning hole and determining an attitude of a workpiece according to the present invention.
Fig. 2 is a schematic diagram illustrating specific implementation steps of a method for positioning a target positioning hole and determining an attitude of a workpiece according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
Referring to fig. 1, the present invention provides a method for positioning a target positioning hole of a workpiece and determining an attitude thereof, comprising the following steps:
s1: acquiring a target image of a workpiece;
s2: preprocessing the workpiece target image;
s3: marking the circumferential outline and the circle center of the target positioning hole of the workpiece;
s4: acquiring positioning hole circumference information and circle center coordinates;
s5: repeating S1-S4 to obtain the circumferential outline of the target positioning hole of the workpiece, and marking the minimum circumscribed rectangle of the circumferential outline of the target positioning hole of the workpiece;
s6: detecting whether the minimum circumscribed rectangle is a square or not,
if the detection result is square, the workpiece target is not inclined relative to the XY axis plane of the image coordinate system;
if the detection result is negative, executing S7;
s7: and calculating and obtaining the inclination angle and the rotation angle of the workpiece target, and finishing the judgment of the posture of the workpiece target.
In this embodiment, the image of the workpiece target may be acquired by the seawell industrial camera, and the workpiece target may be projected as a foreground on the XY-axis plane of the image coordinate system.
The steps S1 to S4 are a workpiece target positioning hole positioning process, and the steps S5 to S7 are a workpiece target attitude determination process.
And in the process of preprocessing the workpiece target image, preprocessing by adopting a mode of enhancing image contrast and histogram processing.
The method for positioning the workpiece target positioning hole and judging the posture is realized by two steps, the execution flow can refer to fig. 2, the first step is to complete positioning of the workpiece target positioning hole, detect the positioning hole of the obtained foreground workpiece target, mark the circumferential outline and the circle center of the workpiece target positioning hole, and obtain the information such as the circumference and the circle center coordinate of the positioning hole; and the second step is a workpiece target posture judgment process, and the inclination angle and the rotation angle information of the foreground workpiece target are obtained through the projection of the workpiece target, so that the workpiece target posture judgment is realized.
The process for judging the target posture of the workpiece specifically comprises the following steps:
and acquiring the circumferential outline of the target positioning hole of the workpiece, and marking the minimum circumscribed rectangle of the circumferential outline of the target positioning hole of the workpiece.
If the minimum circumscribed rectangle is square at the beginning of the test, the workpiece target is not inclined relative to the XY axis plane of the image coordinate system.
The process of detecting whether the minimum circumscribed rectangle is a square or not comprises the following steps:
detecting the lengths of two adjacent sides of the minimum circumscribed rectangle;
comparing whether the lengths of the two adjacent sides are equal,
if the detection result is equal, the detection result is square;
if not, the detection result is negative.
If not, the minimum circumscribed rectangle is determined to be a rectangle, and the length of the long side of the rectangle is marked as "R", and the length of the short side is marked as "R".
According to the space geometrical relationship, the diameter of the circumference outline of the positioning hole can be obtained, namely R is equal to the length of the long side of the rectangle of step10, and the theory is as follows: no matter how the circle A is inclined, the circle A is irradiated by light vertical to a plane on a certain plane XY to form a projection, and the projection is an ellipse B when the circle A is inclined, wherein the major axis of the ellipse B is the same as the diameter R of the circle A; when the circle A is not inclined, namely the circular surface A is parallel to the XY plane, the projection is a circle C, and the diameter of the circle C is the same as that of the circle A; similarly, the smallest circumscribed rectangle of the ellipse B is a rectangle D, and the side length D of the rectangle is the same as the major axis of the ellipse B, so that the side length D of the rectangle is the same as the diameter R of the circle a; the projection is a circle C, the minimum circumscribed rectangle of the circle C is a square K, the side length of the square K is h, the side length h is the same as the diameter of the circle C, the diameter of the circle C is the same as the diameter R of the circle A, and the side length h is also the same as the diameter R of the circle A; in summary, the following steps: the length of the long side of the minimum circumscribed rectangle of the circular outline of the positioning hole in the image is the diameter length of the actual circle.
When the foreground workpiece target is inclined, the inclined angle of the workpiece relative to the XY axis plane of the image coordinate system can be obtained through the space geometric relation
Figure BDA0003340186650000041
An included angle alpha between the rectangular side R and the positive direction of the X axis of the image coordinate system can be obtained through the projection mark;
the angle of rotation beta is determined by comparing the magnitude of the angle alpha with 90 deg..
If α is not more than 90 °, the inclination angle (workpiece rotation angle) β of the workpiece with respect to the X axis is α;
if α >90 °, the inclination angle (workpiece rotation angle) β of the workpiece with respect to the X axis is 180 ° - α;
through the steps, the information of the target inclination angle theta and the rotation angle beta of the foreground workpiece is obtained, and therefore the target posture of the workpiece is judged.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (7)

1. A method for positioning a target positioning hole of a workpiece and judging the posture of the target positioning hole of the workpiece is characterized by comprising the following steps of:
step1, acquiring a target image of a workpiece;
step 2, preprocessing the workpiece target image;
step 3, marking the circumferential outline and the circle center of the target positioning hole of the workpiece;
step 4, obtaining positioning hole circumference information and circle center coordinates;
step 5, repeating the steps 1 to 4, obtaining the circumferential outline of the target positioning hole of the workpiece, and marking the minimum circumscribed rectangle of the circumferential outline of the target positioning hole of the workpiece;
step 6, detecting whether the minimum circumscribed rectangle is a square or not,
if the detection result is square, the workpiece target is not inclined relative to the XY axis plane of the image coordinate system;
if the detection result is negative, executing the step 7;
and 7, calculating and obtaining the inclination angle and the rotation angle of the workpiece target, and finishing the judgment of the posture of the workpiece target.
2. The workpiece target pilot hole positioning and attitude determination method as defined in claim 1,
the step1 to the step 4 are a positioning process of a target positioning hole of the workpiece, and the step 5 to the step 7 are a judgment process of a target posture of the workpiece.
3. The workpiece target pilot hole positioning and attitude determination method as defined in claim 1,
and in the process of preprocessing the workpiece target image, preprocessing by adopting a mode of enhancing image contrast and histogram processing.
4. The workpiece target pilot hole positioning and attitude determination method as defined in claim 1,
the process of detecting whether the minimum circumscribed rectangle is a square or not comprises the following steps:
detecting the lengths of two adjacent sides of the minimum circumscribed rectangle;
comparing whether the lengths of the two adjacent sides are equal,
if the detection result is equal, the detection result is square;
if not, the detection result is negative.
5. The workpiece target pilot hole positioning and attitude determination method as defined in claim 1,
the method for calculating and acquiring the inclination angle and the rotation angle of the workpiece target comprises the following steps:
judging that the minimum circumscribed rectangle is a rectangle, and marking the length of the long side and the length of the short side of the rectangle respectively;
calculating and obtaining an inclination angle relative to an XY axis plane of an image coordinate system by using the length of the long side and the length of the short side;
acquiring an included angle between the long side of the rectangle and the positive direction of the X axis of the image coordinate system;
and calculating the rotation angle according to the included angle.
6. The workpiece target pilot hole positioning and attitude determination method as defined in claim 5,
the length of the long edge is the diameter length of the circumferential outline of the positioning hole.
7. The workpiece target pilot hole positioning and attitude determination method as defined in claim 5,
the process of calculating the rotation angle according to the included angle comprises the following steps:
judging the size of the included angle and 90 degrees,
if the included angle is smaller than or equal to 90 degrees, the inclined angle of the workpiece relative to the X axis is equal to the included angle;
if the included angle is larger than 90 degrees, the inclined angle of the workpiece relative to the X axis is equal to 180 degrees minus the included angle.
CN202111305787.9A 2021-11-05 2021-11-05 Workpiece target positioning hole positioning and posture judging method Pending CN114037676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111305787.9A CN114037676A (en) 2021-11-05 2021-11-05 Workpiece target positioning hole positioning and posture judging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111305787.9A CN114037676A (en) 2021-11-05 2021-11-05 Workpiece target positioning hole positioning and posture judging method

Publications (1)

Publication Number Publication Date
CN114037676A true CN114037676A (en) 2022-02-11

Family

ID=80136442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111305787.9A Pending CN114037676A (en) 2021-11-05 2021-11-05 Workpiece target positioning hole positioning and posture judging method

Country Status (1)

Country Link
CN (1) CN114037676A (en)

Similar Documents

Publication Publication Date Title
CN107341802B (en) Corner sub-pixel positioning method based on curvature and gray scale compounding
CN105930858B (en) Rapid high-precision geometric template matching method with rotation and scaling functions
CN113112496B (en) Sub-pixel shaft part size measurement method based on self-adaptive threshold
CN107671896B (en) Rapid visual positioning method and system based on SCARA robot
WO2016101643A1 (en) Meter data read method and system
CN107516098A (en) A kind of objective contour 3-D information fetching method based on edge angle
CN109449093B (en) Wafer detection method
CN106251353A (en) Weak texture workpiece and the recognition detection method and system of three-dimensional pose thereof
CN113146172B (en) Multi-vision-based detection and assembly system and method
CN111047588A (en) Imaging measurement method for size of shaft type small part
CN107192716A (en) A kind of workpiece, defect quick determination method based on contour feature
CN110936355A (en) Mechanical arm guiding system and method based on visual speed measurement positioning
WO2022148091A1 (en) Target matching method and device, and robot
CN104460505A (en) Industrial robot relative pose estimation method
CN114549408A (en) Position size comparison method based on graphic image
CN107463939B (en) Image key straight line detection method
CN112730459B (en) Bearing inner ring end surface defect detection method based on multi-angle light source shooting image
CN111738247A (en) Identification method and identification device of polarity identification, electronic equipment and storage medium
CN105991912A (en) Method for identifying feature objects in automatic heart-regulating process in camera module group
CN114037676A (en) Workpiece target positioning hole positioning and posture judging method
CN112085708B (en) Method and equipment for detecting defects of straight line edges in outer contour of product
CN111102897B (en) Arc block part fitting analysis method
CN115753791B (en) Defect detection method, device and system based on machine vision
CN111539955A (en) Defect detection method
CN111047623B (en) Efficient template positioning algorithm system for vision-aided positioning

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