CN117570880A - Profile straightness detection method - Google Patents
Profile straightness detection method Download PDFInfo
- Publication number
- CN117570880A CN117570880A CN202311489589.1A CN202311489589A CN117570880A CN 117570880 A CN117570880 A CN 117570880A CN 202311489589 A CN202311489589 A CN 202311489589A CN 117570880 A CN117570880 A CN 117570880A
- Authority
- CN
- China
- Prior art keywords
- contour
- image
- profile
- product
- straight line
- 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
- 238000001514 detection method Methods 0.000 title claims abstract description 90
- 238000000605 extraction Methods 0.000 claims abstract description 35
- 238000006243 chemical reaction Methods 0.000 claims abstract description 9
- 230000000007 visual effect Effects 0.000 claims description 62
- 230000007547 defect Effects 0.000 claims description 33
- 230000002159 abnormal effect Effects 0.000 claims description 32
- 238000012545 processing Methods 0.000 claims description 30
- 238000000034 method Methods 0.000 claims description 22
- 238000001914 filtration Methods 0.000 claims description 21
- 239000011159 matrix material Substances 0.000 claims description 9
- 230000009466 transformation Effects 0.000 claims description 9
- 230000007797 corrosion Effects 0.000 claims description 6
- 238000005260 corrosion Methods 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 5
- 230000000877 morphologic effect Effects 0.000 claims description 5
- 230000008569 process Effects 0.000 claims description 5
- 230000010354 integration Effects 0.000 claims description 3
- 238000010200 validation analysis Methods 0.000 claims description 3
- 238000007499 fusion processing Methods 0.000 claims description 2
- 238000005516 engineering process Methods 0.000 abstract description 3
- 239000000047 product Substances 0.000 description 74
- 230000004927 fusion Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000005452 bending Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000012467 final product Substances 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
Classifications
-
- 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/26—Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes
- G01B11/27—Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes for testing the alignment of axes
- G01B11/272—Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes for testing the alignment of axes using photoelectric detection means
-
- 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/24—Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
-
- 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
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Image Analysis (AREA)
Abstract
According to the profile straightness detection method, based on the contour straight line segment extraction means of the image splicing and denoising technology, the detection efficiency and the accuracy are improved, and meanwhile, the detection result is output by multiple batches of products simultaneously by judging whether the contour straight line segment extraction is successful or not and whether the actual distance error between the contour straight line segment and the products is in a new scheme with a set range as a detection basis. For the straight line contour which is successfully extracted, calculating the distance between each pixel point on the image contour of the adjacent equipment, and converting the distance into a world coordinate system; the conversion formula is linepoint dis= | (coorline, x-1.—coorline, x-2.) | PixelDis; coorLine.x represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented per pixel; and judging whether the straightness of the current product to be detected meets the requirement by judging whether the extraction of the straight line segments of the product contour is successful, and judging whether the actual distance error between the straight line segments of the contour and the product contour is enough.
Description
Technical Field
The invention relates to a novel method for straightness detection in profile product defect evaluation, belonging to the field of image recognition and visual data processing.
Background
At present, an information technology based on image recognition and data processing is widely applied to the manufacturing and using fields of various industrial products. With the increasing demand of new energy industry on automation equipment, more and more automation equipment gradually replaces manual operation, and the requirements on the detection precision of various defects of products on a production line are also higher and higher.
If the straightness detection is used as an important index of the quality and the service performance of the section bar product, the single camera or multiple camera data collection vision can not cover the same batch of products due to the large length value of the section bar, and the difficulty of image splicing and data fusion after multiple detection is high. In addition, when factors such as shielding or nonstandard profile placement occur in an actual detection scene, obvious reduction of detection precision and efficiency can be directly caused.
The measurement precision of the existing disclosed observation and inspection equipment still cannot meet the actual requirements, and the detection precision of various models and batches is more difficult to guarantee.
In view of this, the present patent application is specifically filed.
Disclosure of Invention
The invention provides a profile straightness detection method, which aims to solve the problems in the prior art and provides a profile straightness extraction means based on an image splicing and denoising technology.
In order to achieve the design purpose, the profile straightness detection method uses a plurality of visual devices to splice, denoise, morphological process, contour extraction and contour straight line segment extraction means on the acquired product images so as to obtain the contour and the contour straight line segment of the product; for the straight line contour which is successfully extracted, calculating the distance between each pixel point on the image contour of the adjacent equipment, and converting the distance into a world coordinate system;
the conversion formula is linepoint dis= | (coorline, x-1.—coorline, x-2.) | PixelDis;
wherein, coorLine.x represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented by each pixel;
and judging whether the straightness of the current product to be detected meets the requirement by judging whether the extraction of the straight line segments of the product contour is successful, and judging whether the actual distance error between the straight line segments of the contour and the product contour is enough.
Further, the visual devices include, but are not limited to, smart cameras, depth cameras, line scan laser sensors; the detection results of the plurality of visual devices are integrated in a mode of image stitching and processing or stitching of a plurality of image processing results.
Further, the image stitching includes, but is not limited to, image registration stitching after feature points are extracted, calibration method stitching, or integration stitching of detection results of multiple visual devices directly.
Further, the section bar straightness detection method comprises the following steps:
step one) device and product positioning
Fixing a plurality of groups of visual equipment on a movable guide rail, positioning a single or a plurality of profiles at a set detection position, driving the visual equipment to move along the guide rail by a driving device and shooting, and respectively acquiring different profile images, wherein the images comprise depth or point cloud data;
step two) acquiring an image
Acquiring images shot by a plurality of groups of visual equipment;
step three) image stitching
Splicing all the images shot by the 2 groups of adjacent visual equipment;
the visual equipment for acquiring the spliced image is arranged above the section bar to be detected vertically for shooting;
step four) image processing
Step five) straightness judgment
The judging condition is that the result of the extracted straight line contour is combined with the extraction of the abnormal section on the contour, the judging steps are as follows,
5.1, calculating the distance between each pixel point on the image contour of adjacent equipment for the straight line contour successfully extracted, and converting the distance into a world coordinate system;
conversion formula linepoint di= | (cooreline, x-1.—cooreline, x-2.) | PixelDis; wherein, coorLine.x represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented by each pixel;
calculating the distance between the contour point pairs under the world coordinate system according to the formula, traversing all the point pairs in sequence, and calculating a distance set WD under the world coordinate system corresponding to all the point pairs;
5.2 judging whether there is an interval continuously beyond the defect range
Based on the judging result of the abnormal section, if the abnormal section exists on the straight profile of the profile, the straightness detection result is considered to be unqualified; otherwise, the appearance of the profile is considered to have no straightness defect, and the product is qualified.
Further, the image stitching in the third step) includes the following steps:
3.1 validation of Master
The main device is the vision device with the most public field area when shooting;
3.2 feature Point extraction and matching
The adjacent equipment is visual equipment except the main equipment, and the characteristic points of the images of the adjacent equipment are extracted and matched; the feature point extraction adopts SURF algorithm to extract feature points of the images of the adjacent devices, and a Brute force matching (Brute-Froce match) method is used to match the feature point pairs after the feature points are extracted;
3.3 Mono-enantioscope matrix calculation
Filtering feature points with low similarity by using a RANSAC algorithm on the feature point pair set, and calculating a homography matrix H between two images;
3.4 splicing
Selecting an image of any one of the adjacent devices (such as a visual device near the left side), performing perspective transformation according to the uniplanar matrix H so as to directly cover and splice the image to an image of another device (such as a visual device near the right side), and completing one-time image splicing;
3.5, circularly executing the steps 3.2 to 3.4 until the images of all adjacent devices are spliced with the images of the main device.
Further, the image processing in the fourth step) includes the following processing procedures:
4.1, gaussian denoising is carried out on the image to be detected;
4.2, carrying out binarization processing on the denoised image, filtering pixel point information outside the product height range, wherein a specific filtering range can be preset with a corresponding threshold value;
4.3, performing corrosion and expansion treatment on the binarized image, and eliminating appearance cavities and redundant noise points of the product;
4.4, detecting the product contour in the binarized image by using a Canny algorithm, and filtering redundant contours by using set characteristic adjustment parameters such as product size, product shape and the like;
and 4.5, extracting a straight line contour in the contour map by using a Hough straight line transformation algorithm, wherein the strictness of straight line extraction is set by the Hough algorithm parameters.
Further, when the above-mentioned judging whether there is a section continuously exceeding the defect range, the condition for satisfying the abnormal section includes:
5.2.1, namely, the pixel coordinates of the contour points are continuous;
5.2.2, the physical distance between all contour point pairs in the interval should meet the preset defect parameter requirement;
5.2.3 the interval length is greater than a set threshold.
Further, the method for detecting the straightness of the profile can be implemented according to the following steps:
step 1) device and product positioning
Fixing a plurality of groups of visual equipment on a movable guide rail, positioning a single or a plurality of profiles at a set detection position, driving the visual equipment to move along the guide rail by a driving device and shooting, and respectively acquiring different profile images, wherein the images comprise depth or point cloud data;
step 2) acquiring an image
Acquiring all images shot by a plurality of groups of visual equipment;
step 3) processing for each image
Step 4) straightness judgment
The judging condition is that the result of the extracted straight line contour is combined with the extraction of the abnormal section on the contour, the judging steps are as follows,
4.1, calculating the distance between each pixel point on the image contour of adjacent equipment for the straight line contour successfully extracted, and converting the distance into a world coordinate system;
conversion formula linepoint dis= | (cooreline, x-1.—cooreline, x-2.) |pixeldis; wherein, coorLine.x represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented by each pixel;
calculating the distance between the contour point pairs under the world coordinate system according to the formula, traversing all the point pairs in sequence, and calculating a distance set WD under the world coordinate system corresponding to all the point pairs;
4.2 judging whether a section continuously exceeding the defect range exists or not;
based on the judging result of the abnormal section, if the abnormal section exists on the straight profile of the profile, the straightness detection result is considered to be unqualified; otherwise, the appearance of the profile is considered to have no straightness defect, and the product is qualified;
step 5) fusing the detection results of the plurality of visual devices
The fusion process is as follows,
5.1, configuring the number of profile products which are responsible for detection by each visual device through the device;
5.2, determining an overlapping area of adjacent visual equipment responsible for detection and a profile product number;
5.3, carrying out OR operation on the detection result of the adjacent visual equipment in the public area;
and 5.4, sequentially reserving detection results of the original visual equipment according to numbers for detection results of the non-public areas, and integrating and outputting the detection results.
Further, the above-mentioned process of step 3) for processing each image includes the following procedures:
3.1, gaussian denoising is carried out on the image to be detected;
3.2, carrying out binarization processing on the denoised image, filtering pixel point information outside the product height range, wherein a specific filtering range can be preset with a corresponding threshold value;
3.3, performing corrosion and expansion treatment on the binarized image, and eliminating appearance cavities and redundant noise points of the product;
3.4, detecting the product contour in the binarized image by using a Canny algorithm, and filtering redundant contours by using set characteristic adjustment parameters such as product size, product shape and the like;
and 3.5, extracting a straight line contour in the contour map by using a Hough straight line transformation algorithm, wherein the strictness of straight line extraction is set by the Hough algorithm parameters.
Further, when the above-mentioned determination is made as to whether there is a section continuously exceeding the defect range, the condition for satisfying the abnormal section includes the following:
4.2.1, namely, the pixel coordinates of the contour points are continuous;
4.2.2, the physical distance between all contour point pairs in the interval should meet the preset defect parameter requirement;
4.2.3 the interval length is greater than a set threshold.
In summary, the method for detecting the straightness of the profile has the following advantages:
1. the simultaneous output of the detection results of the sectional material products in multiple batches is realized based on a plurality of camera splicing modes, so that the detection efficiency and the compatibility are obviously improved;
2. in the image processing, splicing, denoising, morphological processing, contour extraction and contour straight line segment extraction modes are adopted, so that the contour and the contour straight line segment of a final product can be accurately obtained, the defects of the existing detection means such as bending and shielding of the product are effectively overcome, and the detection precision is greatly improved;
3. through the accurate calculation of the physical distance between pixels, the specific defect position can be accurately found, the defect degree can be obtained through analysis by means of parameter configuration, adjustment and setting of detection standards, and the product repair and reuse can be conveniently implemented subsequently.
Drawings
The present application will now be further described with reference to the following figures;
FIG. 1 is a flow chart of a plurality of image stitching;
FIG. 2 is a flow chart of post-stitching image processing;
FIG. 3 is a flowchart of straightness calculation judgment;
FIG. 4 is a flow chart of a multiple camera detection result fusion;
Detailed Description
In embodiment 1, as shown in fig. 1 to 3, the present application proposes a method for detecting straightness of a profile, in which a plurality of visual devices are used to splice, denoise, perform morphological processing, extract a profile and extract a profile straight line segment from an acquired product image, so as to obtain a profile and a profile straight line segment of a product, and whether the straightness of a product to be detected currently meets the requirement is determined by determining whether the extraction of the profile straight line segment of the product is successful or not, and determining an actual distance error between the profile straight line segment and the profile of the product.
Further, the range of the distance error value is adjusted and judged to meet the straightness detection requirements of different products.
Further, the detection results of the plurality of visual devices can be spliced and processed through image splicing, and the image splicing comprises, but is not limited to, image registration splicing after feature points are extracted, calibration method splicing and the like.
The section bar straightness detection method comprises the following steps:
step one) device and product positioning
Fixing a plurality of groups of visual equipment on a movable guide rail, positioning a single or a plurality of profiles at a set detection position, driving the visual equipment to move along the guide rail by a driving device and shooting, and respectively acquiring different profile images, wherein the images comprise depth or point cloud data;
the visual equipment comprises, but is not limited to, a smart camera, a depth camera, a line scanning laser sensor and the like;
step two) acquiring an image
Acquiring images shot by a plurality of groups of visual equipment;
step three) image stitching
As shown in fig. 1, the images photographed by all adjacent 2 groups of vision devices are spliced;
the vision equipment for acquiring the spliced image is arranged above the section bar to be detected for shooting, and comprises the following steps:
3.1 validation of Master
The main device is the vision device with the most public field area when shooting;
3.2 feature Point extraction and matching
The adjacent equipment is visual equipment except the main equipment, and the characteristic points of the images of the adjacent equipment are extracted and matched; the feature point extraction adopts SURF algorithm to extract feature points of the images of the adjacent devices, and a Brute force matching (Brute-Froce match) method is used to match the feature point pairs after the feature points are extracted;
3.3 Mono-enantioscope matrix calculation
Filtering feature points with low similarity by using a RANSAC algorithm on the feature point pair set, and calculating a homography matrix H between two images;
3.4 splicing
Selecting an image of any one of the adjacent devices (such as a visual device near the left side), performing perspective transformation according to the uniplanar matrix H so as to directly cover and splice the image to an image of another device (such as a visual device near the right side), and completing one-time image splicing;
3.5, circularly executing the steps 3.2 to 3.4 until the images of all adjacent devices are spliced with the images of the main device;
step four) image processing
As shown in fig. 2, the process flow is as follows:
4.1, gaussian denoising is carried out on the image to be detected;
4.2, carrying out binarization processing on the denoised image, filtering pixel point information outside the product height range, wherein a specific filtering range can be preset with a corresponding threshold value;
4.3, performing corrosion and expansion treatment on the binarized image, and eliminating appearance cavities and redundant noise points of the product;
4.4, detecting the product contour in the binarized image by using a Canny algorithm, and filtering redundant contours by using set characteristic adjustment parameters such as product size, product shape and the like;
4.5, extracting a straight line contour in the contour map by using a Hough straight line transformation algorithm, wherein the strictness of straight line extraction is set by the Hough algorithm parameters;
step five) straightness judgment
As shown in fig. 3, the judgment condition is that the result of the extracted straight line contour is combined with the extraction of the abnormal section on the contour, and the judgment steps are as follows:
5.1, calculating the distance between each pixel point on the image contour of adjacent equipment for the straight line contour successfully extracted, and converting the distance into a world coordinate system;
conversion formula linepoint dis= | (Co rline, x-1.—coorline, x-2.) |pixeldis; wherein, coorLine.x represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented by each pixel;
specifically, if the edge of the profile is provided with a groove, two linear contours can be obtained for the groove part through linear contour extraction, and the contours are assumed to be a contour 1 and a contour 2, and each contour is composed of a pixel point set consisting of N pixel points; the pixel point set coordinates of the profile 1 are continuous (0, 0), (0, 1) … (0, N), the pixel point set coordinates of the profile 2 are continuous (3, 0), (3, 1) … (3, N), where N is the profile length in the profile image;
then, the X coordinate difference between the profile 1 and the profile 2 is the distance between the profiles extracted from the profile edge groove under the image coordinate system, in the above example, the two profiles are 3 pixels apart in the X direction, if each pixel represents that the distance under the world coordinate system is 500mm (PixelDis), the distance between the two profile points at the actual profile groove under the world coordinate system (i.e. the actual physical distance) is 1500mm according to the above formula; and traversing 0 to N point pairs in sequence, so that a distance set WD under a world coordinate system corresponding to the N point pairs can be calculated.
5.2 judging whether a section continuously exceeding the defect range exists or not, wherein the condition for meeting the abnormal section comprises the following contents:
5.2.1, namely, the pixel coordinates of the contour points are continuous;
for example, the continuous coordinates of a plurality of point pixels on the x/y axis are (0, 0), (0, 1), (0, 2), … (0, n), and the coordinates of the contour point pixels are continuously arranged along the y axis direction (the photographing direction of the vision apparatus may also extend along the x axis direction, and then the coordinates of the contour point pixels are continuously arranged along the x axis direction);
5.2.2, the physical distance between all the contour point pairs in the interval should meet the preset defect parameter requirement (the specific parameter value can be adjusted and modified in advance);
5.2.3 the interval length (i.e. the number of pairs of contour points) is greater than a set threshold;
when the groove of the profile is sunken or damaged, two profiles in the image are bent in a certain section and are close to or far away from the normal position, so that an abnormal section among the profiles of the profile groove is extracted, and whether the current profile groove has defects or not can be effectively and intuitively represented, namely, whether the straightness of the current profile groove meets the requirements or not;
based on the judging result of the abnormal section, if the abnormal section exists on the straight profile of the profile, the straightness detection result is considered to be unqualified; otherwise, the appearance of the profile is considered to have no straightness defect, and the product is qualified;
specifically, after the interval set WD of the two profiles of the profile groove in the world coordinate system is obtained in step 5.1, each element in the interval set WD is traversed in turn, for example, (1500 mm, …,1000mm,1500mm, …), if the straightness of the product is not satisfied when the current configuration is defect > =500 mm, an abnormal continuous interval (1000 mm ) exists in the set, and the number of elements in the interval is 3; if the current configuration is the abnormal interval length > =3, the judgment of the linearity abnormality in the linearity detection algorithm is satisfied, the product linearity detection result is considered to be unqualified, otherwise, if the current configuration parameter is the defect > =1000 mm or the required abnormal interval length >3, the product linearity detection result is considered to be qualified.
In example 2, as shown in fig. 1 to 4, another preferred embodiment is proposed, in which the method does not include step three) in example 1, and the method for integrating and outputting the multiple vision equipment detection structures is performed subsequently on the basis of the single image straightness determination.
Specifically, in the section straightness detection method of the embodiment, a plurality of visual devices are used to perform denoising, morphological processing, contour extraction and contour straight line segment extraction on the acquired product image so as to obtain the contour and the contour straight line segment of the product, and whether the straightness of the product to be detected currently meets the requirement is judged by judging whether the contour straight line segment of the product is successfully extracted, and the actual distance error between the contour straight line segment and the contour of the product.
For the image processing results of a plurality of visual devices, directly integrating and splicing the detection results;
the section bar straightness detection method comprises the following steps:
step 1) device and product positioning
Fixing a plurality of groups of visual equipment on a movable guide rail, positioning a single or a plurality of profiles at a set detection position, driving the visual equipment to move along the guide rail by a driving device and shooting, and respectively acquiring different profile images, wherein the images comprise depth or point cloud data;
the visual equipment comprises, but is not limited to, a smart camera, a depth camera, a line scanning laser sensor and the like;
step 2) acquiring an image
Acquiring images shot by a plurality of groups of visual equipment;
step 3) image processing
As shown in fig. 2, the process flow is as follows:
3.1, gaussian denoising is carried out on the image to be detected;
3.2, carrying out binarization processing on the denoised image, filtering pixel point information outside the product height range, wherein a specific filtering range can be preset with a corresponding threshold value;
3.3, performing corrosion and expansion treatment on the binarized image, and eliminating appearance cavities and redundant noise points of the product;
3.4, detecting the product contour in the binarized image by using a Canny algorithm, and filtering redundant contours by using set characteristic adjustment parameters such as product size, product shape and the like;
3.5, extracting a straight line contour in the contour map by using a Hough straight line transformation algorithm, wherein the strictness of straight line extraction is set by the Hough algorithm parameters;
step 4) straightness judgment
As shown in fig. 3, the judgment condition is that the result of the extracted straight line contour is combined with the extraction of the abnormal section on the contour, and the judgment steps are as follows:
4.1, calculating the distance between each pixel point on the image contour of adjacent equipment for the straight line contour successfully extracted, and converting the distance into a world coordinate system;
conversion formula linepoint dis= | (cooreline, x-1.—cooreline, x-2.) |pixeldis; wherein Coor. X represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented by each pixel;
specifically, if the edge of the profile is provided with a groove, two linear contours can be obtained for the groove part through linear contour extraction, and the contours are assumed to be a contour 1 and a contour 2, and each contour is composed of a pixel point set consisting of N pixel points; the pixel point set coordinates of the profile 1 are continuous (0, 0), (0, 1) … (0, N), the pixel point set coordinates of the profile 2 are continuous (3, 0), (3, 1) … (3, N), where N is the profile length in the profile image;
then, the X coordinate difference between the profile 1 and the profile 2 is the distance between the profiles extracted from the profile edge groove under the image coordinate system, in the above example, the two profiles are 3 pixels apart in the X direction, if each pixel represents that the distance under the world coordinate system is 500mm (PixelDis), the distance between the two profile points at the actual profile groove under the world coordinate system (i.e. the actual physical distance) is 1500mm according to the above formula; and traversing 0 to N point pairs in sequence, so that a distance set WD under a world coordinate system corresponding to the N point pairs can be calculated.
4.2 judging whether a section continuously exceeding the defect range exists or not, wherein the condition for meeting the abnormal section comprises the following contents:
4.2.1, namely, the pixel coordinates of the contour points are continuous;
for example, the continuous coordinates of a plurality of point pixels on the x/y axis are (0, 0), (0, 1), (0, 2), … (0, n), and the coordinates of the contour point pixels are continuously arranged along the y axis direction (the photographing direction of the vision apparatus may also extend along the x axis direction, and then the coordinates of the contour point pixels are continuously arranged along the x axis direction);
4.2.2, the physical distance between all the contour point pairs in the interval should meet the preset defect parameter requirement (the specific parameter value can be adjusted and modified in advance);
4.2.3 the interval length (i.e. the number of pairs of contour points) is greater than a set threshold;
when the groove of the profile is sunken or damaged, two profiles in the image are bent in a certain section and are close to or far away from the normal position, so that an abnormal section among the profiles of the profile groove is extracted, and whether the current profile groove has defects or not can be effectively and intuitively represented, namely, whether the straightness of the current profile groove meets the requirements or not;
based on the judging result of the abnormal section, if the abnormal section exists on the straight profile of the profile, the straightness detection result is considered to be unqualified; otherwise, the appearance of the profile is considered to have no straightness defect, and the product is qualified;
specifically, after the interval set WD of the two profiles of the profile groove in the world coordinate system is obtained in step 5.1, each element in the interval set WD is traversed in turn, for example, (1500 mm, …,1000mm,1500mm, …), if the straightness of the product is not satisfied when the current configuration is defect > =500 mm, an abnormal continuous interval (1000 mm ) exists in the set, and the number of elements in the interval is 3; if the current configuration is the abnormal interval length > =3, the judgment of the linearity abnormality in the linearity detection algorithm is satisfied, the product linearity detection result is considered to be unqualified, otherwise, if the current configuration parameter is the defect > =1000 mm or the required abnormal interval length >3, the product linearity detection result is considered to be qualified.
Step 5) fusing the detection results of the plurality of visual devices
It can be understood that the image stitching in step 5) and the image stitching in step three) of the present embodiment are two parallel stitching methods, which can be alternatively implemented;
the fusion flow is as shown in fig. 4:
5.1, configuring the number of profile products which are responsible for detection by each visual device through the device;
5.2, determining an overlapping area of adjacent visual equipment responsible for detection and a profile product number;
5.3, carrying out OR operation on the detection result of the adjacent visual equipment in the public area, namely when the detection result of any one of the adjacent visual equipment is unqualified, considering that the straightness of the section bar is unqualified;
5.4, sequentially reserving detection results of the original visual equipment according to numbers for detection results of the non-public areas, and integrating and outputting the detection results;
and 5.5, outputting the integration result to a PLC of the control system.
Specifically, if the vision equipment for detection is 2 cameras, it is assumed to be camera 1 and camera 2, and 10 profile products in each batch need to be detected simultaneously, and the product numbers are respectively 0, … and 9. The camera 1 can shoot the profile products to be 0,1,2,3,4 and 5, and the camera 2 can shoot the profile products to be 4,5,6,7,8 and 9, so that the products 4 and 5 are known to be products in the overlapping area of 2 cameras; the products 0,1,2,3 can be configured to directly take the detection result of the camera 1, the products 6,7,8,9 can directly take the detection result of the camera 2, and the detection result of the products 4,5 can take the result of the OR operation of the camera 1 and the camera 2, namely, the products are considered to be unqualified when the detection of the camera 1 or the camera 2 is unqualified. And integrating and outputting the detection results of the products 0, … and 9 to obtain the straightness detection results of the current 10 products which are simultaneously output.
The embodiments presented above in connection with the figures are only preferred solutions for achieving the objects of the invention. It will be apparent to those skilled in the art from this disclosure that other alternative constructions consistent with the design concept of the invention may be directly derived. Other structural features thus obtained shall also fall within the scope of the solution according to the invention.
Claims (10)
1. A section bar straightness detection method is characterized in that: splicing, denoising, morphological processing, contour extraction and contour straight line segment extraction means are carried out on the acquired product images by using a plurality of visual devices so as to obtain the contour and the contour straight line segment of the product;
for the straight line contour which is successfully extracted, calculating the distance between each pixel point on the image contour of the adjacent equipment, and converting the distance into a world coordinate system;
the conversion formula is linepoint dis= | (coorline, x-1.—coorline, x-2.) | PixelDis;
wherein, coorLine.x represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented by each pixel;
and judging whether the straightness of the current product to be detected meets the requirement by judging whether the extraction of the straight line segments of the product contour is successful, and judging whether the actual distance error between the straight line segments of the contour and the product contour is enough.
2. The profile straightness detection method according to claim 1, wherein: the visual equipment comprises, but is not limited to, a smart camera, a depth camera and a line scanning laser sensor;
the detection results of the plurality of visual devices are integrated in a mode of image stitching and processing or stitching of a plurality of image processing results.
3. The profile straightness detection method according to claim 2, wherein: the image stitching includes, but is not limited to, image registration stitching after feature points are extracted, calibration method stitching or integration stitching of detection results of multiple visual devices directly.
4. The profile straightness detection method according to claim 2, wherein: comprises the steps of,
step one) device and product positioning
Fixing a plurality of groups of visual equipment on a movable guide rail, positioning a single or a plurality of profiles at a set detection position, driving the visual equipment to move along the guide rail by a driving device and shooting, and respectively acquiring different profile images, wherein the images comprise depth or point cloud data;
step two) acquiring an image
Acquiring images shot by a plurality of groups of visual equipment;
step three) image stitching
Splicing all the images shot by the 2 groups of adjacent visual equipment;
the visual equipment for acquiring the spliced image is arranged above the section bar to be detected vertically for shooting;
step four) image processing
Step five) straightness judgment
The judging condition is that the result of the extracted straight line contour is combined with the extraction of the abnormal section on the contour, the judging steps are as follows,
5.1, calculating the distance between each pixel point on the image contour of adjacent equipment for the straight line contour successfully extracted, and converting the distance into a world coordinate system;
conversion formula linepoint dis= | (cooreline, x-1.—cooreline, x-2.) |pixeldis; wherein, coorLine.x represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented by each pixel;
calculating the distance between the contour point pairs under the world coordinate system according to the formula, traversing all the point pairs in sequence, and calculating a distance set WD under the world coordinate system corresponding to all the point pairs;
5.2 judging whether there is an interval continuously beyond the defect range
Based on the judging result of the abnormal section, if the abnormal section exists on the straight profile of the profile, the straightness detection result is considered to be unqualified; otherwise, the appearance of the profile is considered to have no straightness defect, and the product is qualified.
5. The profile straightness detection method according to claim 4, wherein: the step three) image stitching comprises the following procedures,
3.1 validation of Master
The main device is the vision device with the most public field area when shooting;
3.2 feature Point extraction and matching
The adjacent equipment is visual equipment except the main equipment, and the characteristic points of the images of the adjacent equipment are extracted and matched; the feature point extraction adopts SURF algorithm to extract feature points of the images of the adjacent devices, and a Brute force matching (Brute-Froce match) method is used to match the feature point pairs after the feature points are extracted;
3.3 Mono-enantioscope matrix calculation
Filtering feature points with low similarity by using a RANSAC algorithm on the feature point pair set, and calculating a homography matrix H between two images;
3.4 splicing
Selecting an image of any one of the adjacent devices (such as a visual device near the left side), performing perspective transformation according to the uniplanar matrix H so as to directly cover and splice the image to an image of another device (such as a visual device near the right side), and completing one-time image splicing;
3.5, circularly executing the steps 3.2 to 3.4 until the images of all adjacent devices are spliced with the images of the main device.
6. The profile straightness detection method according to claim 4, wherein: the image processing in the fourth step comprises the following processing flow,
4.1, gaussian denoising is carried out on the image to be detected;
4.2, carrying out binarization processing on the denoised image, filtering pixel point information outside the product height range, wherein a specific filtering range can be preset with a corresponding threshold value;
4.3, performing corrosion and expansion treatment on the binarized image, and eliminating appearance cavities and redundant noise points of the product;
4.4, detecting the product contour in the binarized image by using a Canny algorithm, and filtering redundant contours by using set characteristic adjustment parameters such as product size, product shape and the like;
and 4.5, extracting a straight line contour in the contour map by using a Hough straight line transformation algorithm, wherein the strictness of straight line extraction is set by the Hough algorithm parameters.
7. The profile straightness detection method according to claim 4, wherein: when judging whether the interval continuously exceeds the defect range, the condition for meeting the abnormal interval comprises,
5.2.1, namely, the pixel coordinates of the contour points are continuous;
5.2.2, the physical distance between all contour point pairs in the interval should meet the preset defect parameter requirement;
5.2.3 the interval length is greater than a set threshold.
8. The profile straightness detection method according to claim 2, wherein: comprises the steps of,
step 1) device and product positioning
Fixing a plurality of groups of visual equipment on a movable guide rail, positioning a single or a plurality of profiles at a set detection position, driving the visual equipment to move along the guide rail by a driving device and shooting, and respectively acquiring different profile images, wherein the images comprise depth or point cloud data;
step 2) acquiring an image
Acquiring all images shot by a plurality of groups of visual equipment;
step 3) processing for each image
Step 4) straightness judgment
The judging condition is that the result of the extracted straight line contour is combined with the extraction of the abnormal section on the contour, the judging steps are as follows,
4.1, calculating the distance between each pixel point on the image contour of adjacent equipment for the straight line contour successfully extracted, and converting the distance into a world coordinate system;
conversion formula linepoint dis= | (cooreline, x-1.—cooreline, x-2.) |pixeldis;
wherein, coorLine.x represents the pixel coordinate x value on the contour, pixelDis represents the actual distance represented by each pixel;
calculating the distance between the contour point pairs under the world coordinate system according to the formula, traversing all the point pairs in sequence, and calculating a distance set WD under the world coordinate system corresponding to all the point pairs;
4.2 judging whether a section continuously exceeding the defect range exists or not;
based on the judging result of the abnormal section, if the abnormal section exists on the straight profile of the profile, the straightness detection result is considered to be unqualified; otherwise, the appearance of the profile is considered to have no straightness defect, and the product is qualified;
step 5) fusing the detection results of the plurality of visual devices
The fusion process is as follows,
5.1, configuring the number of profile products which are responsible for detection by each visual device through the device;
5.2, determining an overlapping area of adjacent visual equipment responsible for detection and a profile product number;
5.3, carrying out OR operation on the detection result of the adjacent visual equipment in the public area;
and 5.4, sequentially reserving detection results of the original visual equipment according to numbers for detection results of the non-public areas, and integrating and outputting the detection results.
9. The profile straightness detection method according to claim 8, wherein: the process of step 3) for each image comprises the following procedures,
3.1, gaussian denoising is carried out on the image to be detected;
3.2, carrying out binarization processing on the denoised image, filtering pixel point information outside the product height range, wherein a specific filtering range can be preset with a corresponding threshold value;
3.3, performing corrosion and expansion treatment on the binarized image, and eliminating appearance cavities and redundant noise points of the product;
3.4, detecting the product contour in the binarized image by using a Canny algorithm, and filtering redundant contours by using set characteristic adjustment parameters such as product size, product shape and the like;
and 3.5, extracting a straight line contour in the contour map by using a Hough straight line transformation algorithm, wherein the strictness of straight line extraction is set by the Hough algorithm parameters.
10. The profile straightness detection method according to claim 8, wherein: when judging whether the section continuously exceeds the defect range, the condition for meeting the abnormal section comprises the following conditions,
4.2.1, namely, the pixel coordinates of the contour points are continuous;
4.2.2, the physical distance between all contour point pairs in the interval should meet the preset defect parameter requirement;
4.2.3 the interval length is greater than a set threshold.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311489589.1A CN117570880A (en) | 2023-11-09 | 2023-11-09 | Profile straightness detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311489589.1A CN117570880A (en) | 2023-11-09 | 2023-11-09 | Profile straightness detection method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117570880A true CN117570880A (en) | 2024-02-20 |
Family
ID=89883554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311489589.1A Pending CN117570880A (en) | 2023-11-09 | 2023-11-09 | Profile straightness detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117570880A (en) |
-
2023
- 2023-11-09 CN CN202311489589.1A patent/CN117570880A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108765378B (en) | Machine vision detection method for workpiece contour flash bulge under guidance of G code | |
CN109974582B (en) | Device and method for non-contact visual detection of core wire size of automobile wire harness | |
CN108229475B (en) | Vehicle tracking method, system, computer device and readable storage medium | |
CN104048969A (en) | Tunnel defect recognition method | |
CN107392849B (en) | Target identification and positioning method based on image subdivision | |
CN107358628B (en) | Linear array image processing method based on target | |
CN107703513B (en) | Non-contact net relative position detection method based on image processing | |
CN108550160B (en) | Non-uniform light bar characteristic region extraction method based on light intensity template | |
CN113284154B (en) | Steel coil end face image segmentation method and device and electronic equipment | |
CN115861274A (en) | Crack detection method integrating three-dimensional point cloud and two-dimensional image | |
CN110873718A (en) | Steel plate surface defect detection system and method based on machine vision | |
CN113970560B (en) | Defect three-dimensional detection method based on multi-sensor fusion | |
CN116228652A (en) | Pipeline weld joint surface defect detection method based on three-dimensional point cloud curvature | |
CN109993046B (en) | Self-shadow object edge identification method and device based on visual camera and vehicle | |
CN104966283A (en) | Imaging layered registering method | |
CN113705564A (en) | Pointer type instrument identification reading method | |
CN112967224A (en) | Electronic circuit board detection system, method and medium based on artificial intelligence | |
CN116596987A (en) | Workpiece three-dimensional size high-precision measurement method based on binocular vision | |
CN114092385A (en) | Industrial machine fault detection method and device based on machine vision | |
CN116597016A (en) | Optical fiber endoscope image calibration method | |
CN117570880A (en) | Profile straightness detection method | |
EP4375924A1 (en) | Cell alignment degree measurement method, controller, detection system, and storage medium | |
CN116758425A (en) | Automatic acceptance checking method and device for large-base photovoltaic power station | |
CN115388785A (en) | Flexible wire harness measuring method and system based on vision | |
CN115861220A (en) | Cold-rolled strip steel surface defect detection method and system based on improved SSD algorithm |
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 |