CN113096090B - End face gap visual measurement method with chamfer, device, equipment and storage medium - Google Patents

End face gap visual measurement method with chamfer, device, equipment and storage medium Download PDF

Info

Publication number
CN113096090B
CN113096090B CN202110372023.5A CN202110372023A CN113096090B CN 113096090 B CN113096090 B CN 113096090B CN 202110372023 A CN202110372023 A CN 202110372023A CN 113096090 B CN113096090 B CN 113096090B
Authority
CN
China
Prior art keywords
chamfer
workpiece
gap
face
template matching
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.)
Active
Application number
CN202110372023.5A
Other languages
Chinese (zh)
Other versions
CN113096090A (en
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.)
Institute of Mechanical Manufacturing Technology of CAEP
Original Assignee
Institute of Mechanical Manufacturing Technology of CAEP
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 Institute of Mechanical Manufacturing Technology of CAEP filed Critical Institute of Mechanical Manufacturing Technology of CAEP
Priority to CN202110372023.5A priority Critical patent/CN113096090B/en
Publication of CN113096090A publication Critical patent/CN113096090A/en
Application granted granted Critical
Publication of CN113096090B publication Critical patent/CN113096090B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • G06T7/344Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • 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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • 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/20024Filtering details
    • 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)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a visual measuring method, a device, equipment and a storage medium for an end face gap with a chamfer, which comprise a visual image acquisition system and an industrial personal computer, wherein the visual image acquisition system acquires end face images of a workpiece A and a workpiece B to be measured in an assembling process in real time and transmits the end face images to the industrial personal computer through a network; the end surfaces of the workpiece A and the workpiece B are provided with chamfers; the method comprises the following steps: calibrating a visual image acquisition system, and selecting a workpiece A and a workpiece B chamfering part area by adopting a template matching technology to create a template image; acquiring end face gap image information of a workpiece A and a workpiece B through a visual image acquisition system, rapidly matching chamfers in a measurement process according to created template images to obtain a chamfer template matching result, and judging the chamfer template matching result; and detecting and calculating the end face clearance of the workpiece A and the workpiece B in real time according to the chamfer template matching result. The invention solves the problem of visual measurement of the end face clearance to be chamfered and has high measurement precision.

Description

End face gap visual measurement method with chamfer, device, equipment and storage medium
Technical Field
The invention relates to the technical field of product assembly and manufacture, in particular to a visual measurement method, a device, equipment and a storage medium for an end face gap with a chamfer.
Background
In the process of product butt joint assembly, strict requirements are often imposed on the end face clearance of two workpieces, and particularly in the process of automatic assembly, the measurement precision of the end face clearance directly influences the assembly quality of products. The visual image measurement technology is used as a non-contact measurement means and has the characteristics of low cost, high precision, simplicity in operation and the like. The method for measuring the end face clearance based on the computer vision has wide application prospect in the automatic and intelligent assembling process by utilizing the ultrahigh resolution of the optical system to be matched with the current image processing technology.
However, the end face gap vision measuring method in the prior art has the following disadvantages:
(1) The existing end face gap method based on image processing determines a boundary line of an end face and a gap by utilizing image gray scale changes of the end face and the gap, the method is only suitable for two end faces without chamfers, and no other workpiece exists in the gap in the workpiece assembling process.
(2) The assembly of the product is a continuous process, and the relative movement of the two workpiece positions is represented as a dynamic change in the end face clearance. The existing method only analyzes the static image at the current moment and does not consider the continuity of the dynamic change process.
(3) In the selection of the optical lens, the existing method does not consider the relationship between the chamfer depth and the lens depth of field.
Disclosure of Invention
Aiming at least one defect of the existing end face gap vision measuring method in the background technology, the invention aims to provide an end face gap vision measuring method with a chamfer, a device, equipment and a storage medium, wherein the method selects a lens with the depth of field close to the depth of the chamfer aiming at the condition that the chamfer exists on an end face, and performs region segmentation on the gap and the chamfer by utilizing the information entropy of an image; and then, pixel statistics is carried out in the neighborhood of the segmentation boundary to judge the boundary of the chamfer and the gap.
The invention fully considers the inconsistency of the chamfering characteristics of different workpieces of the same type, and the change of the movable chamfering characteristics of one-time assembly of the same workpiece is not large. And selecting a chamfer part area as a matching template at the beginning stage of measurement by using a template matching technology, and quickly matching the chamfer to find the chamfer position in the measurement process. The method fully considers the characteristic that the change of the gap is continuous in the product assembly process, and uses Kalman filtering to predict the position of the boundary line of the chamfer and the gap in the image.
The invention is realized by the following technical scheme:
the invention provides a visual measuring method for an end face gap with a chamfer, which comprises a visual image acquisition system and an industrial personal computer, wherein the visual image acquisition system acquires end face images of a workpiece A and a workpiece B to be measured in an assembling process in real time and transmits the end face images to the industrial personal computer through a network, and an image processing algorithm in the industrial personal computer calculates the size of an end face gap in real time; the end surfaces of a workpiece A and a workpiece B to be measured are provided with chamfers; the measuring method comprises the following steps:
s1: calibrating a visual image acquisition system (camera), and selecting a workpiece A and a workpiece B chamfer part area by adopting a template matching technology to create a template image;
s2: acquiring end face gap image information of a workpiece A and a workpiece B through a visual image acquisition system, rapidly matching chamfers in a measurement process according to created template images to obtain a chamfer template matching result, and judging the chamfer template matching result; and detecting and calculating the end face clearance of the workpiece A and the workpiece B in real time according to the chamfer template matching result.
Further, in step S1, selecting the chamfer partial areas of the workpiece a and the workpiece B by using a template matching technique to create a template image, including:
manually selecting the upper half areas of the chamfers of the workpiece A and the workpiece B to be measured on the image as a shape feature matching template; setting template matching parameters with a low threshold value in the workpiece assembling process, wherein the template matching parameters comprise a rotation angle of-2 0 ~+2 0 And the zoom index is 0.8-1.2 times.
Further, in step S2, the chamfer template matching result is determined; and according to the chamfer template matching result, carrying out real-time detection and calculation on the end surface clearance of the workpiece A and the workpiece B, and specifically comprising the following steps:
step A: judging the chamfer template matching result, and recording the upper chamfer position p up Lower chamfer position p down The minimum matching score of the chamfer template matching result is s, if s>And (5) judging that the chamfering position is determined, and entering the step (B); if s<40%, judging that the chamfer is not found, and entering the step G; if s is more than or equal to 40% and less than or equal to 90%, determining the position of the chamfer and entering the step I if the confidence coefficient is lower;
and B: above chamfer position p up And lower chamfer position p down Selecting a local neighborhood to calculate a histogram along the vertical direction of the image by taking the position as a center;
and C: performing Gaussian filtering on the histogram, and calculating a univalent derivative to obtain a boundary point of a chamfer and a gap; wherein, the point with the reciprocal of zero is marked as the boundary point of the chamfer and the gap;
step D: c, performing linear fitting on all extreme points detected in the step C by adopting a random sample consensus (RANSAC) algorithm;
step E: d, judging the length and the inclination angle of the straight line fitted in the step D: if the length of the straight line is larger than the set threshold value and the angle is smaller than the set threshold value, the detection is judged to be successful, and the L1 position of the boundary line of the chamfer and the gap of the workpiece A is recorded as p 1i The L2 position of the boundary line between the chamfer and the gap of the workpiece B is p 2i Updating the Kalman filter at the same time, and entering the step F; otherwise, entering a step K;
step F: calculating the nearest distance between the line segments L1 and L2 as D 1 One pixel with a maximum distance D 2 One pixel, then the gap size is (D) 1 +D 2 ) /2*x where x is the size of a single pixel;
step G: selecting a 9x9 template image to perform information entropy operation on the image, and performing threshold segmentation;
step H: detecting two rectangular areas with the information entropy value larger than a set threshold value and with certain width as areas where the chamfers are located; recording the lower boundary position E of the chamfer of the workpiece A up Upper edge E of chamfer of workpiece B down With E up 、E down Selecting a local neighborhood to calculate a histogram along the vertical direction of the image by taking the position as a center, and entering the step C;
step I: a sequence p of the positions of a boundary L1 between the chamfer and the gap of the workpiece A 1 The sequence p of the positions of the boundary L2 between the chamfer and the gap of the workpiece B 2 Performing Kalman filtering, and predicting the position of a boundary L1 and the position of a boundary L2 to obtain a prediction result;
step J: comparing the prediction result in the step I with the chamfer template matching result, and if the prediction result is smaller than a set threshold value, the chamfer template matching result and the chamfer template matching result are consistent in detection, and entering the step B; otherwise, the matching is failed, and the step K is entered;
step K: marking the L1 position of the boundary between the chamfer and the gap of the workpiece A as p in the image window by manual scribing 1i Chamfering workpiece BThe L2 position of the boundary line with the gap is p 2i Updating the Kalman filter at the same time; and F, entering the step.
Further, in step B and step H, a local neighborhood with a width of 10 and a height of 40 is selected to calculate a histogram along the vertical direction of the image.
Furthermore, the end surfaces of the workpiece A and the workpiece B to be measured are provided with chamfers, and the chamfers are arranged on the same side or different sides.
Further, the measuring method is suitable for the visual measurement of the gap between the end faces of the two workpieces with the chamfer angle on the end face.
Furthermore, the visual image acquisition system comprises a CCD camera, a telecentric lens and an annular light source, wherein the CCD camera, the telecentric lens and the annular light source are sequentially arranged on the same axis; and the depth of field of the telecentric lens is close to the depth of the chamfer, and the lens with reasonable depth of field is selected to enable the boundary line between the chamfer and the gap to be clearer on the image.
In a second aspect, the present invention further provides a chamfered end face gap vision measuring apparatus, which supports the chamfered end face gap vision measuring method, and includes:
the calibration unit is used for calibrating the visual image acquisition system (camera);
the template image creating unit is used for selecting the chamfer part areas of the workpiece A and the workpiece B by adopting a template matching technology to create template images;
the acquisition unit is used for acquiring the end surface gap image information of the workpiece A and the workpiece B through the visual image acquisition system;
the gap real-time detection unit is used for rapidly matching the chamfer to obtain a chamfer template matching result in the measuring process according to the template image created by the template image creation unit and judging the chamfer template matching result; calculating the end face clearance of the workpiece A and the workpiece B in real time according to the chamfer template matching result;
and the output unit is used for outputting the end face gap results of the workpieces A and B.
In a third aspect, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method for visually measuring a chamfered end face gap when executing the computer program.
In a fourth aspect, the present invention further provides a computer-readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the method for visually measuring a chamfered end face gap.
Compared with the prior art, the invention has the following advantages and beneficial effects:
1. according to the method, a lens with the depth of field close to the depth of a chamfer is selected for the condition that the chamfer exists on the end face, and the information entropy of an image is utilized to perform region segmentation on the gap and the chamfer; and then, pixel statistics is carried out in the neighborhood of the segmentation boundary to judge the boundary of the chamfer and the gap.
2. The invention fully considers the inconsistency of the chamfering characteristics of different workpieces of the same type, and the change of the movable chamfering characteristics of one-time assembly of the same workpiece is not large. And selecting a chamfer part area as a matching template at the beginning stage of measurement by using a template matching technology, and quickly matching the chamfer in the measurement process to find the chamfer position.
3. The method fully considers the characteristic that the change of the gap is continuous in the product assembly process, and uses Kalman filtering to predict the position of the boundary line of the chamfer and the gap in the image.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:
FIG. 1 is a flow chart of a visual measurement method for a chamfered end face gap according to the present invention.
FIG. 2 is a schematic view of the visual measurement of the chamfered end face clearance of the present invention.
FIG. 3 is a logic flow diagram of the gap real-time detection step of the present invention.
Detailed Description
Hereinafter, the term "comprising" or "may include" used in various embodiments of the present invention indicates the presence of the invented function, operation or element, and does not limit the addition of one or more functions, operations or elements. Furthermore, the terms "comprises," "comprising," "has," "having," "includes," "including," "has," "having," "including," "contains," "containing," "involving," or any combination thereof, as used in various embodiments of the present invention, are intended to cover only particular features, integers, steps, operations, elements, components, or combinations of the foregoing, and should not be construed as first excluding the presence of or adding to one or more other features, integers, steps, operations, elements, components, or combinations of the foregoing.
In various embodiments of the invention, the expression "or" at least one of a or/and B "includes any or all combinations of the words listed simultaneously. For example, the expression "a or B" or "at least one of a or/and B" may include a, may include B, or may include both a and B.
Expressions (such as "first", "second", and the like) used in various embodiments of the present invention may modify various constituent elements in various embodiments, but may not limit the respective constituent elements. For example, the above description does not limit the order and/or importance of the elements described. The foregoing description is for the purpose of distinguishing one element from another. For example, the first user device and the second user device indicate different user devices, although both are user devices. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of various embodiments of the present invention.
It should be noted that: if it is described that one constituent element is "connected" to another constituent element, the first constituent element may be directly connected to the second constituent element, and a third constituent element may be "connected" between the first constituent element and the second constituent element. In contrast, when one constituent element is "directly connected" to another constituent element, it is understood that there is no third constituent element between the first constituent element and the second constituent element.
The terminology used in the various embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the various embodiments of the invention. As used herein, the singular forms are intended to include the plural forms as well, unless the context clearly indicates otherwise. Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. The terms (such as those defined in commonly used dictionaries) should be interpreted as having a meaning that is consistent with their contextual meaning in the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in various embodiments of the present invention.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to examples and accompanying drawings, and the exemplary embodiments and descriptions thereof are only used for explaining the present invention and are not meant to limit the present invention.
Example 1
As shown in fig. 1 to 3, the end face gap vision measuring method with the chamfer comprises a vision image acquisition system and an industrial personal computer, wherein the vision image acquisition system comprises a CCD camera, a telecentric lens and an annular light source, and the CCD camera, the telecentric lens and the annular light source are sequentially arranged on the same axis; and the depth of field of the telecentric lens is close to the depth of the chamfer angle, so that the shooting effect is ensured.
The visual image acquisition system acquires end face images of a workpiece A to be measured and a workpiece B in the assembling process in real time and transmits the end face images to the industrial personal computer through a network, and an image processing algorithm built in the industrial personal computer calculates the size of an end face gap in real time; the end faces of a workpiece A to be measured and a workpiece B to be measured are provided with chamfers;
the application object of the measuring method is visual measurement of the end face gap of two workpieces with chamfers on the end faces, namely, the end faces of the workpiece A and the workpiece B to be measured are both provided with chamfers, and the chamfers are on the same side or different sides. As shown in fig. 2, fig. 2 shows a case where end face chamfers of a workpiece a and a workpiece B are on the same side, so that only one group of visual image acquisition systems needs to be configured; if the end face chamfers of the workpiece A and the workpiece B are on different sides, two groups of visual image acquisition systems need to be configured, and the visual image acquisition systems need to be configured on the chamfers, so that the end face chamfer information of the workpiece A and the workpiece B is ensured to be in the monitoring range of the visual image acquisition systems and is acquired in real time.
As shown in fig. 1, the measurement method includes:
s1: calibrating a camera of a visual image acquisition system, and selecting a workpiece A and a workpiece B chamfer part area by adopting a template matching technology to create a template image;
s2: acquiring end face gap image information of a workpiece A and a workpiece B through a visual image acquisition system, rapidly matching chamfers in a measurement process according to created template images to obtain a chamfer template matching result, and judging the chamfer template matching result; and detecting and calculating the end face clearance of the workpiece A and the workpiece B in real time according to the chamfer template matching result.
The specific implementation is as follows:
firstly, calibrating a camera before image measurement, and comprising the following steps:
a calibration plate with a circular pattern is selected to be placed at the front end of a workpiece, and the radius of the calibration plate is Rmm. And after the light source is adjusted, a camera is used for shooting a clear image, and after the edge of the image is extracted by using a sub-pixel edge detection algorithm, the round feature is detected by using hough transformation. Assuming that the number of pixels occupied by the radius of the circle is N, the size of each pixel of the image is
Figure BDA0003009649530000061
Secondly, a template image is created before image measurement, and the steps are as follows:
in the assembly process of the workpieces, the bottom of the chamfer is influenced by illumination, and the edge information of the chamfer changes, so that the upper half areas of the chamfers of the workpieces A and B on the image are manually selected as the shape characteristic matching templates. In the process of assembling the workpiece, the size and the angle of the chamfer are not changed greatly, and template matching parameters such as a small rotating angle and a scaling index are set for accelerating the matching speed. To facilitate subsequent definition of the boundary between the end face and the slot.
Thirdly, as shown in fig. 3, the gap real-time detection steps are as follows:
step 1: the end face gap image is read.
Step 2: in the assembling process, the workpiece A and the workpiece B only move in the vertical direction, the vertical direction area in the template establishing process is selected as a shape template matching search area to accelerate the search speed, and the template position is ensured to be correct and fast found by setting a lower matching score.
And 3, step 3: judging the chamfer template matching result, and recording the upper chamfer position p up Lower chamfer position p down The minimum matching score of the chamfer template matching result is s, if s>When the chamfer angle is determined to be 90%, entering the step 4; if s<40%, judging that the chamfer is not found, and entering the step 9; if s is more than or equal to 40% and less than or equal to 90%, determining the position of the chamfer and entering the step 11 if the confidence coefficient is lower;
and 4, step 4: above chamfer position p up And lower chamfer position p down Selecting a local neighborhood with the width of 10 pixels and the height of 40 pixels as a center to calculate a histogram along the vertical direction of the image;
and 5: performing Gaussian filtering on the histogram, and calculating a univalent derivative to obtain a boundary point of a chamfer and a gap; wherein, the point with the reciprocal of zero is recorded as the boundary point of the chamfer and the gap;
and 6: performing straight line fitting on all the extreme points detected in the step 5 by adopting a random sample consensus (RANSAC) algorithm;
and 7: and 6, judging the length and the inclination angle of the straight line fitted in the step 6: if the length of the straight line is larger than the set threshold value and the angle is smaller than the set threshold value, the detection is judged to be successful, and the L1 position of the boundary line between the chamfer and the gap of the workpiece A is recorded as p 1i The L2 position of the boundary line between the chamfer and the gap of the workpiece B is p 2i Simultaneously updating the Kalman filter, and entering the step 8; otherwise, entering step 13;
and 8: calculating the shortest distance D between the line segments L1 and L2 1 One pixel with a maximum distance D 2 One pixel, then the gap size is (D) 1 +D 2 ) /2*x; where x is the size of a single pixel.
And step 9: selecting a 9x9 template image to perform information entropy operation on the image, and performing threshold segmentation;
step 10: detecting two rectangular areas with the information entropy value larger than a set threshold value and a certain width and recording the two rectangular areas as areas where chamfers are located; recording the lower boundary position E of the chamfer of the workpiece A up Upper edge E of chamfer of workpiece B down With E up 、E down Taking the position as a center, selecting a local neighborhood with the width of 10 pixels and the height of 40 pixels to calculate a histogram along the vertical direction of the image, and entering step 5;
step 11: respectively chamfering the workpiece A and forming a boundary line L1 position sequence p of the gap 1 The sequence p of the positions of the boundary L2 between the chamfer and the gap of the workpiece B 2 Performing Kalman filtering, and predicting the position of a boundary L1 and the position of a boundary L2 to obtain a prediction result;
step 12: comparing the prediction result in the step 11 with the chamfer template matching result, and if the prediction result is smaller than a set threshold value, the chamfer template matching result and the chamfer template matching result are consistent in detection, and entering the step 4; otherwise, the matching is failed, and the step 13 is entered;
step 13: marking the L1 position of a boundary line between the chamfer and the gap of the workpiece A as p in the image window by manually marking 1i The L2 position of the boundary line between the chamfer and the gap of the workpiece B is p 2i Updating the Kalman filter at the same time; step 8 is entered.
Aiming at the condition that the end face has a chamfer, the method selects a lens with the depth of field close to the depth of the chamfer, and performs region segmentation on the gap and the chamfer by using the information entropy of the image; then, pixel statistics is carried out in the neighborhood of the segmentation boundary to judge the boundary of the chamfer and the gap.
The invention fully considers the inconsistency of the chamfering characteristics of different workpieces of the same type, and the change of the movable chamfering characteristics of one-time assembly of the same workpiece is not large. And selecting a chamfer part area as a matching template at the beginning stage of measurement by using a template matching technology, and quickly matching the chamfer in the measurement process to find the chamfer position.
The method fully considers the characteristic that the change of the gap is continuous in the product assembly process, and uses Kalman filtering to predict the position of the boundary line of the chamfer and the gap in the image.
Example 2
As shown in fig. 1 to fig. 3, the present embodiment is different from embodiment 1 in that the present embodiment provides a chamfered end face gap vision measuring apparatus, which supports the chamfered end face gap vision measuring method described in embodiment 1, and the measuring apparatus includes:
a calibration unit for calibrating a visual image acquisition system (camera);
the template image creating unit is used for selecting the chamfer part areas of the workpiece A and the workpiece B by adopting a template matching technology to create template images;
the acquisition unit is used for acquiring the end surface gap image information of the workpiece A and the workpiece B through the visual image acquisition system;
the gap real-time detection unit is used for rapidly matching the chamfer to obtain a chamfer template matching result in the measuring process according to the template image created by the template image creation unit and judging the chamfer template matching result; calculating the end face clearance of the workpiece A and the workpiece B in real time according to the chamfer template matching result;
and the output unit is used for outputting the end face gap results of the workpieces A and B.
The steps of the visual measurement method for the end face gap with the chamfer are performed according to the steps of the method in embodiment 1, and are not repeated in this embodiment.
In addition, the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor executes the computer program to realize the chamfered end face gap vision measuring method.
In addition, the invention also provides a computer readable storage medium, which stores a computer program, characterized in that the computer program is executed by a processor to implement the chamfered end face gap vision measuring method.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (9)

1. The end face gap vision measuring method with the chamfer is characterized by comprising a vision image acquisition system and an industrial personal computer, wherein the vision image acquisition system acquires end face images of a workpiece A and a workpiece B to be measured in an assembling process in real time and transmits the end face images to the industrial personal computer through a network, and an image processing algorithm in the industrial personal computer calculates the size of an end face gap in real time; the end faces of a workpiece A to be measured and a workpiece B to be measured are provided with chamfers; the measuring method comprises the following steps:
s1: calibrating a visual image acquisition system, and selecting a chamfer part area of a workpiece A and a chamfer part area of a workpiece B by adopting a template matching technology to create template images;
s2: acquiring end face gap image information of a workpiece A and a workpiece B through a visual image acquisition system, rapidly matching chamfers in a measurement process according to created template images to obtain a chamfer template matching result, and judging the chamfer template matching result; detecting and calculating the end face clearance of the workpiece A and the workpiece B in real time according to the chamfer template matching result;
in the step S2, the chamfer template matching result is judged; and according to the chamfer template matching result, carrying out real-time detection and calculation on the end surface clearance of the workpiece A and the workpiece B, and specifically comprising the following steps:
step A: the result of the chamfer template matching is judged,record the upper chamfer position p up Lower chamfer position p down The minimum matching score of the chamfer template matching result is s, if s>Judging that the chamfering position is determined to enter the step B when the chamfering position is determined to be 90 percent; if s<40%, judging that the chamfer is not found, and entering the step G; if s is more than or equal to 40% and less than or equal to 90%, determining the position of the chamfer and entering the step I if the confidence coefficient is lower;
and B, step B: above chamfer position p up And lower chamfer position p down Selecting a local neighborhood to calculate a histogram along the vertical direction of the image by taking the position as a center;
and C: performing Gaussian filtering on the histogram, and calculating a univalent derivative to obtain a boundary point of a chamfer and a gap; wherein, the point with the reciprocal of zero is marked as the boundary point of the chamfer and the gap;
step D: c, performing linear fitting on all extreme points detected in the step C by adopting a random sample consensus (RANSAC) algorithm;
step E: d, judging the length and the inclination angle of the straight line fitted in the step D: if the length of the straight line is larger than the set threshold value and the angle is smaller than the set threshold value, the detection is judged to be successful, and the L1 position of the boundary line of the chamfer and the gap of the workpiece A is recorded as p 1i The L2 position of the boundary line between the chamfer and the gap of the workpiece B is p 2i Updating the Kalman filter at the same time, and entering the step F; otherwise, entering the step K;
step F: calculating the nearest distance between the line segments L1 and L2 as D 1 One pixel with a maximum distance D 2 One pixel, then the gap size is (D) 1 +D 2 ) /2*x where x is the size of a single pixel;
step G: selecting a template image to carry out information entropy operation on the image, and carrying out threshold segmentation;
step H: detecting two rectangular areas with the information entropy values larger than a set threshold value and with widths, and recording the two rectangular areas as areas where chamfers are located; recording the lower boundary position E of the chamfer of the workpiece A up Upper edge E of chamfer of workpiece B down With E up 、E down Selecting a local neighborhood to calculate a histogram along the vertical direction of the image by taking the position as a center, and entering the step C;
step I: for chamfering and gaping work A respectivelySequence p at boundary L1 position 1 The sequence p of the positions of the boundary L2 between the chamfer and the gap of the workpiece B 2 Performing Kalman filtering, and predicting the position of a boundary L1 and the position of a boundary L2 to be used as prediction results;
step J: comparing the prediction result in the step I with the chamfer template matching result, and if the prediction result is smaller than a set threshold value, indicating that the detection of the prediction result and the chamfer template matching result is consistent, entering the step B by the chamfer template matching result; otherwise, matching fails, and entering the step K;
step K: marking the L1 position of the boundary between the chamfer and the gap of the workpiece A as p in the image window by manual scribing 1i The L2 position of the boundary line between the chamfer and the gap of the workpiece B is p 2i Updating the Kalman filter at the same time; and F, entering the step.
2. The visual measurement method for the chamfered end face gap according to claim 1, wherein in step S1, a template matching technique is used to select chamfered partial areas of the workpiece a and the workpiece B to create a template image, and the method comprises:
manually selecting the upper half areas of the chamfers of the workpiece A and the workpiece B to be measured on the image as a shape feature matching template; in the workpiece assembling process, template matching parameters are set, wherein the template matching parameters comprise a rotation angle and a scaling index.
3. The visual measurement method for the end face gap with the chamfer according to claim 1, wherein in step B and step H, a local neighborhood with the width of 10 and the height of 40 is selected to calculate a histogram along the vertical direction of the image.
4. The visual measurement method for the end face gap with the chamfer as claimed in claim 1, wherein the end faces of the workpiece A and the workpiece B to be measured are both provided with the chamfer, and the chamfers are on the same side or different sides.
5. The visual measurement method for the end face gap with the chamfer according to claim 1, is suitable for the visual measurement of the end face gap of two workpieces with the chamfer on the end face.
6. The visual measurement method for the end face gap with the chamfer angle as recited in claim 1, wherein the visual image acquisition system comprises a CCD camera, a telecentric lens and an annular light source, and the CCD camera, the telecentric lens and the annular light source are sequentially arranged on the same axis.
7. A measuring apparatus for a method of visual measurement of chamfered end face clearance according to any of claims 1 to 6, characterized in that the measuring apparatus comprises:
the calibration unit is used for calibrating the visual image acquisition system;
the template image creating unit is used for selecting the chamfer part areas of the workpiece A and the workpiece B by adopting a template matching technology to create template images;
the acquisition unit is used for acquiring the end surface gap image information of the workpiece A and the workpiece B through the visual image acquisition system;
the gap real-time detection unit is used for rapidly matching chamfers according to the template images created by the template image creation unit in the measurement process to obtain a chamfer template matching result and judging the chamfer template matching result; calculating the end face clearance of the workpiece A and the workpiece B in real time according to the chamfer template matching result;
and the output unit is used for outputting the end face gap results of the workpieces A and B.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program implements a visual end face gap measurement method with chamfer as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out a visual chamfered end-face gap measuring method according to any one of claims 1 to 6.
CN202110372023.5A 2021-04-07 2021-04-07 End face gap visual measurement method with chamfer, device, equipment and storage medium Active CN113096090B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110372023.5A CN113096090B (en) 2021-04-07 2021-04-07 End face gap visual measurement method with chamfer, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110372023.5A CN113096090B (en) 2021-04-07 2021-04-07 End face gap visual measurement method with chamfer, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113096090A CN113096090A (en) 2021-07-09
CN113096090B true CN113096090B (en) 2022-12-06

Family

ID=76674440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110372023.5A Active CN113096090B (en) 2021-04-07 2021-04-07 End face gap visual measurement method with chamfer, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113096090B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721072A (en) * 2021-08-18 2021-11-30 宁波云太基智能科技有限公司 Flow measuring method of intelligent measuring instrument

Citations (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101473439A (en) * 2006-04-17 2009-07-01 全视Cdm光学有限公司 Arrayed imaging systems and associated methods
CN101564577A (en) * 2009-06-05 2009-10-28 贵州航天风华精密设备有限公司 Method for decreasing medical accelerator support arm welding deformation
CN101600548A (en) * 2007-04-13 2009-12-09 汉斯林格设备和加工有限两合公司 The device of blank that is used to separate plastic material with bracing frame of supporting nicking device and cutter sweep
JP2009288537A (en) * 2008-05-29 2009-12-10 Olympus Imaging Corp Finder structure for single-lens reflex camera
CN101713168A (en) * 2008-10-06 2010-05-26 中交第三航务工程局有限公司 Process for mounting template for manufacturing sectional box girders
JP2010247435A (en) * 2009-04-16 2010-11-04 Sharp Corp Light source unit, light source device, optical scanner, and image forming device
CN102248081A (en) * 2011-06-23 2011-11-23 江铃汽车股份有限公司 Spoke wind hole stamping and chamfering mould
CN102840836A (en) * 2012-09-24 2012-12-26 常熟市晓创光电科技有限公司 Assembly clearance detection method and device based on machine vision
CN103008599A (en) * 2012-12-28 2013-04-03 武昌造船厂集团有限公司 Template design method for casting mold of vertical centrifugal machine
CN103870813A (en) * 2014-03-14 2014-06-18 联想(北京)有限公司 Fingerprint sensor and electronic equipment
CN104723021A (en) * 2013-12-18 2015-06-24 中核建中核燃料元件有限公司 Foreign-matter-proof plate machining process
CN105865344A (en) * 2016-06-13 2016-08-17 长春工业大学 Workpiece dimension measuring method and device based on machine vision
CN205496979U (en) * 2016-01-28 2016-08-24 宁波锦伟紧固件集团有限公司 Tapping draw processingequipment
CN106556601A (en) * 2016-11-01 2017-04-05 河北汇金机电股份有限公司 The analysis of cloth cover filoplume and statistical method based on image acquisition
CN107081275A (en) * 2017-04-26 2017-08-22 麦特达因(苏州)汽车部件有限公司 A kind of fit-up gap distance detection system and its detection method based on machine vision
CN107900211A (en) * 2017-12-13 2018-04-13 贵州远成汽车悬架弹簧有限公司 A kind of integrated compound die for wetland cutter has
CN107916677A (en) * 2017-11-28 2018-04-17 上海建工五建集团有限公司 Piping lane construction formwork system and its construction method
CN109070365A (en) * 2016-04-22 2018-12-21 三菱电机株式会社 Object operating device and object operating method
CN110206306A (en) * 2019-05-18 2019-09-06 陕西建工第五建设集团有限公司 Steel reinforcement cage lateral assembly method integrated with steel form
CN110232682A (en) * 2019-05-31 2019-09-13 宁波中车时代传感技术有限公司 A kind of track foreign body detecting method based on image
CN110766750A (en) * 2019-09-09 2020-02-07 浙江大学 Mechanical arm visual servo target identification method based on local contour
CN110757006A (en) * 2019-10-23 2020-02-07 武汉数字化设计与制造创新中心有限公司 Photovoltaic glass through hole laser chamfering device and method
CN111842648A (en) * 2020-07-15 2020-10-30 东风汽车股份有限公司 Machining die for M-shaped internal support type plate press-formed part and using method of machining die

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101532926A (en) * 2008-12-12 2009-09-16 齐齐哈尔华工机床制造有限公司 On-line vision detecting system for automatic impact specimen processing device and image processing method thereof
CN102865980B (en) * 2012-09-10 2015-01-07 天津大学 Automatic light leakage degree and closed gap detector of three-station piston ring and calibrating block thereof
CN103292701B (en) * 2013-06-24 2015-09-16 哈尔滨工业大学 The online dimension measurement method of accurate device based on machine vision
CN104634266A (en) * 2013-11-08 2015-05-20 南京化工职业技术学院 Mechanical sealing end surface deformation measurement system based on binocular vision DIC and measurement method thereof
CN110108711A (en) * 2019-04-20 2019-08-09 东莞中科蓝海智能视觉科技有限公司 The vision detection system of annulus side wall defect
CN110136120B (en) * 2019-05-16 2021-04-06 燕山大学 Silk-screen printing sample plate size measuring method based on machine vision

Patent Citations (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101473439A (en) * 2006-04-17 2009-07-01 全视Cdm光学有限公司 Arrayed imaging systems and associated methods
CN101600548A (en) * 2007-04-13 2009-12-09 汉斯林格设备和加工有限两合公司 The device of blank that is used to separate plastic material with bracing frame of supporting nicking device and cutter sweep
JP2009288537A (en) * 2008-05-29 2009-12-10 Olympus Imaging Corp Finder structure for single-lens reflex camera
CN101713168A (en) * 2008-10-06 2010-05-26 中交第三航务工程局有限公司 Process for mounting template for manufacturing sectional box girders
JP2010247435A (en) * 2009-04-16 2010-11-04 Sharp Corp Light source unit, light source device, optical scanner, and image forming device
CN101564577A (en) * 2009-06-05 2009-10-28 贵州航天风华精密设备有限公司 Method for decreasing medical accelerator support arm welding deformation
CN102248081A (en) * 2011-06-23 2011-11-23 江铃汽车股份有限公司 Spoke wind hole stamping and chamfering mould
CN102840836A (en) * 2012-09-24 2012-12-26 常熟市晓创光电科技有限公司 Assembly clearance detection method and device based on machine vision
CN103008599A (en) * 2012-12-28 2013-04-03 武昌造船厂集团有限公司 Template design method for casting mold of vertical centrifugal machine
CN104723021A (en) * 2013-12-18 2015-06-24 中核建中核燃料元件有限公司 Foreign-matter-proof plate machining process
CN103870813A (en) * 2014-03-14 2014-06-18 联想(北京)有限公司 Fingerprint sensor and electronic equipment
CN205496979U (en) * 2016-01-28 2016-08-24 宁波锦伟紧固件集团有限公司 Tapping draw processingequipment
CN109070365A (en) * 2016-04-22 2018-12-21 三菱电机株式会社 Object operating device and object operating method
CN105865344A (en) * 2016-06-13 2016-08-17 长春工业大学 Workpiece dimension measuring method and device based on machine vision
CN106556601A (en) * 2016-11-01 2017-04-05 河北汇金机电股份有限公司 The analysis of cloth cover filoplume and statistical method based on image acquisition
CN107081275A (en) * 2017-04-26 2017-08-22 麦特达因(苏州)汽车部件有限公司 A kind of fit-up gap distance detection system and its detection method based on machine vision
CN107916677A (en) * 2017-11-28 2018-04-17 上海建工五建集团有限公司 Piping lane construction formwork system and its construction method
CN107900211A (en) * 2017-12-13 2018-04-13 贵州远成汽车悬架弹簧有限公司 A kind of integrated compound die for wetland cutter has
CN110206306A (en) * 2019-05-18 2019-09-06 陕西建工第五建设集团有限公司 Steel reinforcement cage lateral assembly method integrated with steel form
CN110232682A (en) * 2019-05-31 2019-09-13 宁波中车时代传感技术有限公司 A kind of track foreign body detecting method based on image
CN110766750A (en) * 2019-09-09 2020-02-07 浙江大学 Mechanical arm visual servo target identification method based on local contour
CN110757006A (en) * 2019-10-23 2020-02-07 武汉数字化设计与制造创新中心有限公司 Photovoltaic glass through hole laser chamfering device and method
CN111842648A (en) * 2020-07-15 2020-10-30 东风汽车股份有限公司 Machining die for M-shaped internal support type plate press-formed part and using method of machining die

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
Pose measurement method of non-cooperative circular feature based on line structured light;LI S;《2016 IEEE International Conference on Information & Automation》;20171231;第374-380页 *
一种基于轮廓匹配的近岸舰船检测方法;雷琳等;《遥感技术与应用》;20071015(第05期);第50-55页 *
大口径元件拼接测量系统研发与实验研究;肖虹 等;《现代制造工程》;20131231;第114-117页 *
玉米水平圆盘精密排种器型孔的研究;廖庆喜等;《农业工程学报》;20030330(第02期);第109-113页 *
节段拼装箱梁桥梁的梁体匹配预制;黄心谚;《大众科技》;20120520(第05期);第85-87页 *
轮廓匹配的复杂背景中目标检测算法;侯春萍等;《哈尔滨工业大学学报》;20200510(第05期);第127-134页 *

Also Published As

Publication number Publication date
CN113096090A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
CN107239742B (en) Method for calculating scale value of instrument pointer
CN109685760B (en) MATLAB-based SLM powder bed powder laying image convex hull depression defect detection method
US9177222B2 (en) Edge measurement video tool and interface including automatic parameter set alternatives
JP2020134187A (en) Flaw inspection device and method
CN112085708B (en) Method and equipment for detecting defects of straight line edges in outer contour of product
CN111310753A (en) Meter alignment method and device
CN113096090B (en) End face gap visual measurement method with chamfer, device, equipment and storage medium
CN113066088A (en) Detection method, detection device and storage medium in industrial detection
CN109544513A (en) A kind of steel pipe end surface defect extraction knowledge method for distinguishing
CN111161140B (en) Distortion image correction method and device
CN110031471B (en) Method, system and device for analyzing surface defect growth of large-caliber optical element
Ali et al. Camera based precision measurement in improving measurement accuracy
Zhou et al. An adaptive clustering method detecting the surface defects on linear guide rails
CN116160458B (en) Multi-sensor fusion rapid positioning method, equipment and system for mobile robot
EP4375924A1 (en) Cell alignment degree measurement method, controller, detection system, and storage medium
CN116596987A (en) Workpiece three-dimensional size high-precision measurement method based on binocular vision
CN108154521B (en) Moving target detection method based on target block fusion
CN116452826A (en) Coal gangue contour estimation method based on machine vision under shielding condition
CN110310239A (en) It is a kind of to be fitted the image processing method for eliminating illumination effect based on characteristic value
JP6264008B2 (en) Image processing apparatus, image processing method, and image processing program
CN114454617B (en) Code spraying total system
CN115546145A (en) Defect detection method and device based on machine vision and electronic equipment
CN115393290A (en) Edge defect detection method, device and equipment
TW202020732A (en) Objective identification method and device thereof
CN115546139A (en) Defect detection method and device based on machine vision and electronic equipment

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
GR01 Patent grant
GR01 Patent grant