Cylinder reconstruction method and system based on patch contour information
By collecting and processing the patch profile image data when the cylinder rotates or moves, and calculating and constructing the coordinate matrix, the three-dimensional model reconstruction of the cylinder is realized, which solves the problems of large calculation amount and poor anti-interference in the existing technology, and improves detection efficiency. efficiency and accuracy.
Patent Information
- Application Number
- CN202210662354.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When dealing with the cylinder in the patch paving mechanism, the existing three-dimensional reconstruction technology requires a large amount of calculation, high requirements on the environment and light source, poor anti-interference, and is easily affected by noise, resulting in low detection efficiency and failure of three-dimensional reconstruction.
By collecting the patch profile image data when the cylinder rotates or moves, the coordinates of the center of gravity of the patch profile are calculated, and a coordinate matrix is constructed to realize the reconstruction of the three-dimensional model of the cylinder and intuitively describe the missing patch and the size of the gap.
It realizes the rapid restoration of the three-dimensional model of the cylinder in the two-dimensional image, reduces the calculation amount, improves the detection efficiency, can intuitively describe the relative position and gap size of the patch, and enhances the anti-interference ability.
Smart Images

Figure CN114898050B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional reconstruction of images, and in particular to a method and system for reconstructing a cylinder based on patch contour information. Background Art
[0002] The purpose of 3D reconstruction technology is to recover 3D graphics from 2D images and to explain the spatial position relationship between objects in the image. The existing 3D reconstruction technology mainly uses the acquired depth information of the target scene or object to achieve 3D restoration of the scene through the registration and fusion of point cloud data. Since the patches on the cylinder in the patch paving mechanism are relatively dense, and each patch on the cylinder is of the same size and shape, and has a similar color to the cylinder, the existing 3D reconstruction technology requires a large amount of point cloud data containing depth information during the implementation of this problem, resulting in excessive calculation, which affects the work efficiency of the detection process. At the same time, the existing technology has high requirements for the environment, light source, etc., is not anti-interference, and is easily affected by noise, which will also lead to the failure of 3D reconstruction of the cylinder. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a cylinder reconstruction method and system based on patch contour information, which can quickly restore the three-dimensional model of the cylinder in the patch laying mechanism through a two-dimensional image, and can explain the relative position relationship of the patches on the cylinder, so as to intuitively describe the missing state of the cylinder patches and the size of the gaps between the patches.
[0004] In order to achieve the above object, the present invention provides the following technical solutions:
[0005] The barrel reconstruction method based on patch contour information provided by the present invention comprises the following steps:
[0006] Collecting patch contour image data after the cylinder is rotated according to the rotation angle α; calculating the contour of the patch in the patch contour image data collected each time, and then calculating the coordinates of the center of gravity of the patch contour;
[0007] The center of gravity coordinates obtained by collecting pictures at each rotation angle α during the rotation of the cylinder are stored in the coordinate matrix p j In the coordinate matrix, each element corresponds to the centroid coordinates of the patch contour in the image coordinate system;
[0008] or
[0009] Collect the patch contour image data after the cylinder moves h in the ascending direction or descending direction; calculate the contour data of the patch in each collected image, and then calculate the coordinates of the centroid of the patch contour;
[0010] The coordinates of the center of gravity obtained by collecting the images in one cycle of the cylinder after the upward movement or the downward movement h are stored in the coordinate matrix p j In the coordinate matrix, each element corresponds to the centroid coordinates of the patch contour in the image coordinate system;
[0011] Further, the coordinates of the centroid of the patch outline are calculated according to the following steps:
[0012] S1: Collect patch contour image data and determine the maximum number n of patches in each row of the starting position acquisition image;
[0013] S2: preprocessing contour image data;
[0014] S3: extract patch contour;
[0015] S4: Calculate the centroid coordinates of each contour.
[0016] Further, the patch contour image data after the collection cylinder is rotated according to the rotation angle α is performed according to the following steps:
[0017] S3: Set the cylinder rotation angle α;
[0018] One rotation of the cylinder is recorded as a cycle T i , a period T i The camera collects a picture every time the inner rotating body rotates α. The collected pictures are saved in sequence into the picture set each time. One cycle T i A total of j pictures were collected;
[0019]
[0020] Among them, n is the maximum number of patches recognized in each row of the image collected by the camera at the starting position; N is the rated value of the number of patches in each row of the cylinder.
[0021] S4: Every time the cylinder rotates α, the coordinates of the center of gravity of the patch contour are calculated until a period T i Finish.
[0022] Furthermore, the coordinate matrix p j Follow the steps to determine:
[0023] Period T i The reconstruction starts with acquiring the initial position, that is, from the coordinate matrix p 0 start.
[0024] p 1 The element immediately follows p 0 The elements in are concatenated to obtain the reconstructed coordinate matrix p′ 1 , and so on to obtain the reconstructed coordinate matrix p′j ,Right now:
[0025] p′ j =jA m×n +p j ;
[0026] in, d is the width pixel value of the collected image;
[0027] Get a period T i The coordinate matrix of the inner reconstruction:
[0028]
[0029] Further, the patch contour image data after the cylinder moves in the ascending direction or descending direction for h is collected according to the following steps:
[0030] The cylinder moves up or down by a distance of h, and the initial position period of image acquisition is T 0 , if T 0 After the cycle ends, the cylinder moves upward, that is, the collected image moves downward relative to the initial position, that is, it moves in the positive direction along the y-axis of the image coordinate system. One rotation of the cylinder is recorded as the cycle T i , (i>0); or
[0031] The cylinder moves downward, and the collected image moves upward relative to the initial position, moving along the negative direction of the y-axis of the image coordinate system, denoted by T i , (i<0), where i is the number of up and down movements, the cylinder moves from the starting position to one direction. If i=i max After that, the cylinder returns to i=0 and moves in the other direction until i=i min ;
[0032] The cylinder moves up and down a distance h and completes a cycle T i The reconstruction is repeated until the total distance moved is equal to the total length pixel value H of the cylinder. The number of moves is recorded as k, where k = i max -i min .
[0033] Furthermore, the coordinate reconstruction in the vertical direction is performed in the following steps:
[0034] According to the coordinate matrix P reconstructed in each cycle i Reconstruct the rotating body in the vertical direction;
[0035] The reconstructed coordinate matrix:
[0036] P′ i =iB m×n +P i ;
[0037] in,
[0038] l is the height pixel value of the collected image. If T 0 After the cycle ends, the cylinder moves upward, i>0; if T 0 After the cycle ends, the rotating body moves downward, i<0.
[0039] Furthermore, the patch centroid coordinate matrix is as follows:
[0040]
[0041] The matrix M is the coordinate matrix of the centroid of the patch reconstructed with the initial position of the camera captured image as the starting point.
[0042] Furthermore, the relative position of each patch on the cylinder is calculated according to the reconstructed barycentric coordinate matrix M, and then the position of each point in the matrix M is marked on a rectangle with a pixel value size of (k·h)×(j·d).
[0043] Further, the method further comprises the following steps:
[0044] The rectangle is restored to a cylinder with the side length of k·h as the height and the side length of j·d as the bottom perimeter. Each point on the rectangle is used as the modeling center of the patch. Since each patch has the same size and shape, a model consistent with the actual patch size and shape is established at the coordinates of the contour centroid, that is, the point on the rectangle.
[0045] The present invention provides a barrel reconstruction system based on patch contour information, which includes a storage unit and a processing unit. The storage unit stores a computer program that can be run on the processing unit. When the processing unit executes the computer program, it implements the barrel reconstruction method based on patch contour information as described above.
[0046] The beneficial effects of the present invention are:
[0047] The present invention provides a cylinder reconstruction method and system based on patch contour information. The method calculates the centroid coordinates of the patch contour through collected images at different rotation angles or moving distances, thereby reconstructing the cylinder in the fragment paving mechanism; the method can restore the cylinder according to the centroid coordinates of the patch surface, and the method can quickly restore the three-dimensional model of the cylinder in the patch paving mechanism through two-dimensional images, explain the relative position relationship of the patches on the cylinder, and thus can intuitively describe the missing state of the cylinder patches and the size of the gaps between the patches, and obtain the missing state of the cylinder patches and the size of the gaps between the patches.
[0048] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to make the purpose, technical solution and beneficial effects of the present invention clearer, the present invention provides the following drawings for illustration:
[0050] Figure 1 The figure is the overall flow chart of the method.
[0051] Figure 2 This is the initial picture effect.
[0052] Figure 3 Schematic diagram of the coordinate system of the cylinder patch image.
[0053] Figure 4 The barycentric coordinate matrix M is a schematic diagram indicating the relative positions of patches.
[0054] Figure 5 This is a schematic diagram of the cylinder structure after reconstruction. DETAILED DESCRIPTION
[0055] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0056] Example 1
[0057] like Figure 1 As shown, the cylinder reconstruction method based on patch contour information provided in this embodiment, first, collects pictures at the starting position through an industrial camera, stores them in a picture set, crops the pictures, performs Gaussian filtering, canny edge detection, extracts contours, and then combines the template picture set to perform template matching, obtain the complete patch contour, obtain the patch contour centroid coordinates, complete the entire patch contour centroid coordinate acquisition process, and obtain the picture contour centroid coordinate data set. Within a cycle, the centroid coordinates of each picture are stored in a coordinate matrix, and the centroid coordinate matrix after reconstruction within the cycle is calculated to complete the coordinate reconstruction process within the cycle, and then the centroid coordinates in the vertical direction are calculated according to the lifting distance of the cylinder within a cycle, and the reconstructed centroid coordinate matrix is calculated, and finally the cylinder model is reconstructed according to the matrix.
[0058] The method for reconstructing a cylinder based on patch contour information provided in this embodiment is specifically performed in the following steps:
[0059] Step 1: Collect the first picture at the starting position and record the maximum number of patches n recognized in each row of the picture collected by the camera at the starting position. The initial picture effect is as follows Figure 2 As shown, Figure 2 This is the initial picture effect picture;
[0060] Obtaining the coordinates of the center of gravity of the patch outline:
[0061] Step 2: Image preprocessing. The image is collected by an industrial camera. Since the image area captured by the industrial camera is relatively large and there is a certain degree of distortion on both sides of the rotating body, the image needs to be cropped before image processing, and the fixed pixel area of the collected image h×d pixel value is processed and detected. The image is preprocessed before contour detection, and Gaussian filtering is used to remove some noise and retain the edge information of the patch.
[0062] Step 3: Contour detection. After denoising, the canny operator is used for edge detection and the detected contour is drawn. Since the contour obtained by the above edge detection is incomplete and not closed, the drawn contour cannot be directly applied to cylinder reconstruction. Based on the canny edge detection, the standard patch contour image of the Template template image set is used for template matching to obtain a complete patch contour.
[0063] Step 4: Contour barycentric coordinates. After obtaining the complete patch contour, use the barycentric coordinate formula to calculate the barycentric coordinate pixel value of each contour in the image.
[0064] Step 5: Calculate the cylinder rotation angle α within the cycle.
[0065] One rotation of the cylinder is recorded as a cycle T i , a period T i The camera collects a picture every time the inner rotating body rotates α. The collected pictures are saved in sequence into the picture set each time. One cycle T i A total of j pictures were collected.
[0066]
[0067] Among them, n is the maximum number of patches recognized in each row of the image collected by the camera at the starting position; N is the rated value of the number of patches in each row of the cylinder.
[0068] Step 6: Repeat steps 2 to 4 every time the cylinder rotates α, until a cycle T is reached. i Finish.
[0069] Cylinder patch reconstruction steps:
[0070] Establish the image coordinate system, such as Figure 3 As stated, Figure 3 It is a schematic diagram of the coordinate system of the cylinder patch image;
[0071] 1. Period T i Internal reconstruction:
[0072] Step 7:
[0073] The centroid coordinates obtained by sequentially collecting the jth picture in a cycle by the camera are stored in the coordinate matrix p j In the matrix, each element corresponds one-to-one to the coordinates of the centroid of the patch contour in the above image coordinate system.
[0074]
[0075] Among them, m and n are the number of rows and columns of patches in the image, respectively.
[0076] Represents the centroid coordinates of the patch contour in the mth row and nth column in the jth image.
[0077] Represents the horizontal coordinate of the centroid of the patch contour in the mth row and nth column in the jth image.
[0078] Represents the ordinate of the centroid of the patch contour in the mth row and nth column of the jth image.
[0079] Step 8:
[0080] Period T i The reconstruction starts with the initial camera position, that is, from the coordinate matrix p 0 start.
[0081] p 1 The element immediately follows p 0 The elements in are concatenated to obtain the reconstructed coordinate matrix p′ 1 , and so on to obtain the reconstructed coordinate matrix p′ j ,Right now:
[0082] p′ j =jA m×n +p j ;
[0083] in, d is the width pixel value of the collected image;
[0084] j represents the sequence number of the patch contour image collected in the current cycle.
[0085] p j Represents the centroid coordinate matrix of the patch outline of the jth image.
[0086] (d,0) represents the horizontal transformation coordinate, where d is the image width in pixels.
[0087] A m×n Represents the horizontal coordinate transformation matrix.
[0088] Get a period T i The coordinate matrix of the inner reconstruction:
[0089]
[0090] Among them, P i Represents the period T i The matrix composed of the centroid coordinates of all patch outlines.
[0091] p 0 Represents the centroid coordinate matrix of the patch contour obtained by collecting the image at the initial position of the camera.
[0092] 2. Reconstruction in the vertical direction of the cylinder
[0093] Step 9:
[0094] Cylinder lifting.
[0095] In order to reconstruct the entire barrel patch situation, in a period T i After the end, the cylinder should move up or down by a distance of h, and the initial position period of image acquisition is T 0 , if T 0 After the cycle ends, the cylinder moves upward, that is, the camera moves downward relative to the initial position of the image, that is, it moves in the positive direction along the y-axis of the image coordinate system, denoted by T i , (i>0); Similarly, if T 0 After the cycle is over, the cylinder moves downward, that is, the camera moves upward relative to the initial position of the image, that is, moves along the negative direction of the y-axis of the image coordinate system, denoted by T i , (i<0), where i is the number of up and down movements, (the cylinder can only move in one direction from the starting position. If i=i max After that, the cylinder returns to i=0 and moves in the other direction until i=i min . )
[0096] Step 10:
[0097] The cylinder moves up and down a distance h, that is, it completes a cycle T i Repeat steps 5 to 9 until the total distance moved is equal to the total length pixel value H of the cylinder. The number of moves is k, where k = i max -i min .
[0098] Step 11: Reconstruction of vertical coordinates.
[0099] According to the coordinate matrix P reconstructed in each cycle i Reconstruct the vertical direction of the rotating body.
[0100] The reconstructed coordinate matrix:
[0101] P′ i =iB m×n +P i ;
[0102] in,
[0103] Among them, B m×n Represents the vertical coordinate transformation matrix.
[0104] l is the height pixel value of the collected image. If T 0 After the cycle ends, the cylinder moves upward, i>0; if T 0 After the cycle ends, the rotating body moves downward, i<0.
[0105]
[0106] Therefore, the matrix M is the centroid coordinate matrix of the patch reconstructed with the initial position of the camera captured image as the starting point.
[0107] Step 12:
[0108] The relative position of each patch on the cylinder can be known according to the reconstructed barycentric coordinate matrix M, and then the position of each point in the matrix M is marked on a rectangle with a pixel value of (k·h)×(j·d), as follows: Figure 4 shown.
[0109] Figure 4 Schematic diagram of the relative position of the patch for the center of gravity coordinate matrix M
[0110] Step 13:
[0111] The rectangle is restored to a cylinder with the side length of k·h as the height and the side length of j·d as the perimeter of the bottom. Each point on the rectangle is used as the modeling center of the patch. Since each patch has the same size and shape, a model with the same size and shape as the actual patch is established at the coordinates of the contour center, i.e., the point on the rectangle, to reconstruct the cylinder. The reconstructed cylinder is as follows: Figure 5 As shown, Figure 5 This is a schematic diagram of the cylinder structure after reconstruction.
[0112] Example 2
[0113] The present embodiment is a cylinder reconstruction system based on patch contour information, the system includes a storage unit and a processing unit, the storage unit stores a computer program that can be run on the processing unit, and the processing unit implements the above-mentioned cylinder reconstruction method based on patch contour information when executing the computer program.
[0114] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A cylinder reconstruction method based on patch contour information, characterized in that: The following steps are involved: Collect the patch contour image data after the cylinder is rotated according to the rotation angle α; calculate the contour data of the patch in each collected image, and then calculate the coordinates of the center of gravity of the patch contour; The center of gravity coordinates obtained by collecting pictures every α rotation of the cylinder during one cycle are stored in the coordinate matrix p j , each element in the coordinate matrix corresponds one-to-one to the coordinates of the centroid of the patch contour in the image coordinate system; or Collect the patch contour image data after the cylinder moves a distance h in the ascending or descending direction; calculate the contour data of the patch in each collected image, and then calculate the coordinates of the center of gravity of the patch contour; The coordinates of the center of gravity obtained by collecting the images within one cycle of the cylinder after moving a distance h in the ascending or descending direction are stored in the coordinate matrix p j In the coordinate matrix, each element corresponds to the centroid coordinates of the patch contour in the image coordinate system; The patch centroid coordinate matrix is as follows: Among them, the matrix M is the coordinate matrix of the patch center of gravity reconstructed with the initial position of the camera acquisition picture as the starting point; The relative position of each patch on the cylinder is calculated according to the reconstructed patch centroid coordinate matrix M, and then the position of each point in the matrix M is marked on a rectangle with a pixel value size of (k·h)×(j·d); The following steps are also included: The rectangle is restored to a cylinder with the side length of k·h as the height and the side length of j·d as the bottom perimeter. Each point on the rectangle is used as the modeling center of the patch. Since each patch has the same size and shape, a model consistent with the actual patch size and shape is established at the coordinates of the contour centroid, that is, the point on the rectangle.
2. The barrel reconstruction method based on patch contour information according to claim 1, characterized in that: The coordinates of the center of gravity of the patch outline are calculated according to the following steps: S1: Collect patch contour image data and determine the maximum number n of patches in each row of the starting position acquisition image; S2: preprocessing contour image data; S3: extract patch contour; S4: Calculate the centroid coordinates of each contour.
3. The barrel reconstruction method based on patch contour information according to claim 1, characterized in that: The patch contour image data after the cylinder is rotated according to the rotation angle α is collected according to the following steps: S3: Set the cylinder rotation angle α; One rotation of the cylinder is recorded as a cycle T i , a period T i The camera collects a picture every time the inner rotating body rotates α. The collected pictures are saved in sequence into the picture set each time. One cycle T i A total of j pictures were collected; Where n is the maximum number of patches recognized in each row of the image collected by the camera at the starting position; N is the rated value of the number of patches in each row of the cylinder; S4: Every time the cylinder rotates α, the coordinates of the center of gravity of the patch contour are calculated until a period T i Finish.
4. The barrel reconstruction method based on patch contour information according to claim 1, characterized in that: The coordinate matrix p j Follow the steps to determine: Period T i The reconstruction within starts with acquiring the initial position, i.e. starting from the coordinate matrix p0; The elements in p1 are concatenated with the elements in p0 to obtain the reconstructed coordinate matrix p′1, and so on to obtain each reconstructed coordinate matrix p′ j ,Right now: p′ j =yA m×n +p j ; in, d is the width pixel value of the collected image; Get a period T i The coordinate matrix of the inner reconstruction:
5. The barrel reconstruction method based on patch contour information according to claim 1, characterized in that: The patch contour image data after the cylinder moves a distance h in the ascending or descending direction is collected according to the following steps: The cylinder moves up or down a distance h, and the initial position period of image acquisition is recorded as T0. If the cylinder moves up after the T0 period, the collected image moves downward relative to the initial position, that is, it moves in the positive direction along the y-axis of the image coordinate system, and is recorded as T i , (i>0); or The cylinder moves downward, and the collected image moves upward relative to the initial position, moving along the negative direction of the y-axis of the image coordinate system, denoted by T i , (i<0), where i is the number of up and down movements, the cylinder moves from the starting position to one direction. If i=i max After that, the cylinder returns to i=0 and moves in the other direction until i=i min ; The cylinder moves up and down a distance h and completes a cycle T i The reconstruction is repeated until the total distance moved is equal to the total length pixel value H of the cylinder. The number of moves is recorded as k, where k = i max -i min .
6. The method for reconstructing a cylinder based on patch contour information according to claim 4, characterized in that: The steps of reconstructing the coordinate matrix are as follows: According to the coordinate matrix P reconstructed in each cycle i Reconstruct the rotating body in the vertical direction; The reconstructed coordinate matrix: P′ i =iB m×n +P i ; in, l is the height pixel value of the collected image. If the cylinder moves upward after the T0 cycle ends, i>0; if the rotating body moves downward after the T0 cycle ends, i<0.
7. A barrel reconstruction system based on patch contour information, the system comprising a storage unit and a processing unit, wherein the storage unit stores a computer program that can be run on the processing unit, characterized in that: When the processing unit executes the computer program, the method for reconstructing a cylinder based on patch contour information as described in any one of claims 1 to 6 is implemented.
