Point cloud data splicing method, point cloud data splicing device, medium and electronic equipment
By setting a preset landmark object on the surface of the target object and performing image processing, the three-dimensional coordinate points of the binocular system are determined, which solves the accuracy problem of the point cloud data splicing method when there are few measurement features, and improves the accuracy of point cloud splicing. .
Patent Information
- Application Number
- CN202410968767.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-19
AI Technical Summary
Existing point cloud data splicing methods have poor accuracy when there are few measured features on the object surface. In particular, feature-based splicing methods and landmark point-based splicing methods have problems with mismatching.
By setting a circular preset landmark object on the surface of the target object, using the left and right images of the binocular system for binarization processing and connected domain detection, the landmark points are determined, and the three-dimensional coordinate points are calculated to determine the distance between the binocular systems. transformation relationship, thereby improving the accuracy of point cloud data splicing.
It effectively reduces the error in the position coordinates of landmark points, improves the accuracy of landmark positioning, and ensures the accuracy of the conversion relationship between different binocular systems, thereby improving the accuracy of point cloud splicing.
Smart Images

Figure CN118505500B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of point cloud data processing, and in particular to a point cloud data splicing method, a point cloud data splicing device, a medium and an electronic device. Background Art
[0002] Depending on whether artificial landmarks or external intervention is used, point cloud stitching algorithms can be roughly divided into two categories: feature-based point cloud stitching and landmark-based point cloud stitching.
[0003] Feature-based point cloud stitching does not require pasting artificial markers on the surface of the object. This method uses the scale-invariant feature transform (SIFT) operator or other methods to complete the matching of feature points of two viewpoint images, and uses camera parameters and pixel coordinates of image features to complete the solution of part of the three-dimensional point cloud. However, when measuring samples with few features on the surface of the object, the feature-based stitching method cannot find enough feature points in the image to complete the stitching, and the accuracy is poor.
[0004] When matching the three-dimensional points of the marker points, according to the invariance of the spatial features of the marker points, the Euclidean distance of each pair of marker points in the three-dimensional space is searched globally, that is, the distance between any two points in the point cloud is calculated to form a distance matrix, and the marker points are matched by comparison and judgment. If the difference between the two distance values does not exceed δ (the value of δ is defined according to the accuracy of the camera shooting system itself), the two marker points are regarded as a pair of matching points under different perspectives. In the point cloud stitching method based on artificial marker points, the splicing based on the distance matrix realizes the recognition and stitching of automated marker points to a certain extent. Since it does not use the surrounding information, if there is a coincidence of equal distance, wrong matching will occur, and the accuracy is poor. Summary of the invention
[0005] The present application provides a point cloud data stitching method, device, medium and electronic device, which can more accurately determine the conversion relationship between images of different binocular systems, thereby improving the accuracy of point cloud data stitching.
[0006] In a first aspect, the present application provides a point cloud data stitching method, comprising:
[0007] Acquire binocular images of a target object captured by a plurality of binocular systems, wherein a circular preset mark object is set on the target object, and the binocular image includes a left image and a right image;
[0008] Binarization and debinarization are performed on the binocular image, and connected domain detection is performed on the processed image to obtain a plurality of circular connected domains and annular connected domains;
[0009] Determine the mark point where the preset mark object is located based on the circular connected domain and the annular connected domain;
[0010] Calculate the three-dimensional coordinate points of the preset marking object in the binocular system by using the marking points in the left image and the marking points in the right image of the binocular system;
[0011] The conversion relationship between the binocular systems is determined according to the three-dimensional coordinate points of the binocular systems, and the point cloud data of the respective binocular systems are spliced based on the conversion relationship.
[0012] According to the point cloud data stitching method provided by this embodiment, when there are fewer measurement features on the surface of the target object to be photographed, a circular preset marker object is set on the surface of the target object, and the marker point of the preset marker object in the image is located by detecting the connected domain that matches the shape of the preset marker object. At the same time, the binary image and the de-binarized image are detected together, which can reduce the error of the marker point position coordinates and improve the accuracy of marker point positioning, thereby determining the conversion relationship between different binocular systems and improving the accuracy of point cloud stitching.
[0013] In an exemplary embodiment, determining the marker point where the preset marker object is located based on the circular connected domain and the annular connected domain includes:
[0014] Determine the first center coordinates of the circular connected domain and the second center coordinates of the annular connected domain;
[0015] Calculate a first distance between the first circle center coordinate and each of the second circle center coordinates, and determine that the first circle center coordinate and the second circle center coordinate whose first distance is less than a first threshold correspond to each other;
[0016] Extracting corresponding candidate circular connected domains and candidate circular connected domains from the circular connected domains and the circular ring connected domains;
[0017] The marker point where the preset marker object is located is determined based on the center coordinates of the candidate circular connected region.
[0018] In an exemplary embodiment, the determining the marker point where the preset marker object is located based on the center coordinates of the candidate circular connected region includes:
[0019] Performing contour detection on the circular connected domain and the annular connected domain respectively to obtain a plurality of first circular contours and a first annular contour;
[0020] Obtaining the center coordinates of the first circular contour and the center coordinates of the first annular contour;
[0021] Calculating the second distances between the center coordinates of the first circular contour, the center coordinates of the first circular ring contour and the center coordinates of the candidate circular connected region, respectively, to obtain a second circular contour and a second circular ring contour whose second distance is less than a second threshold;
[0022] Calculating a third distance between the center coordinates of the second circular contour and the center coordinates of the second annular contour, and obtaining a target circular contour and a target annular contour whose third distance is less than a third threshold;
[0023] The coordinates of the center of the target circular contour are obtained to obtain the mark point where the preset mark object is located.
[0024] In an exemplary embodiment, the calculating the third distance between the center coordinates of the second circular contour and the center coordinates of the second annular contour includes:
[0025] Calculating the circularity of the second circular contour to obtain a third circular contour whose circularity is greater than a preset value, and calculating the circularity of the second circular ring contour to obtain a third circular ring contour whose circularity is greater than the preset value;
[0026] Determine whether the second circular contour and the second annular contour whose circularity is not greater than the preset value meet the ellipse condition, and obtain a third circular contour in the second circular contour that meets the ellipse condition and a third annular contour in the second annular contour that meets the ellipse condition;
[0027] A third distance between the center coordinates of the third circular contour and the center coordinates of the third annular contour is calculated.
[0028] In an exemplary embodiment, the acquiring the coordinates of the center of the first circular contour and the coordinates of the center of the first annular contour includes:
[0029] Performing ellipse fitting on the first circular contour to obtain the coordinates of the center of the fitted ellipse;
[0030] Perform ellipse fitting on the first circular ring contour to obtain the coordinates of the center of the fitted ellipse.
[0031] In an exemplary embodiment, the calculating the three-dimensional coordinate points of the preset marker object in the binocular system by using the marker points in the left image and the marker points in the right image of the binocular system includes:
[0032] Determine the pixel correspondence between the left image and the right image by digital image correlation method;
[0033] Determine, based on the pixel correspondence, a marker point of the right image corresponding to the marker point of the left image;
[0034] The three-dimensional coordinate points of the binocular system are determined according to the marker points of the left image and the corresponding marker points of the right image.
[0035] In an exemplary embodiment, determining the conversion relationship between the binocular systems according to the three-dimensional coordinate points of the binocular systems includes:
[0036] Determining the energy between the three-dimensional coordinate points according to the distances between the three-dimensional coordinate points of the different binocular systems;
[0037] Screening out matching points that match each other according to the energy between the three-dimensional coordinate points;
[0038] The rotation vector and the translation vector between the mutually matching matching points are calculated to obtain the conversion relationship between the binocular systems.
[0039] In a second aspect, the present application provides a point cloud data stitching device, comprising:
[0040] An image acquisition module, used to acquire binocular images of a target object photographed by multiple binocular systems, wherein a circular preset mark object is set on the target object, and the binocular image includes a left image and a right image;
[0041] A connectivity detection module is used to perform binarization and debinarization processing on the binocular image, and perform connected domain detection on the processed image to obtain multiple circular connected domains and annular connected domains;
[0042] A landmark point screening module, used for determining the landmark point where the preset landmark object is located based on the circular connected domain and the annular connected domain;
[0043] A three-dimensional coordinate determination module, used to calculate the three-dimensional coordinate points of a preset marker object in the binocular system by using the marker points in the left image of the binocular system and the marker points in the right image;
[0044] A conversion relationship determination module is used to determine the conversion relationship between the binocular systems according to the three-dimensional coordinate points of the binocular systems, and to splice the point cloud data of the respective binocular systems based on the conversion relationship.
[0045] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and one or more processors. The memory stores one or more computer programs, the computer programs comprising instructions, and when the instructions are executed by the processor, the electronic device can execute the point cloud data stitching method as in the first aspect.
[0046] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on an electronic device, the electronic device executes the point cloud data stitching method in the first aspect.
[0047] In a fifth aspect, the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the point cloud data stitching method as described in the first aspect.
[0048] It can be understood that the beneficial effects that can be achieved by the point cloud data stitching device, electronic device, computer-readable storage medium, and computer program product provided above can refer to the beneficial effects in the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of a process for stitching point cloud data provided in an embodiment of the present application;
[0050] Figure 2 A schematic diagram of an image in the point cloud data stitching method provided in an embodiment of the present application;
[0051] Figure 3 Another schematic diagram of an image in the point cloud data stitching method provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. It can be understood by those skilled in the art that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference. It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.
[0054] It should be noted that the “at…” in the embodiments of the present application may be the instant when a certain situation occurs, or may be a period of time after the occurrence of a certain situation, and the embodiments of the present application do not specifically limit this.
[0055] The implementation of this embodiment will be described in detail below with reference to the accompanying drawings.
[0056] This embodiment first provides a point cloud data stitching method. By way of example, the method can be applied to various electronic devices such as computers (PCs), tablet computers, virtual reality / augmented reality devices, wearable devices, industrial computers, and vehicle computers; it can also be applied to servers, cloud computing, server clusters, etc., and this embodiment does not make any special limitations on this.
[0057] Figure 1 A schematic flow chart of a point cloud data stitching method provided in an embodiment of the present application is shown.
[0058] like Figure 1 As shown, the point cloud data stitching method may include the following steps:
[0059] Step 101: Acquire binocular images of a target object captured by multiple binocular systems, wherein a circular preset mark object is set on the target object, and the binocular image includes a left image and a right image.
[0060] Each binocular system can correspond to a viewing angle. By using multiple binocular systems to shoot the target object from different viewing angles, the point cloud data of the target object can be obtained. The point cloud data of each viewing angle can be stitched together to obtain a virtual scene of the target object. The image captured by the binocular system is a binocular image, which includes two images, respectively called the left image and the right image. Taking two different binocular systems as an example, each binocular system shoots the target object once, and two images can be obtained, which are marked as the left image and the right image. Figure 2 As shown, Figure 2 Image L1 is the left image captured by binocular system 1, and image R1 is the right image captured by binocular system 1. Similarly, for binocular system 2, the binocular images captured include image L2 and image R2.
[0061] Exemplarily, for each binocular system, camera monocular calibration and binocular stereo calibration can be performed to obtain binocular camera parameters of the binocular system, and then binocular stereo correction is performed on the binocular image to obtain a corrected left image and a right image.
[0062] Step 102: binarization and debinarization are performed on the binocular image, and connected domain detection is performed on the processed image to obtain a plurality of circular connected domains and annular connected domains.
[0063] The left image and the right image of each binocular system are binarized and debinarized using the maximum inter-class variance to obtain the binarized image and the debinarized image. Figure 3 As shown, taking the left image L1 in the binocular system as an example, binarization of the left image L1 can obtain a binarized image L11, and debinarization of the left image L1 can obtain a debinarized image L12.
[0064] By performing a connected domain check on the binarized image, the connected domain in the image can be detected. The binarized image and the debinarized image include circular connected domains and annular connected domains.
[0065] Step 103: Determine a mark point where the preset mark object is located based on the circular connected domain and the annular connected domain.
[0066] It is understandable that a preset mark object usually corresponds to a circular connected domain and a donut-shaped connected domain. By solving the centroid of each connected domain, the center coordinates of the circular connected domain and the center coordinates of the donut-shaped connected domain can be obtained. The distance between the center coordinates of the circular connected domain and the donut-shaped connected domain corresponding to the same preset mark object is small, and then the mark point where the preset mark object is located is determined based on the center coordinates of the circular connected domain and the donut-shaped connected domain corresponding to the same preset mark object. Exemplarily, determining the mark point where the preset mark object is located based on the circular connected domain and the donut-shaped connected domain includes the following:
[0067] Determine the first center coordinate of the circular connected domain and the second center coordinate of the circular ring connected domain; calculate the first distance between the first center coordinate and each of the second center coordinates, and determine that the first center coordinate and the second center coordinate whose first distance is less than a first threshold correspond to each other; extract corresponding candidate circular connected domains and candidate circular ring connected domains from the circular connected domain and the circular ring connected domain; determine the mark point where the preset mark object is located based on the center coordinates of the candidate circular connected domain.
[0068] For example, solve the center of mass of each connected domain to obtain the center of mass coordinates of the circle (i.e., the first center of mass coordinates) and the center of mass coordinates of the ring (i.e., the second center of mass coordinates). The center of mass coordinates of the circle are marked as set C1, and the center of mass coordinates of the ring are set R1. Take any point a in set C1, and calculate the Euclidean distance between the point and point b in set R1, i.e., the first distance. When the first distance is less than the first threshold, it is determined that the circular connected domain corresponding to point a and the circular ring connected domain corresponding to point b correspond to each other. The circular connected domain and the circular ring connected domain with this corresponding relationship are respectively called candidate circular connected domains and candidate circular ring connected domains. After screening the connected domains, a more accurate candidate circular connected domain corresponding to the preset marking object can be determined, and then the marking point is determined based on the candidate circular connected domain. The center coordinates of the candidate circular connected domain can be the position of the marking point.
[0069] In this implementation, the first threshold is set to delete the annular connected domain or circular connected domain without corresponding relationship, and the marker point where the preset marker object is located is determined based on the circular connected domain with corresponding relationship, so as to improve the accuracy of the marker point coordinates.
[0070] Exemplarily, determining the marker point where the preset marker object is located based on the center coordinates of the candidate circular connected domain may include the following: performing contour detection on the circular connected domain and the circular ring connected domain respectively to obtain multiple first circular contours and a first circular ring contour; obtaining the center coordinates of the first circular contour and the center coordinates of the first circular ring contour; calculating the second distance between the center coordinates of the first circular contour and the center coordinates of the first circular ring contour and the center coordinates of the candidate circular connected domain respectively to obtain a second circular contour and a second circular ring contour whose second distance is less than a second threshold; calculating the third distance between the center coordinates of the second circular contour and the center coordinates of the second circular ring contour to obtain a target circular contour and a target circular ring contour whose third distance is less than a third threshold; obtaining the center coordinates of the target circular contour to obtain the marker point where the preset marker object is located.
[0071] The outer contours of the circular connected domain and the circular ring connected domain are detected respectively to obtain the contour coordinate set CC1 (i.e., the first circular contour) of the circular connected domain and the contour coordinate set RC1 (i.e., the first circular ring contour) of the circular ring connected domain. The corresponding center coordinates are calculated based on the coordinate points in the contour coordinate set CC1. Similarly, the corresponding center coordinates can also be calculated based on the coordinate points in the contour coordinate set RC1.
[0072] Exemplarily, obtaining the center coordinates of the first circular contour and the center coordinates of the first circular ring contour includes the following: performing an ellipse fitting on the first circular contour and obtaining the center coordinates of the fitted ellipse; performing an ellipse fitting on the first circular ring contour and obtaining the center coordinates of the fitted ellipse.
[0073] Perform ellipse fitting on the contour coordinate set CC1 and the contour coordinate set RC1 to solve the center coordinates of the ellipse. For the convenience of subsequent expression, the center coordinates of the ellipse after the first circular contour is ellipse fitted are marked as set C3, and the center coordinates of the ellipse after the first circular ring contour is ellipse fitted are marked as set R3.
[0074] Take any point c in set C3 and set R3, and calculate the Euclidean distance between the point c and any point in the center coordinates of the candidate circular connected domain (recorded as set C2), that is, the second distance. When the second distance is less than the second threshold, the first circular contour or the first circular ring contour corresponding to the point c is determined as the second circular contour or the second circular ring contour. Then calculate the third distance between the second circular contour mark and the center coordinates of the second circular ring contour. When the third distance between the second circular contour mark and the center coordinates of the second circular ring contour is less than the third threshold, it is determined that the second circular contour corresponds to the second circular ring contour, and the second circular contour with this corresponding relationship is determined as the target circular contour. The mark point of the preset mark object is determined according to the target circular contour. That is, the center coordinates of the target circular contour are obtained to obtain the mark point.
[0075] This embodiment further includes the following steps: performing contour detection on the circular connected domain and the annular connected domain respectively to obtain a plurality of first circular contours and a first annular contour;
[0076] Obtaining the center coordinates of the first circular contour and the center coordinates of the first annular contour;
[0077] Calculate the center coordinates of the first circular contour, the second distance between the center coordinates of the first circular ring contour and the center coordinates of the candidate circular connected domain, respectively, to obtain a second circular contour and a second circular ring contour whose second distance is less than a second threshold; calculate the circularity of the second circular contour to obtain a third circular contour whose circularity is greater than a preset value, and calculate the circularity of the second circular ring contour to obtain a third circular ring contour whose circularity is greater than the preset value; determine whether the second circular contour and the second circular ring contour whose circularity is not greater than the preset value satisfy an ellipse condition, to obtain a third circular contour in the second circular contour that satisfies the ellipse condition, and a third circular ring contour in the second circular ring contour that satisfies the ellipse condition; calculate the center coordinates of the third circular contour and the third distance between the center coordinates of the third circular ring contour; obtain a target circular contour and a target circular ring contour whose third distance is less than a third threshold; obtain the center coordinates of the target circular contour to obtain a mark point where a preset mark object is located.
[0078] Exemplarily, the second circular contour is recorded as set CC2, and the second annular contour is recorded as set RC2. A second circular contour CC20 is randomly selected from the set CC2, the area S of the contour CC20 and the perimeter L of the contour CC20 are calculated, and the circularity value C is calculated using the circularity formula, which is as follows:
[0079] (1)
[0080] If the circularity value C is greater than the preset value, the contour CC20 is determined to be a circle, and the contour CC20 is used as the third circular contour. The preset value is set according to the actual situation. For example, if C>0.82, the contour is considered to be a circle. Similarly, a second circular ring contour RC20 is randomly selected from the set RC2, and the area S and the circumference L of the contour RC20 are calculated. The circularity value C is also calculated using the above formula (1); if the circularity value C>0.82, the contour RC20 is considered to be a circle, and the contour RC20 is determined to be the third circular ring contour.
[0081] For the contours in the set CC2 and the set RC2 that are not circles, perform ellipse detection again to determine whether the contours meet the ellipse condition. Assuming that there is a second circular contour CC22 in the set CC2 that is not a circle, obtain any point A in the contour CC22, and find the pixel point farthest from A in the contour CC22 as point B, recorded as:<A,B> ; If |AB|>m / 2π is satisfied, then the contour CC22 is considered to be an ellipse. Where m is the number of points in the contour CC22. For the determined points A and B, traverse all points other than A and B in the contour CC22 as points C and calculate the length of the minor semi-axis of the ellipse (j=1, 2,...,m-2), the formula is as follows:
[0082] (2)
[0083] in,( , ) is the coordinate of the center point of the ellipse, ( , ) is the coordinate of point A, ( , ) is the coordinate of point B, and points A and B are the two fixed points of the major axis of the ellipse. h is the distance from point C to the center of the ellipse, a is the major semi-axis value of the ellipse, b is the minor semi-axis value of the ellipse, and f is the distance from point C to point B.
[0084] From formula (2), we can see that if the contour CC22 is an ellipse boundary point set, ideally, there exists = In actual images, this does not satisfy Therefore, Sort in ascending order and select the middle part of the data (such as 50%), recorded as .calculate The mean ,make . Set the threshold T and coefficient k, and find the contour CC22 that satisfies The number of points is recorded as M. If , the contour CC22 is considered to be the edge data of an ellipse, which satisfies the ellipse condition, and the contour CC22 is determined as the third circular contour. Similarly, the above process is performed on each second circular contour in the set RC2 that is not a circle to determine whether it is an ellipse. If it is an ellipse, it is determined as the third circular contour.
[0085] By fitting the third circular contour and the third circular ring contour into an ellipse, the respective center coordinates are obtained. The center coordinates of the ellipse corresponding to the third circular contour are marked as set C4, and the center coordinates of the ellipse fitted by the third circular ring contour are marked as set R4. Take any point a1 in set C4, and find the third distance between the point a1 and the point in set R4, such as point b1. If the third distance is less than the third threshold, it is determined that the circle corresponding to the point a1 and the circular ring corresponding to the point b1 correspond to each other. The third circular contour with a corresponding relationship is determined as the target circular contour, and the third circular ring contour corresponding to the target circular contour is recorded as the target circular ring contour. The target circular contour and the target circular ring contour finally obtained can identify a mark point of a preset mark object, and the center coordinates of the target circular contour are used as the mark point, or the center coordinates of the target circular ring contour can also be used as the mark point.
[0086] By performing the above processing on the left image in the binocular system, the marker points in the left image can be obtained. Similarly, the same processing is performed on the right image to obtain the marker points in the right image.
[0087] Step 104: Calculate the three-dimensional coordinate points of the preset marking object in the binocular system by using the marking points in the left image and the marking points in the right image of the binocular system.
[0088] Due to reasons such as lighting and angle, the number and position of the marker points identified by the left and right cameras of the same binocular system may be different after shooting, and they need to be matched. The left image can include multiple marker points, and the right image also includes multiple marker points. First, determine the correspondence between the marker points in the left image and the marker points in the right image. When all the marker points are retrieved, the number of left and right marker points is the same. After arranging the left and right marker points in order, the correspondence between the left and right marker points can be obtained, and then three-dimensional reconstruction can be performed to obtain the three-dimensional coordinates of the marker points.
[0089] There are also some cases where the number of marker points in the left image does not match the number of marker points in the right image, so a more accurate method is needed to determine the correspondence between the marker points in the left image and the marker points in the right image. Specifically, the following is done: determine the pixel correspondence between the left image and the right image by digital image correlation method; determine the marker points of the right image corresponding to the marker points of the left image based on the pixel correspondence; determine the three-dimensional coordinate points of the binocular system based on the marker points of the left image and the corresponding marker points of the right image.
[0090] For example, the center of the circle detected by all images of the left camera in the binocular system 1 (i.e., the landmark point) is recorded as CR1L, the center of the circle detected by all images of the right camera in the binocular system 1 is recorded as CR1R, the center of the circle detected by all images of the left camera in the binocular system 2 is recorded as CR2L, and the center of the circle detected by all images of the right camera in the binocular system 2 is recorded as CR2R.
[0091] In this embodiment, the parallax calculated by the Digital Image Correlation (DIC) method is used to perform secondary correspondence on the initially detected fiducial points. The DIC calculates the u-v parallax for the selected region of interest (ROI). The u-v parallax represents the relative pixel difference of different images with respect to the first left image. Using this value, the pixel correspondence relationship between the left and right images of the same binocular image (phase) can be calculated. Specifically, for each phase of each binocular system, the following is performed (for example, in the first phase, four fiducial points are recognized in the left image, five fiducial points are recognized in the right image, and three fiducial points are commonly recognized in the left and right images): For each fiducial point coordinate recognized in the left image of each phase, the specific coordinate corresponding to this coordinate in the left image of the initial phase needs to be found. Since downsampling (taking one pixel point every preset scale scale (scale = 5)) is used to accelerate the calculation during DIC calculation, when calculating the corresponding ROI coordinates, the distance threshold dis needs to be slightly larger (taking the downsampled value as the threshold). If it is located at the image and calculated according to the following formula (3), if dis < scale, then is considered the corresponding point of this coordinate point. The formula is as follows:
[0092]
[0093] (3)
[0094] where represents the fiducial point coordinate of the left image of the phase being processed, represents the pixel row number and column number after downsampling in the DIC calculation, represents the parallax in the x direction and the parallax in the y direction calculated at (the parallax values of and in the left image of the first phase are 0), and scale represents the value taken during downsampling.
[0095] If the corresponding can be obtained, calculate the interpolation disr between its corresponding pixel coordinate in the right image and the actually recognized fiducial point coordinate according to the following formula.
[0096] (4)
[0097] where, is the fiducial point in the right image, represents the parallax in the x direction and the parallax in the y direction of the corresponding right image calculated at , is based on For the corresponding pixel points of the right image for parallax calculation, if disr < scale, it is considered that and are a set of corresponding landmark point coordinates of the same phase. Cycle through each coordinate point of each phase in sequence to complete the matching of the left and right landmark points.
[0098] By cycling through each phase in sequence, the coordinates of the left and right corresponding landmark points of all phases can be found. Based on the two corresponding landmark points on the left and right in the binocular system, the corresponding three-dimensional coordinate points can be calculated.
[0099] Step 105: Determine the conversion relationship between the binocular systems based on the three-dimensional coordinate points of the binocular system, and splice the point cloud data of each binocular system based on the conversion relationship.
[0100] First, determine the correspondence of the three-dimensional coordinate points in different binocular systems, and then use the corresponding three-dimensional coordinate points to determine the conversion relationship. This embodiment further includes: determining the energy between the three-dimensional coordinate points according to the distance between the three-dimensional coordinate points of different binocular systems; screening out the matching points that match each other according to the energy between the three-dimensional coordinate points; calculating the rotation vector and translation vector between the mutually matching points to obtain the conversion relationship between the binocular systems.
[0101] For example, the three-dimensional coordinate points of binocular system 1 are stored as set P, and the three-dimensional coordinate points of binocular system 2 are stored as set Q. First, determine the point in set Q corresponding to any point in set P. Take any point in set P as , and find the correct matching point for in set Q , specifically as follows:
[0102] Step (1): Let M( ) represent the set of points in the r-neighborhood of ; r is the length of the diagonal of the binocular camera's field of view. Calculate the distances from each point in M( ) to . The distances from each point to are denoted as set , and the number of its elements is ; Take any point in Q as , let M( ) represent the set of points in the r-neighborhood of , calculate the distances from each point in M( ) to . The distances from each point to are denoted as set d( ), and the number of its elements is ; Calculate with respect to The specific calculation method of energy E is:
[0103]
[0104] (5)
[0105] Indicate point and The Euclidean distance between Indicate point and The Euclidean distance between them. k is 1 to , m is 1 to .
[0106] According to the above process, the relationship between each point in the set Q and The energy of If the point with the largest energy is not unique, then replace ; If Q is about The point with the largest energy is unique, so this point is matching points .point With point For matching points that match each other, follow this step to get each point Matched points .
[0107] Step (2): Among the matching points determined in the above steps, As a vertex, arbitrarily select M( ) in two neighboring points , , the triangle formed is denoted as △p; As a vertex, arbitrarily select M( ) in two neighboring points , The triangle formed is denoted as △q. If d( , ) and d( , ) does not exceed the threshold t5, d( , ) and d( , ) does not exceed the threshold t5, d( , ) and d( , ) does not exceed the threshold value t5, then △p and △q are considered to be congruent, that is, and To correctly match the points, and To correctly match the points, and is the correct matching point; otherwise, replace , , , , and so on until all correct matching points are found.
[0108] If the number of correct matching points is less than a preset number, such as 3, then return to step (1); otherwise, all matching points have been found.
[0109] The rotation and translation vectors R and T from set P to set Q are calculated using each pair of correct matching points to obtain the transformation relationship between binocular system 1 and binocular system 2. The point cloud data measured by viewing angle P is then unified to the coordinate system of viewing angle Q to obtain the spliced point cloud data.
[0110] Furthermore, the present embodiment also provides a point cloud data stitching device, which can be used to execute the above-mentioned point cloud data stitching method. The point cloud data stitching device may include: an image acquisition module, which is used to acquire binocular images of target objects captured by multiple binocular systems, wherein a circular preset mark object is set on the target object, and the binocular image includes a left image and a right image; a connectivity detection module, which is used to perform binarization and debinarization on the binocular image, and perform connectivity domain detection on the processed image to obtain multiple circular connected domains and circular ring connected domains; a marker point screening module, which is used to determine the marker point where the preset marker object is located based on the circular connected domain and the circular ring connected domain; a three-dimensional coordinate determination module, which is used to calculate the three-dimensional coordinate points of the preset marker object in the binocular system using the marker points in the left image of the binocular system and the marker points in the right image; a conversion relationship determination module, which is used to determine the conversion relationship between the binocular systems according to the three-dimensional coordinate points of the binocular systems, and stitch the point cloud data of each binocular system based on the conversion relationship.
[0111] In an exemplary embodiment, the landmark point screening module includes a connectivity screening module, which is used to: determine the first center coordinate of the circular connected domain and the second center coordinate of the circular ring connected domain; calculate the first distance between the first center coordinate and each of the second center coordinates, and determine that the first center coordinate and the second center coordinate whose first distance is less than a first threshold correspond to each other; extract corresponding candidate circular connected domains and candidate circular ring connected domains from the circular connected domain and the circular ring connected domain; and determine the landmark point where the preset landmark object is located based on the center coordinates of the candidate circular connected domain.
[0112] In an exemplary embodiment, the marker point screening module also includes: a contour screening module, which is used to: perform contour detection on the circular connected domain and the circular ring connected domain respectively to obtain multiple first circular contours and a first circular ring contour; obtain the center coordinates of the first circular contour and the center coordinates of the first circular ring contour; calculate the second distance between the center coordinates of the first circular contour, the center coordinates of the first circular ring contour and the center coordinates of the candidate circular connected domain respectively, to obtain a second circular contour and a second circular ring contour whose second distance is less than a second threshold; calculate the third distance between the center coordinates of the second circular contour and the center coordinates of the second circular ring contour, to obtain a target circular contour and a target circular ring contour whose third distance is less than a third threshold; obtain the center coordinates of the target circular contour to obtain the marker point where the preset marker object is located.
[0113] In an exemplary embodiment, the contour screening module is also used to: calculate the circularity of the second circular contour to obtain a third circular contour whose circularity is greater than a preset value, and calculate the circularity of the second circular ring contour to obtain a third circular ring contour whose circularity is greater than the preset value; determine whether the second circular contour whose circularity is not greater than the preset value and the second circular ring contour satisfy an ellipse condition, and obtain a third circular contour in the second circular contour that satisfies the ellipse condition and a third circular ring contour in the second circular ring contour that satisfies the ellipse condition; calculate the center coordinates of the third circular contour and the third distance between the center coordinates of the third circular ring contour.
[0114] In an exemplary embodiment, the contour screening module specifically includes an ellipse fitting module, which is used to: perform ellipse fitting on the first circular contour to obtain the center coordinates of the fitted ellipse; perform ellipse fitting on the first circular ring contour to obtain the center coordinates of the fitted ellipse.
[0115] In an exemplary embodiment, the three-dimensional coordinate determination module is specifically used to: determine the pixel correspondence between the left image and the right image by a digital image correlation method; determine the marker points of the right image corresponding to the marker points of the left image based on the pixel correspondence; and determine the three-dimensional coordinate points of the binocular system according to the marker points of the left image and the corresponding marker points of the right image.
[0116] In an exemplary embodiment, the conversion relationship determination module is specifically used to: determine the energy between the three-dimensional coordinate points according to the distances between the three-dimensional coordinate points of the binocular system;
[0117] According to the energy between the three-dimensional coordinate points, matching points that match each other are screened out; and the rotation vector and the translation vector between the matching points that match each other are calculated to obtain the conversion relationship between the binocular systems.
[0118] The specific details of each module or unit in the above-mentioned point cloud data stitching device have been described in detail in the corresponding point cloud data stitching method, so they will not be repeated here.
[0119] The embodiment of the present application also provides an electronic device, Figure 4 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. Figure 4 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0120] like Figure 4 As shown, the electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0121] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0122] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 609, and / or installed from a removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the embodiments of the present application are executed.
[0123] For example, when the computer program is executed by the central processing unit (CPU) 601, the following can be performed: obtaining binocular images of a target object captured by multiple binocular systems, wherein a circular preset mark object is set on the target object, and the binocular image includes a left image and a right image; binarizing the binocular image, performing connected domain detection on the binarized image to obtain multiple circular connected domains and circular ring-shaped connected domains, and debinarizing the binocular image, performing connected domain detection on the debinarized image to obtain multiple circular connected domains and circular ring-shaped connected domains; determining a mark point where the preset mark object is located based on the circular connected domain and the circular ring-shaped connected domain; calculating the three-dimensional coordinate points of the preset mark object in the binocular system by using the mark points in the left image of the binocular system and the mark points in the right image; determining a conversion relationship between the binocular systems according to the three-dimensional coordinate points of the binocular systems, and splicing the point cloud data of each binocular system based on the conversion relationship.
[0124] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0125] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0127] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and the one or more programs include instructions, and when the instructions are executed by the electronic device, the electronic device implements the method described in the above embodiment.
[0128] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0129] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A point cloud data splicing method, characterized in that: include: Acquire binocular images of a target object captured by a plurality of binocular systems, wherein a circular preset mark object is set on the target object, and the binocular image includes a left image and a right image; Binarization and debinarization are performed on the binocular image, and connected domain detection is performed on the processed image to obtain a plurality of circular connected domains and annular connected domains; Determine the mark point where the preset mark object is located based on the circular connected domain and the annular connected domain; Calculating the three-dimensional coordinate points of the preset marker object in the binocular system by using the marker points in the left image and the marker points in the right image of the binocular system, including: determining the pixel correspondence between the left image and the right image by digital image correlation method; determining the marker points of the right image corresponding to the marker points of the left image based on the pixel correspondence; determining the three-dimensional coordinate points of the binocular system according to the marker points of the left image and the corresponding marker points of the right image; The conversion relationship between the binocular systems is determined according to the three-dimensional coordinate points of the binocular systems, and the point cloud data of the respective binocular systems are spliced based on the conversion relationship.
2. The point cloud data splicing method according to claim 1, characterized in that: The determining the mark point where the preset mark object is located based on the circular connected domain and the annular connected domain includes: Determine the first center coordinates of the circular connected domain and the second center coordinates of the annular connected domain; Calculate a first distance between the first circle center coordinate and each of the second circle center coordinates, and determine that the first circle center coordinate and the second circle center coordinate whose first distance is less than a first threshold correspond to each other; Extracting corresponding candidate circular connected domains and candidate circular connected domains from the circular connected domains and the circular ring connected domains; The marker point where the preset marker object is located is determined based on the center coordinates of the candidate circular connected region.
3. The point cloud data splicing method according to claim 2, characterized in that: The step of determining the marker point where the preset marker object is located based on the center coordinates of the candidate circular connected region includes: Performing contour detection on the circular connected domain and the annular connected domain respectively to obtain a plurality of first circular contours and a first annular contour; Obtaining the center coordinates of the first circular contour and the center coordinates of the first annular contour; Calculating the second distances between the center coordinates of the first circular contour, the center coordinates of the first circular ring contour and the center coordinates of the candidate circular connected region, respectively, to obtain a second circular contour and a second circular ring contour whose second distance is less than a second threshold; Calculating a third distance between the center coordinates of the second circular contour and the center coordinates of the second annular contour, and obtaining a target circular contour and a target annular contour whose third distance is less than a third threshold; The coordinates of the center of the target circular contour are obtained to obtain the mark point where the preset mark object is located.
4. The point cloud data splicing method according to claim 3, characterized in that: The calculating a third distance between the center coordinates of the second circular contour and the center coordinates of the second annular contour includes: Calculating the circularity of the second circular contour to obtain a third circular contour whose circularity is greater than a preset value, and calculating the circularity of the second circular ring contour to obtain a third circular ring contour whose circularity is greater than the preset value; Determine whether the second circular contour and the second annular contour whose circularity is not greater than the preset value meet the ellipse condition, and obtain a third circular contour in the second circular contour that meets the ellipse condition and a third annular contour in the second annular contour that meets the ellipse condition; A third distance between the center coordinates of the third circular contour and the center coordinates of the third annular contour is calculated.
5. The point cloud data splicing method according to claim 3, characterized in that: The acquiring the center coordinates of the first circular contour and the center coordinates of the first annular contour includes: Performing ellipse fitting on the first circular contour to obtain the coordinates of the center of the fitted ellipse; Perform ellipse fitting on the first circular ring contour to obtain the coordinates of the center of the fitted ellipse.
6. The point cloud data splicing method according to claim 1, characterized in that: Determining the conversion relationship between the binocular systems according to the three-dimensional coordinate points of the binocular systems includes: Determining the energy between the three-dimensional coordinate points according to the distances between the three-dimensional coordinate points of the different binocular systems; Screening out matching points that match each other according to the energy between the three-dimensional coordinate points; The rotation vector and the translation vector between the mutually matching matching points are calculated to obtain the conversion relationship between the binocular systems.
7. A point cloud data splicing device, characterized in that: include: An image acquisition module, used to acquire binocular images of a target object photographed by multiple binocular systems, wherein a circular preset mark object is set on the target object, and the binocular image includes a left image and a right image; A connectivity detection module is used to perform binarization and debinarization processing on the binocular image, and perform connected domain detection on the processed image to obtain multiple circular connected domains and annular connected domains; A landmark point screening module, used for determining the landmark point where the preset landmark object is located based on the circular connected domain and the annular connected domain; A three-dimensional coordinate determination module, used to calculate the three-dimensional coordinate points of the preset marker object in the binocular system by using the marker points in the left image of the binocular system and the marker points in the right image; specifically used to determine the pixel correspondence between the left image and the right image by digital image correlation method; based on the pixel correspondence, determine the marker points of the right image corresponding to the marker points of the left image; determine the three-dimensional coordinate points of the binocular system according to the marker points of the left image and the corresponding marker points of the right image; A conversion relationship determination module is used to determine the conversion relationship between the binocular systems according to the three-dimensional coordinate points of the binocular systems, and to splice the point cloud data of the respective binocular systems based on the conversion relationship.
8. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the point cloud data stitching method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: It includes a processor and a memory, wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device executes the point cloud data stitching method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Novel point cloud splicing method based on coding plane target
CN118212124A
