A method for generating cylindrical two-dimensional images based on multi-cameras

By synthesizing plane images with multi-camera technology and using image vision algorithms, the problem of low efficiency in defect detection of column products is solved, efficient, full-coverage intelligent detection is achieved, and costs and manual intervention are reduced.

CN112037178BActive Publication Date: 2024-10-29QUANZHOU AOLAIGLE ELECTRONIC CO LTD
View PDF 27 Cites 0 Cited by

Patent Information

Application Number
CN202010794749.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-10
Publication Date
2024-10-29
Estimated Expiration
2040-08-10

AI Technical Summary

Technical Problem

The existing technology cannot effectively conduct intelligent inspection of the shape, surface defects and packaging defects of column products through image processing, resulting in low efficiency, easy missed inspections and high labor intensity.

Method used

Multi-camera technology is used to obtain images of the cylinder from different angles by setting up multiple cameras, synthesize plane images, and use image vision algorithms for defect detection, including spatial point cloud acquisition of overlapping areas, pose calculation, image flattening and depth Defect detection in learning networks.

Benefits of technology

It achieves fast and accurately positioned defect detection, improves detection efficiency and coverage, reduces costs, relies entirely on computer vision, and avoids manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112037178B_ABST
    Figure CN112037178B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for generating a two-dimensional image of a cylinder based on a multi-camera, wherein multiple cameras are arranged around the cylinder to be inspected; the multiple cameras respectively acquire images of the cylinder to be inspected from different angles; the images of the cylinder to be inspected taken by the multiple cameras at the same time are synthesized into a plane image; and defect detection is performed based on the synthesized plane image. The method has the advantages of fully intelligent machine detection, no need for manual intervention, high detection coverage, low cost, high detection efficiency, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for generating a cylindrical two-dimensional image based on a multi-camera. Background Art

[0002] In daily life, there are many cylindrical daily necessities, such as candles, wine bottles, beverage bottles, etc. During the production process of these products, it is often necessary to inspect the finished products to check whether the patterns on the surface of the products are damaged or whether there are any printing errors. Products such as candles and wine bottles are labeled on the outside, and these products have relatively strict requirements on labels or patterns. Once the label or the periphery is damaged or the pattern is printed incorrectly, it will affect the user's direct perception of the product and then question the product quality. Therefore, strict inspection is required before the product leaves the factory.

[0003] Conventional inspection methods are manual inspection or random inspection. Some products are shipped directly without inspecting the appearance. Each product is visually inspected manually to see if it is consistent with the design pattern or design sample. This method has technical problems such as low efficiency, easy to miss inspection, and high labor intensity. Therefore, it is necessary to adopt an intelligent inspection system to solve these problems.

[0004] Computer vision is a simulation of biological vision using computers and related equipment. The captured pictures or videos are processed by cameras to obtain two-dimensional and three-dimensional information of the corresponding scene. In modern smart factories, cameras are often used to capture images of cylindrical products. The captured images are compared with standard images through image processing to check whether there are quality problems with the products.

[0005] The Chinese patent application number 201910859955.5 discloses a "Cylindrical Metal Surface Defect Detection Device Based on Machine Vision", which includes a base, a feed channel, a conveying device, and a feed channel which are sequentially installed on the base and connected to each other; the conveying device includes a fixed frame. The input end of the transmission device is connected to the output shaft of the servo motor fixed on the base. A shooting device is also installed on the base on one side of the side monitoring station. The patent only discloses the structure of the detection device, and does not mention any algorithm or method for detecting product defects through image processing.

[0006] None of the above existing technical solutions can solve the problem of intelligently inspecting the shape, surface defects, packaging defects, etc. of column products through image processing. Summary of the invention

[0007] The purpose of the present invention is to provide a method for generating a two-dimensional image of a cylinder based on a multi-camera, which can realize the shape detection of the cylinder by collecting images of the cylinder, processing the images and comparing the images.

[0008] The technical solution of the present invention to solve the above technical problems is as follows:

[0009] A method for generating a cylindrical two-dimensional image based on a multi-camera comprises the following steps:

[0010] Step 1: Set up multiple cameras around the cylinder to be inspected;

[0011] Step 2: The multiple cameras acquire images of the cylinder to be inspected from different angles respectively;

[0012] Step 3: Synthesize the images of the cylinder to be inspected taken by multiple cameras at the same time into a plane image;

[0013] Step 4: Perform defect detection based on the synthesized plane image.

[0014] In step 1, among the multiple cameras, there is an overlapping area between the fields of view of two adjacent cameras.

[0015] In step 1, after the camera is set up, the internal parameters of the camera and the external parameters of each camera are obtained.

[0016] In step 3, the process of synthesizing multiple images into a planar image includes the following steps:

[0017] Step 301: Process multiple images to obtain a spatial point cloud of an overlapping area of ​​images taken by adjacent cameras;

[0018] Step 302: Calculate the pose of the standard point cloud and the pose of the measured point cloud by converting the spatial coordinate system;

[0019] Step 303: Flatten the image to obtain a flat image of the cylinder to be inspected after it is unfolded.

[0020] In step 301, the process of acquiring the spatial point cloud of the overlapping area is as follows:

[0021] The step 3011: firstly perform region segmentation on two images taken by two adjacent cameras respectively;

[0022] The step 3012: confirming a plurality of feature points in the two images after the region segmentation respectively;

[0023] The step 3013: matching the feature points of the two images with each other;

[0024] The step 3014: screening each pair of matching points after matching to remove the wrong matching point pairs;

[0025] The step 3015: using the successfully matched matching point pairs, calculate the position coordinates of the corresponding spatial points of the pair of matching points on the cylinder to be inspected.

[0026] In step 302, the process of calculating the pose of the standard point cloud and the pose of the measured point cloud includes the following steps:

[0027] Step 3021: Process the point cloud using principal component analysis to calculate the measurement space coordinate system;

[0028] Step 3022: Convert the points in the measurement space into points in the design space coordinate system.

[0029] The process of flattening the image in step 303 includes the following steps:

[0030] Step 3031: Calculate the size of the expanded image and convert the image size into pixel size;

[0031] Step 3032: convert the pixel position of the expanded image into position coordinates in the design space;

[0032] Step 3033: Project the point corresponding to the position coordinate in the design space onto the camera imaging plane.

[0033] In step 4, the defect detection process includes the following steps:

[0034] Step 401: Perform template matching between the generated image and the standard image to find the corresponding relationship;

[0035] Step 402: Based on the correspondence, perform block detection on the generated image and the standard image.

[0036] In step 4, the defect detection process includes the following steps:

[0037] Step 401′: Collect a large amount of image data of qualified products and establish a training set;

[0038] Step 402′: training the deep learning network using the training set;

[0039] Step 403 ′: Utilize the trained network to perform defect detection on the synthesized plane image.

[0040] The beneficial effects of adopting the solution of the present invention are:

[0041] The present invention relates to a method for generating a two-dimensional image of a column based on a multi-camera, wherein a plurality of cameras are arranged around a column to be inspected; the plurality of cameras respectively acquire images of the column to be inspected from different angles; the images of the column to be inspected taken by the plurality of cameras at the same time are synthesized into a plane image; and defect detection is performed according to the synthesized plane image.

[0042] The control method of the present invention has the following technical features.

[0043] 1. Through image vision algorithms and image comparison, it is possible to quickly confirm whether there are defects. If there are defects, the defect position can be accurately located, with high detection efficiency.

[0044] 2. This method uses multi-camera detection, and there are overlapping areas between adjacent cameras, which can achieve full coverage detection, greatly improving the detection coverage rate, low cost, and detection efficiency is much higher than manual detection.

[0045] 4. The control method of the present invention uses computer vision solutions throughout the process without human intervention.

[0046] 5. The solution of the present invention has low hardware requirements, so the implementation cost is low and there is no special requirement for camera characteristics.

[0047] The cylindrical two-dimensional image generation method based on a multi-camera of the present invention has the advantages of fully intelligent machine detection, no need for human intervention, high detection coverage, low cost, high detection efficiency, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a schematic diagram of the camera arrangement of the present invention.

[0049] Figure 2 The flowchart of the camera calibration of the present invention.

[0050] Figure 3 The figure is a flow chart of the image synthesis of the present invention.

[0051] Figure 4 The point cloud acquisition flow chart of the image synthesis of the present invention.

[0052] Figure 5 This is a flow chart of pose calculation for image synthesis of the present invention.

[0053] Figure 6 A flow chart of an image flattening process for image synthesis of the present invention.

[0054] Figure 7 It is a schematic diagram of the triangulation principle in the point cloud acquisition process of the present invention.

[0055] Figure 8 Schematic diagram of the conversion of a cylinder into a plane in the image flattening process of the present invention.

[0056] Fig. 9 It is a schematic diagram of the correspondence between the coordinate position of the cylinder and the coordinate position of the plane image in the image flattening process of the present invention.

[0057] Fig.10 The figure is a schematic diagram of the conversion between the cylindrical space coordinates and the planar image coordinates in the image flattening process of the present invention.

[0058] In the accompanying drawings, the components represented by the reference numerals are listed as follows: DETAILED DESCRIPTION

[0059] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0060] like Figure 1 As shown in FIG. 10 , a method for generating a two-dimensional image of a cylinder based on a multi-camera includes the following four steps: steps 1 to 4.

[0061] Step 1: Set up multiple cameras around the cylinder to be inspected;

[0062] Step 2: The multiple cameras acquire images of the cylinder to be inspected from different angles respectively;

[0063] Step 3: Synthesize the images of the cylinder to be inspected taken by multiple cameras at the same time into a plane image;

[0064] Step 4: Perform defect detection based on the synthesized plane image.

[0065] In step 1, among the multiple cameras, there is an overlapping area between the fields of view of two adjacent cameras.

[0066] In the present invention, ordinary fixed-focus cameras can be used as cameras, and there is no need to select high-frame-rate, high-resolution industrial cameras. There needs to be a certain overlap between the fields of view of adjacent cameras, with an overlap rate of 20%-40%. The optimal overlap rate is 30%. In specific implementation, the higher the overlap rate, the better the detection effect, but the more computing resources are required. The lower the overlap rate, the faster the calculation, but detection failures are more likely to occur, that is, although there is overlap in the camera field of view, it cannot be guaranteed that the same part of the candle side is captured at the same time. When the selected overlap rate is 30%, the success rate of detection can be guaranteed while maintaining a relatively low computational complexity. Appendix Figure 1 Three cameras are used as an example, but it is not limited to three cameras. As long as the field of view overlap rate between cameras is met and the entire surrounding range is covered, several cameras can be arranged. When the present invention is finally applied to the production line, it is necessary to ensure that all cameras capture images at the same time, and control them through the control processor so that all cameras can be triggered synchronously and capture images at the same time.

[0067] In step 1, after the camera is set up, the internal parameters of the camera and the external parameters of each camera are obtained.

[0068] After the camera is installed, the first thing to do is to debug the camera. During debugging, you need to obtain the internal parameters of each camera and the external parameters between cameras. The internal parameters of the camera include: camera focal length, optical center, and radial distortion and tangential distortion parameters. The external parameters between cameras include: rotation and translation parameters between cameras.

[0069] After the camera is debugged, it is calibrated. The camera calibration algorithm refers to Zhang Zhengyou's calibration algorithm. The calibration process is as follows.

[0070] First, prepare a chessboard with an odd number of squares and the chessboard is flat enough to prepare a high-precision chessboard. Then perform single-camera calibration. It is necessary to ensure that the shooting angle of the chessboard is different each time to improve the calibration accuracy and shoot at least 20 valid images. When multiple cameras are fixed on the production line, place the candles to be tested in appropriate positions to quickly locate the camera angle. The cameras shoot the chessboard in the overlapping area. In order to improve the final calibration accuracy, try to ensure that the chessboard is completely photographed. Finally, when performing multi-camera calibration, first calibrate between two, and finally globally adjust the global calibration accuracy through Bundle Adjustment, or global optimization algorithms such as Levenberg-Marquardt.

[0071] In step 3, the process of synthesizing multiple images into a planar image includes the following steps:

[0072] Step 301: Process multiple images to obtain a spatial point cloud of an overlapping area of ​​images taken by adjacent cameras;

[0073] Step 302: Calculate the pose of the standard point cloud and the pose of the measured point cloud by converting the spatial coordinate system;

[0074] Step 303: Flatten the image to obtain a flat image of the cylinder to be inspected after it is unfolded.

[0075] During the image synthesis process, when assembling cameras in the production line, it is ensured that there are overlapping areas between cameras. First, the basic theory of multi-view geometry in computer vision is used to calculate the discrete point cloud of the overlapping area; second, for the estimation of the spatial point cloud of the non-overlapping area: the first step is to use the standard 3D model of the electronic candle design to perform rough registration with the measured point cloud of the overlapping area; the second step is to use the ICP (Iterative Closest Point) algorithm for global fine-tuning. When calculating the synthetic plane image after the cylinder is unfolded, the back projection algorithm is used, combined with the bilinear interpolation algorithm to obtain the final pixel value.

[0076] In step 301, the process of acquiring the spatial point cloud of the overlapping area is as follows:

[0077] The step 3011: firstly perform region segmentation on two images taken by two adjacent cameras respectively;

[0078] The step 3012: confirming a plurality of feature points in the two images after the region segmentation respectively;

[0079] The step 3013: matching the feature points of the two images with each other;

[0080] The step 3014: screening each pair of matching points after matching to remove the wrong matching point pairs;

[0081] The step 3015: using the successfully matched matching point pairs, calculate the position coordinates of the corresponding spatial points of the pair of matching points on the cylinder to be inspected.

[0082] like Figure 4 ,The detailed process of point cloud acquisition is as follows.

[0083] 1. Segment the effective area first. During the assembly process of the production line, there is a large color deviation between the surrounding environment and the object being measured, and the color value is used for rapid segmentation.

[0084] 2. Feature point detection. SIFT (Scale-invariant feature transform) is usually used to detect feature points. SIFT is an algorithm used in the field of image processing. This algorithm has scale invariance and can detect key feature points in an image.

[0085] 3. For feature point matching, you can use brute force matching or build a kd-tree and combine it with KNN for fast matching.

[0086] Using the camera calibration results, we can calculate the fundamental matrix F (F for short) between different cameras. The calculation formula is as follows:

[0087] F=K' -T [t] x R -1 (1)

[0088] In formula (1), K and K′ are the internal parameter matrices of two adjacent cameras,

[0089] where f x and f y Represent the two focal lengths of a single camera, c x and c y are the two optical centers of the camera, indicating the offset of the camera optical axis in the image coordinate system;

[0090] where f′ x and f′ y Represents the two focal lengths of a single camera, c' x and c' y are the two optical centers of the camera, indicating the offset of the camera optical axis in the image coordinate system;

[0091] The distortion parameters are not included in this formula. In actual processing, the captured image is first dedistorted and then the subsequent processing is performed. K in formula (1) is the same internal parameter matrix as formula (9). R represents the rotation matrix between cameras; vector t represents the translation vector between cameras; [t]x represents the operator that converts vector t into an antisymmetric matrix; related calculation parameters can be calculated in advance after the assembly calibration is completed, without having to repeat the calculation for each inspection.

[0092] 4. Filter the matching points and remove the mismatched points. Directly using general feature point extraction and matching algorithms usually contains a lot of unmatched point pairs, which greatly interfere with the subsequent point cloud computing. Using the spatial constraint relationship of the camera, the interference point pairs can be excluded. Generally, by calculating the polar distance d, when the polar distance d exceeds a certain set polar distance threshold, the interference point pair is excluded.

[0093] The calculation formula (2) of the polar distance is as follows:

[0094]

[0095] Among them, x and x′ represent a matching point pair; F is the basic matrix, that is, the Fundamental Matrix in the figure, referred to as F-Matrix; (Fx)1 and (Fx)2 represent the first two dimensions of the vector Fx.

[0096] 5. Using matching point pairs and knowing the spatial geometric relationship between cameras, the spatial position of the matching point pairs can be calculated using the triangulation principle. Figure 7 It is a schematic diagram of the triangulation principle. The two parallelograms represent the imaging surfaces of the two cameras. C and C' represent the optical centers of the cameras, X' and X represent a matching point pair, and point P is the position of the spatial point to be calculated.

[0097] In step 302, the process of calculating the pose of the standard point cloud and the pose of the measured point cloud includes the following steps:

[0098] Step 3021: Process the point cloud using principal component analysis to calculate the measurement space coordinate system;

[0099] Step 3022: Convert the points in the measurement space into points in the design space coordinate system.

[0100] like Figure 5 ,The specific process of the above pose calculation is as follows.

[0101] 1. Perform principal component analysis (PCA) on the calculated point cloud. The data is three-dimensional. The final calculation result will obtain three mutually perpendicular directions, which are the measurement space coordinate system. The coordinate axis can be expressed as a rotation matrix. The coordinate origin is denoted as t c .

[0102] 2. When designing a product, there is a custom design space coordinate system. Assume that the mathematical symbols are expressed as With t s ; Coordinate axis uses rotation matrix The origin of the coordinate is denoted by t s .

[0103] In addition, assume that a point in the product design space is represented by x s , then its coordinate x in the measurement space coordinate system c It can be expressed by formula (3):

[0104]

[0105] Rearranging the above formula (3), the transformation relationship between the two coordinate systems can be expressed by formula (4) and formula (5).

[0106]

[0107]

[0108] According to the following equation (6), the product design standard model can be transformed into the measurement space.

[0109]

[0110] Among them, x s is a model point in the design space; x c It means x s Transform to a point in measurement space.

[0111] The coordinate system conversion method using the above formula (3) is rough, and further fine-tuning is required during implementation. Fine-tuning generally uses the iterative closest point (ICP) algorithm to fine-tune the design space point cloud and the measurement space point cloud, which can obtain a more accurate conversion relationship, thereby improving the accuracy of the calculation.

[0112] The process of flattening the image in step 303 includes the following steps:

[0113] Step 3031: Calculate the size of the expanded image and convert the image size into pixel size;

[0114] Step 3032: convert the pixel position of the expanded image into position coordinates in the design space;

[0115] Step 3033: Project the point corresponding to the position coordinate in the design space onto the camera imaging plane.

[0116] In the process of flattening the image, Figure 6 As shown, the specific steps are as follows.

[0117] 1. If Figure 8 First, calculate the size of the expanded image. You need to convert the physical size into pixels. The following figure shows the conversion of a cylinder into a flat image. The radius R and height H of the cylinder are determined during the design phase.

[0118] Assuming that the width of the final image is width(pixel), the calculation formula for the number of height pixels heirht is (7):

[0119]

[0120] 2. If Fig. 9 As shown, the expanded image pixel position is converted into a spatial coordinate position.

[0121] Assuming that the pixel position of any point P in the expanded image is (w, h), the coordinate point Q converted to the post-space coordinate system is calculated as follows:

[0122]

[0123] x=R*cos(α)

[0124] y=R*sin(α)

[0125]

[0126] In formula (8), width and height are the pixel sizes of the expanded image, in pixels; H is the physical height of the cylinder design, R is the cylinder design radius, in physical length; the position of point P in the expanded image is (w, h), in pixels; point Q is the cylinder point corresponding to point P, and the coordinates of point Q are (x, y, z), which are calculated in the above way and in physical length; α is Fig. 9 The angle α in Fig. 9 The angle between the projection of the line connecting the origin and point Q in the XYZ coordinate system on the xy plane and the x-axis.

[0127] 3. If Fig.10 As shown, it is a schematic diagram of the conversion of spatial point cloud to camera plane.

[0128] Fig.10 In the figure, a point Q on the cylinder is projected onto the camera imaging plane point M. The specific calculation formula (9) is as follows:

[0129]

[0130] In formula (9), K is the internal parameter of camera calibration, which is the same as that in formula (1). Distortion parameters are not included in K. Before entering the algorithm, the first step is to perform image dedistortion processing; distortion processing is an implicit processing process. When using a general camera lens, the distortion is relatively small and no processing is required; however, if it is a wide-angle lens, the distortion is relatively serious and distortion processing is required. It needs to be flexibly adjusted according to the actual situation.

[0131] R and t represent the selection matrix and translation vector respectively, which are the external parameters of camera calibration and are predetermined after the camera is configured; u and v are the coordinate values ​​of point M; x, y and z are the coordinate values ​​of point Q; λ is a scaling factor that does not affect the final calculation and is a pre-set constant.

[0132] 4. Determine whether the projection point M is within the camera imaging plane.

[0133] A point Q on the cylinder cannot be seen by all cameras at the same time, so these pseudo-projection points need to be excluded; the exclusion method is relatively simple, that is, M(u, v) obtained in the previous step is within the captured image area.

[0134] The calculation of the projection to the camera imaging surface point (u, v) is usually a floating point number, while the camera imaging position is a discrete integer value, so it is necessary to interpolate the projection pixel position. In specific implementation, the bilinear interpolation method is usually used to obtain the pixel value of the projection position.

[0135] 5. For pixels in the overlapping area, weighted interpolation can be performed based on the distance from the projection point M to the camera center.

[0136] 6. Fill the final calculated pixel value into the flattened image position, that is Fig. 9 Midpoint P position.

[0137] In step 4, the defect detection process includes the following steps:

[0138] Step 401: Perform template matching between the generated image and the standard image to find the corresponding relationship;

[0139] Step 402: Based on the correspondence, perform block detection on the generated image and the standard image.

[0140] The calculation method of block detection can be to make a difference in the corresponding area. When the difference is greater than a certain threshold, an abnormality is reported and a defect is determined.

[0141] In step 4, the defect detection process includes the following steps:

[0142] Step 401′: Collect a large amount of image data of qualified products and establish a training set;

[0143] Step 402′: training the deep learning network using the training set;

[0144] Step 403 ′: Utilize the trained network to perform defect detection on the synthesized plane image.

[0145] When using a deep learning network for defect detection, it is necessary to first collect a large amount of image data and label it; then train the deep learning network; and finally use the trained network for defect detection.

[0146] In the control method of the present invention, multiple cameras are arranged around the column to be inspected; the multiple cameras respectively obtain images of the column to be inspected from different angles; the images of the column to be inspected taken by the multiple cameras at the same time are synthesized into a plane image; and defect detection is performed based on the synthesized plane image.

[0147] The control method of the present invention has the following technical features.

[0148] 1. Through image vision algorithms, images taken by multiple cameras are stitched together into a flat image.

[0149] 2. The plane image can be directly matched with the original design drawing for template matching to quickly confirm whether there are defects. If so, the defect position can be accurately located.

[0150] 3. This method uses multi-camera detection, and there are overlapping areas between adjacent cameras, which greatly improves the detection coverage, has low cost, and the detection efficiency is much higher than manual detection.

[0151] 4. The control method of the present invention uses computer vision solutions throughout the process without human intervention.

[0152] 5. The solution of the present invention has low hardware requirements, so the implementation cost is low and there is no special requirement for camera characteristics.

[0153] The cylindrical two-dimensional image generation method based on a multi-camera of the present invention has the advantages of fully intelligent machine detection, no need for human intervention, high detection coverage, low cost, high detection efficiency, etc.

[0154] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0155] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for generating a cylindrical two-dimensional image based on a multi-camera, characterized in that: The steps include: Step 1: Set up multiple cameras around the cylinder to be inspected; Step 2: The multiple cameras acquire images of the cylinder to be inspected from different angles respectively; Step 3: Combine the images of the cylinder to be inspected taken by multiple cameras at the same time into a plane image, including: Step 301: Process multiple images to obtain a spatial point cloud of an overlapping area of ​​images taken by adjacent cameras; Step 302: Calculate the pose of the standard point cloud and the pose of the measured point cloud by converting the spatial coordinate system; Step 303: Flatten the image to obtain a flat image of the cylinder to be inspected after it is unfolded; The process of flattening the image in step 303 includes the following steps: Step 3031: Calculate the size of the expanded image and convert the image size into pixel size. The cylinder radius R, height H, image width in pixels is width, height in pixels is height. The calculation formula is: Step 3032: convert the pixel position of the expanded image into position coordinates in the design space; The pixel position of any point P in the expanded image is (w, h), and the coordinate point Q converted to the back space coordinate system is calculated as follows: xRR*cos(α) y=RR*sin(α) The coordinates of point Q are (x, y, z); Step 3033: Projecting the point corresponding to the position coordinate in the design space onto the camera imaging plane, including: Project point Q to the camera imaging plane point M, and the calculation formula is as follows: Where K is the camera calibration internal parameter matrix, R and t represent the selection matrix and translation vector, respectively, which are the camera calibration external parameters and are predetermined after the camera is configured; u and v are the coordinate values ​​of point M; λ is a scaling factor, which is a preset constant; A point Q on the cylinder cannot be seen by all cameras at the same time, so these pseudo-projection points need to be excluded; that is, M(u,v) obtained in the previous step is within the captured image area; The calculation of the projection to the camera imaging surface point (u, v) is usually a floating point number, while the camera imaging position is a discrete integer value. Therefore, it is necessary to interpolate the projection pixel position and use the bilinear interpolation method to obtain the pixel value of the projection position; For pixels in the overlapping area, weighted interpolation is performed based on the distance from the projection point M to the camera center; Fill the pixel value of the projection position into the flattened image position; Step 4: Perform defect detection based on the synthesized plane image.

2. The method for generating a cylindrical two-dimensional image based on a multi-camera according to claim 1, characterized in that: In step 1, among the multiple cameras, there is an overlapping area between the fields of view of two adjacent cameras.

3. The method for generating a cylindrical two-dimensional image based on a multi-camera according to claim 1, characterized in that: In step 1, after the camera is set up, the internal parameters of the camera and the external parameters of each camera are obtained.

4. The method for generating a cylindrical two-dimensional image based on a multi-camera according to claim 1, characterized in that: In step 301, the process of acquiring the spatial point cloud of the overlapping area is as follows: The step 3011: firstly perform region segmentation on two images taken by two adjacent cameras respectively; The step 3012: confirming a plurality of feature points in the two images after the region segmentation respectively; The step 3013: matching the feature points of the two images with each other; The step 3014: screening each pair of matching points after matching to remove the wrong matching point pairs; The step 3015: using the successfully matched matching point pairs, calculate the position coordinates of the corresponding spatial points of the pair of matching points on the cylinder to be inspected.

5. The method for generating a cylindrical two-dimensional image based on a multi-camera according to claim 1, characterized in that: In step 302, the process of calculating the pose of the standard point cloud and the pose of the measured point cloud includes the following steps: Step 3021: Process the point cloud using principal component analysis to calculate the measurement space coordinate system; Step 3022: Convert the points in the measurement space into points in the design space coordinate system.

6. The method for generating a cylindrical two-dimensional image based on a multi-camera according to claim 1, characterized in that: In step 4, the defect detection process includes the following steps: Step 401: Perform template matching between the generated image and the standard image to find the corresponding relationship; Step 402: Based on the correspondence, perform block detection on the generated image and the standard image.

7. The method for generating a cylindrical two-dimensional image based on a multi-camera according to claim 1, characterized in that: In step 4, the defect detection process includes the following steps: Step 401′: Collect a large amount of image data of qualified products and establish a training set; Step 402′: training the deep learning network using the training set; Step 403 ′: Utilize the trained network to perform defect detection on the synthesized plane image.

Citation Information

Patent Citations

  • Cylindrical metal surface defect detection device based on machine vision

    CN110560377A

  • Double-CCD (Charge Coupled Device) detecting method and system for apparent defect assessment of civil engineering structure

    CN102183524A

  • Beverage can defect detection system and method based on spatial expansion

    CN104422700A

  • Multi-scale cylindrical projection panorama image generating method for video monitoring

    CN104574339A

  • Digital-speckle three-dimensional quick scanning method of human body

    CN105046746A