Corner point ordering method, device, storage medium and program product
By predicting the actual distance between known corner points and their adjacent points, undetected corner points are gradually explored and sorted, solving the problem of incomplete corner point detection under distortion and brightness attenuation, and realizing the calibration of camera intrinsic and extrinsic parameters and lens distortion correction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2022-07-21
- Publication Date
- 2026-05-29
AI Technical Summary
When distortion is large and brightness is attenuated, existing corner detection algorithms cannot guarantee the integrity of corner detection, resulting in corner sorting failure and making it impossible to achieve camera intrinsic and extrinsic parameter calibration and lens distortion correction.
By determining the predicted distance value based on the actual distance between the known sorted corner points and their adjacent corner points, the system gradually explores the surrounding unsorted corner points, filters and sorts the adjacent points, and completes the sorting of the detected valid corner points.
Even with incomplete corner detection, the system achieves the sorting of effective corner points, enabling camera intrinsic and extrinsic parameter calibration and lens distortion correction.
Smart Images

Figure CN117475004B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of camera calibration technology, and more particularly to a corner point sorting method, device, storage medium, and program product. Background Technology
[0002] Distortion correction of camera lenses and calibration of camera intrinsic and extrinsic parameters depend on the correspondence between the image coordinates of corner points in the image coordinate system and their world coordinates in the world coordinate system. The integrity of the spatial range of corner detection is crucial when determining this correspondence.
[0003] However, in cases of significant distortion, especially when accompanied by brightness decay, it is difficult to guarantee the completeness of corner detection. Due to the lack of corners, related corner detection algorithms struggle to sort them. Therefore, how to sort corners when they cannot be completely detected is a pressing technical problem that needs to be solved. Summary of the Invention
[0004] This disclosure provides a corner sorting method, device, storage medium, and program product to sort the detected effective corners when the detection algorithm cannot completely detect all corners. The sorted corners can then be mapped to world coordinates to achieve camera intrinsic and extrinsic parameter calibration and camera lens distortion correction.
[0005] In a first aspect, embodiments of this disclosure provide a corner sorting method, including:
[0006] For each of the multiple unsorted corner points, the actual distance between the unsorted corner point and the current unsorted neighbor point is determined based on the coordinates of the unsorted corner point and the coordinates of the current unsorted neighbor point in the sequence of unsorted neighbor points.
[0007] Based on multiple actual distances and the distance prediction values of the current neighboring point, target neighboring points of the current neighboring point are selected from multiple unsorted corner points; the distance prediction values are determined based on the actual distance between the current neighboring point and the corresponding neighboring point in the sorted corner points; the sorted corner points are corner points with known sorting indices; the current neighboring point is the target neighboring point of the corresponding neighboring point in the sorted corner points;
[0008] The corner point sorting result is determined based on the filtering results and the sorting index of the current adjacent point; the sorting index of the current adjacent point is determined based on the sorting index of the corresponding adjacent point among the sorted corner points.
[0009] Secondly, embodiments of this disclosure provide a corner sorting device, comprising:
[0010] The processing module is used to determine the actual distance between each corner point to be sorted and the current neighbor point in the sequence of neighbor points, based on the coordinates of the corner point to be sorted and the coordinates of the current neighbor point in the sequence of neighbor points.
[0011] A filtering module is used to filter target adjacent points of the current adjacent point from multiple unsorted corner points based on multiple actual distances and the distance prediction value of the current adjacent point, and delete the current adjacent point from the adjacent point sequence; the distance prediction value is determined based on the actual distance between the current adjacent point and the corresponding adjacent point in the sorted corner points; the sorted corner points are corner points with known sorting indices; the current adjacent point is the target adjacent point of the corresponding adjacent point in the sorted corner points;
[0012] The determination module is used to determine the corner point sorting result based on the filtering result and the sorting index of the current adjacent point; the sorting index of the current adjacent point is determined based on the sorting index of the corresponding adjacent point among the sorted corner points.
[0013] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;
[0014] The memory stores computer-executed instructions;
[0015] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the corner sorting method as described in the first aspect and various possible designs of the first aspect.
[0016] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the corner sorting method described in the first aspect and various possible designs of the first aspect.
[0017] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the corner sorting method described in the first aspect and various possible designs of the first aspect.
[0018] The corner sorting method, device, storage medium, and program product provided in this embodiment include: for each of a plurality of corners to be sorted, determining the actual distance between the corner to be sorted and the current neighboring point in the sequence of neighboring points based on the coordinates of the corner to be sorted and the coordinates of the current neighboring point in the sequence of neighboring points; filtering target neighboring points of the current neighboring point from the plurality of corners to be sorted based on the plurality of actual distances and the distance prediction value of the current neighboring point; deleting the current neighboring point from the sequence of neighboring points; the distance prediction value is determined based on the actual distance between the current neighboring point and the corresponding neighboring point in the sorted corners; the sorted corners are corners with known sorting indices; the current neighboring point is the target neighboring point of the corresponding neighboring point in the sorted corners; and determining the corner sorting result based on the filtering result and the sorting index of the current neighboring point, the sorting index of the current neighboring point being determined based on the sorting index of the corresponding neighboring point in the sorted corners. The corner sorting method provided in this embodiment sorts multiple corners that need to be sorted by gradually exploring and searching for adjacent points from the current adjacent point to the surrounding area based on the closeness between the predicted distance value and the actual distance. It determines the sorting index of each of the found adjacent points and completes the sorting of multiple corners. It can sort the detected effective corners even when the detection algorithm cannot detect all corners completely. Then, the sorted corners can be mapped to world coordinates to realize the calibration of camera intrinsic and extrinsic parameters and distortion correction of camera lens. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram illustrating an application scenario of the corner sorting method provided in the embodiments of this disclosure;
[0021] Figure 2 Flowchart of the corner sorting method provided in the embodiments of this disclosure Figure 1 ;
[0022] Figure 3a This is a schematic diagram of complete corner points obtained by corner detection of an image to be detected according to an embodiment of the present disclosure.
[0023] Figure 3b This is a schematic diagram of incomplete corner points obtained by corner detection of an image to be detected according to an embodiment of this disclosure;
[0024] Figure 4 Flowchart of the corner sorting method provided in the embodiments of this disclosure Figure 2 ;
[0025] Figure 5 This is a schematic diagram of incomplete corner points obtained by corner detection of an image to be detected according to an embodiment of this disclosure;
[0026] Figure 6 Flowchart 3 of the corner sorting method provided in this embodiment of the disclosure;
[0027] Figure 7 This is a structural block diagram of the corner sorting device provided in the embodiments of this disclosure;
[0028] Figure 8 This is a schematic diagram of the hardware structure of the corner sorting device provided in an embodiment of this disclosure. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0030] Distortion correction of camera lenses and calibration of camera intrinsics and extrinsic parameters depend on the correspondence between the image coordinates of corner points in the image coordinate system and their world coordinates in the world coordinate system. The spatial integrity of corner detection is crucial in determining this correspondence. However, for cases with significant distortion, especially when accompanied by brightness attenuation, it is difficult to guarantee the integrity of corner detection. Due to the lack of corner points, existing corner detection algorithms struggle to detect and sort them. For example, the corner detection method of OpenCV, a cross-platform computer vision and machine learning software library released under the Apache 2.0 license (open source), heavily relies on the integrity of the checkerboard pattern, which has significant limitations in practical applications.
[0031] To address the aforementioned technical problems, the inventors of this application have discovered that, starting from a known sorted corner point, the predicted distance between the corner point and its unsorted adjacent corner points is determined based on the actual distance between the corner point and its known sorted adjacent corner points. Then, based on this predicted distance, the system gradually explores the surrounding unsorted corner points, finding and sorting the adjacent points of the current corner point among all unsorted corner points. This process is repeated to complete the sorting of all detected corner points, even if corner point detection is incomplete. Based on this, this disclosure provides a corner point sorting method that can sort the detected valid corner points even when the detection algorithm cannot completely detect all corner points. Furthermore, the sorted corner points can be mapped to world coordinates to achieve camera intrinsic and extrinsic parameter calibration and camera lens distortion correction.
[0032] refer to Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of the corner sorting method provided in the embodiments of this disclosure. For example... Figure 1 As shown, camera 102 is connected to terminal 103. Camera 102 is used to take pictures of calibration board 101 to obtain the image to be detected and send the image to be detected to terminal 103. Terminal 103 is used to perform corner detection on the image to be detected and obtain corners to be sorted. Based on the distance prediction value of the current neighboring point, the neighboring point of the current neighboring point is determined from the corners to be sorted. Then, based on the determination result of the neighboring point and the sorting index of the current neighboring point, the sorting result of the corners to be sorted is obtained.
[0033] In the specific implementation process, camera 102 captures an image of calibration board 101 (e.g., a checkerboard pattern) to obtain the image to be detected, and sends the image to terminal 103. Terminal 103 performs corner detection on the image to be detected, obtaining multiple corners to be sorted. Then, it can first select an initial corner from the multiple corners to be sorted, use the initial corner as the current adjacent point, and determine the distance prediction value of the current adjacent point. Based on the distance prediction value of the current adjacent point, it determines the adjacent points of the current adjacent point from the remaining corners to be sorted, determines the distance prediction value of the adjacent points, and determines the sorting index of the adjacent points based on the sorting index of the current adjacent point, adding the adjacent points to the adjacent point sequence. It then determines the current adjacent point from the adjacent point sequence, and continues to search for the adjacent points of the current adjacent point in the same way, determining the distance prediction value of the adjacent points, and determining the sorting index of the adjacent points based on the sorting index of the current adjacent point, adding the adjacent points to the adjacent point sequence, and so on, to complete the sorting of multiple corners to be sorted and obtain the corner sorting result. The corner sorting method provided in this embodiment sorts multiple corners that need to be sorted by gradually exploring and searching for adjacent points from the current adjacent point to the surrounding area based on the closeness between the predicted distance value and the actual distance. It determines the sorting index of each of the found adjacent points and completes the sorting of multiple corners. It can sort the detected effective corners even when the detection algorithm cannot detect all corners completely. Then, the sorted corners can be mapped to world coordinates to realize the calibration of camera intrinsic and extrinsic parameters and distortion correction of camera lens.
[0034] It should be noted that, Figure 1 The schematic diagram shown is merely an example. The corner sorting method and scenario described in this disclosure are intended to more clearly illustrate the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided in this disclosure. As those skilled in the art will know, with the evolution of the system and the emergence of new business scenarios, the technical solutions provided in this disclosure are also applicable to similar technical problems.
[0035] The technical solutions of this disclosure will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0036] refer to Figure 2 , Figure 2 Flowchart of the corner sorting method provided in the embodiments of this disclosure Figure 1 The method described in this embodiment can be applied to terminal devices or servers. This corner sorting method includes:
[0037] 201. For each of the multiple unsorted corner points, determine the actual distance between the unsorted corner point and the current unsorted neighbor point in the unsorted neighbor point sequence based on the coordinates of the unsorted corner point and the coordinates of the current unsorted neighbor point in the unsorted neighbor point sequence.
[0038] In this embodiment, the corner points to be sorted can be the corner points in the original input detection image. The coordinates of the corner points to be sorted, i.e., the image coordinates, are known. The current adjacent point can be a target point that is being processed by the corner point sorting method provided in this embodiment (finding adjacent points for it; adjacent points refer to points that are adjacent in the x or y direction, i.e., the two endpoints of the edges of the cells in the checkerboard pattern, while the two endpoints of the diagonals of the cells in the checkerboard pattern are not adjacent points). The adjacent points of this target point have not yet been fully detected. If all of them are detected, the target point changes from an adjacent point to a completed point. This target point is an adjacent point of the corresponding adjacent point among the sorted corner points. Therefore, if the sorting index of the corresponding adjacent point among the sorted corner points is known, the sorting index of the current adjacent point can be determined. An adjacent point is the point among the corner points around the target point (adjacent corner points in the top, bottom, left, and right directions) whose actual distance is closest to the predicted distance value (e.g., the difference between the actual distance and the corresponding predicted distance value is less than a preset threshold).
[0039] Specifically, during camera calibration, an image can be captured of the calibration object, such as a checkerboard pattern, to obtain the image to be detected. After detecting the image, multiple corner points to be sorted can be obtained. In the specific processing, the actual distance between the current adjacent point and each of the remaining corner points to be sorted can be calculated first.
[0040] For example, Figure 3a This is a schematic diagram of the complete corner points obtained by corner detection of the image to be detected according to an embodiment of this disclosure. Figure 3b This is a schematic diagram illustrating incomplete corner points obtained by corner detection of an image to be detected, provided in an embodiment of this disclosure. For example... Figure 3a As shown, without distortion or brightness effects, all 36 corner points of the checkerboard pattern can be obtained. Figure 3b As shown, under the influence of distortion and brightness attenuation, the corner points obtained by corner point detection of the image to be detected are curved at the edge, and the positions of corner points 16, 17 and 23 (shown by dashed circles) are not identified.
[0041] In one embodiment of this disclosure, the algorithm may initially select an initial corner point and execute the algorithm from the initial corner point. Specifically, before step 201, it may further include obtaining the sorting index and initial distance of the initial corner point; the initial corner point is a corner point among a plurality of corner points to be sorted; the initial distance is determined based on the actual distance between the initial corner point and at least one adjacent point of the initial corner point; based on the initial distance of the initial corner point, target adjacent points of the initial corner point are filtered from the plurality of corner points to be sorted, and the sorting index of the target adjacent points of the initial corner point is determined based on the sorting index of the initial corner point; the target adjacent points of the initial corner point are added to the sequence of adjacent points to be adjacent, and the current adjacent point of the sequence of adjacent points to be adjacent is determined from the target adjacent points of the initial corner point. Optionally, filtering target adjacent points of the initial corner point from multiple unsorted corner points based on the initial distance of the initial corner point can include: for each unsorted corner point, determining the actual distance between the unsorted corner point and the initial corner point based on the coordinates of the unsorted corner point and the coordinates of the initial corner point; filtering target adjacent points of the initial corner point from multiple unsorted corner points based on multiple actual distances and the initial distance of the initial corner point. Optionally, the initial distance can be determined based on the actual distance between the initial corner point and one of its adjacent points, or it can be determined based on the actual distances between the initial corner point and multiple adjacent points respectively. Specifically, the initial distance of the initial corner point can be determined based on the average of the actual distances corresponding to multiple adjacent points.
[0042] In one embodiment of this disclosure, the initial corner point can be selected automatically based on an algorithm or manually; this embodiment does not limit this to either.
[0043] For example, the initial corner point can be a corner point near the center point of the chessboard square, such as... Figure 3b As shown, corner point 21 near the center of the chessboard can be selected as the initial corner point. Taking the position of corner point 1 as the origin, the sort index of corner point 1 is (0,0). Therefore, corner point 21 is located in the 3rd column and 4th row, with x-axis value 3 and y-axis value 4, meaning its sort index is (3,4). The predicted distance to corner point 21 can be obtained through actual measurement. For example, the distance between corner point 21 and corner point 22 can be measured, and the measured value can be used as the predicted distance to corner point 21. For non-initial corner points, the distance can be determined based on the actual distance between the corresponding adjacent point among the sorted corner points and the current adjacent point to be adjacent, i.e., the non-initial corner point.
[0044] Taking corner point 21 as the current adjacent point and the remaining corner points to be sorted not yet sorted as an example, when executing step 201, the actual distance between corner point 21 and the remaining corner points excluding corner points 21, 16, 17 and 23 in corner points 1-36 can be calculated respectively.
[0045] 202. Based on multiple actual distances and the distance prediction values of the current neighboring point, filter the target neighboring points of the current neighboring point from multiple unsorted corner points; the distance prediction values are determined based on the actual distance between the current neighboring point and the corresponding neighboring point in the sorted corner points; the sorted corner points are corner points with known sorting indices; the current neighboring point is the target neighboring point of the corresponding neighboring point in the sorted corner points.
[0046] Specifically, after obtaining the actual distances to multiple corner points to be sorted, target adjacent points whose distance differences with the current adjacent point satisfy preset conditions can be selected from the remaining corner points to be sorted, based on the preset distance value of the current adjacent point. After completing the selection of target adjacent points, all adjacent points of the current adjacent point have been detected. Therefore, the current adjacent point can be marked as a completed point, and then a new corner point can be selected from the adjacent point sequence as the next adjacent point. Here, the completed point and each corner point in the unsorted sequence are sorted corner points with known sorting indices.
[0047] For example, a preset threshold can be set as a preset condition. When the difference between the actual distance between the current adjacent point and the corner point to be sorted and the predicted distance of the current corner point to be sorted is less than or equal to the preset threshold, it is determined that the preset condition is met, that is, the corner point to be sorted is the target adjacent point of the current adjacent point.
[0048] like Figure 3b As shown, continuing with corner point 21 as the current adjacent point, and taking the remaining unsorted corner points as an example, in step 202, for each unsorted corner point, taking corner point 20 as an example, the actual distance corresponding to corner point 20 can be compared with the predicted distance corresponding to corner point 21. When the difference between the two is greater than or equal to a preset threshold, corner point 20 can be determined to be an adjacent point of corner point 21. Similarly, corner points 15, 22, and 27 can also be determined to be adjacent points of corner point 21. Since the actual distance between corner point 14 and corner point 21 is greater than the predicted distance, it can be determined that corner point 14 and corner point 21 are not adjacent points.
[0049] 203. Determine the corner point sorting result based on the filtering results and the sorting index of the current neighboring point; the sorting index of the current neighboring point is determined based on the sorting index of the corresponding neighboring point among the sorted corner points.
[0050] Specifically, after obtaining the target neighboring points of the current neighboring point based on the distance prediction value of the current neighboring point, the search can continue to expand outwards based on the search results to find neighboring points adjacent to the sorted corner points. This process is repeated to determine the sorting index of each corner point to be sorted and complete the sorting of each corner point.
[0051] For example, in some embodiments, a matrix can be constructed first. The dimensions of the matrix are related to the maximum number of corner points on the chessboard. For instance, if the chessboard has 6x6 corner points, a 6x6 matrix can be constructed. After determining the sort index of each corner point, it can be placed in the corresponding position in the matrix based on the sort index. For example, if the sort index is (2, 3) in the 2nd column and 3rd row, the coordinate value of that corner point can be placed in the 2nd column and 3rd row of the matrix. Once the sort indices of all corner points are determined, the matrix can be filled. Of course, if any corner points are missing, the corresponding position in the matrix can be set to a specific value. Constructing a matrix also facilitates limiting the extent to which corner points spread outwards. That is, once the matrix is filled, there is no need to continue exploring and searching in the surrounding area, thus avoiding the inclusion of invalid corner points outside the chessboard.
[0052] As described above, this embodiment, based on the proximity between the predicted and actual distances of each of the multiple unsorted corner points obtained from the detection, gradually explores and searches for adjacent points from the current unsorted point, determines the sorting index of each found adjacent point, and completes the sorting of multiple unsorted corner points. This enables the sorting of the detected valid corner points even when the detection algorithm cannot detect all corner points completely. Furthermore, the sorted corner points can be mapped to world coordinates to achieve camera intrinsic and extrinsic parameter calibration and camera lens distortion correction.
[0053] refer to Figure 4 , Figure 4 Flowchart of the corner sorting method provided in the embodiments of this disclosure Figure 2 This embodiment describes in detail the process of determining the corner sorting result based on the filtering results and the sorting index of the current adjacent points. The corner sorting method includes:
[0054] 401. For each of the multiple unsorted corner points, determine the actual distance between the unsorted corner point and the current unsorted neighbor point in the unsorted neighbor point sequence based on the coordinates of the unsorted corner point and the coordinates of the current unsorted neighbor point in the unsorted neighbor point sequence.
[0055] 402. Based on multiple actual distances and the distance prediction values of the current neighboring point, filter the target neighboring points of the current neighboring point from multiple unsorted corner points; the distance prediction values are determined based on the actual distance between the current neighboring point and the corresponding neighboring point in the sorted corner points; the sorted corner points are corner points with known sorting indices; the current neighboring point is the target neighboring point of the corresponding neighboring point in the sorted corner points.
[0056] Steps 401 to 402 in this embodiment are similar to steps 201 to 202 in the above embodiment, and will not be repeated here.
[0057] 403. Based on the filtering results and the sorting index of the current neighboring nodes, determine the new sequence of neighboring nodes.
[0058] Specifically, after obtaining the filtering results, it can be determined whether the filtering results indicate whether there is a target neighbor of the current neighbor among the multiple corner points to be sorted. Based on the two cases of existence and non-existence, the current sequence of neighbor points to be sorted can be processed to obtain a new sequence of neighbor points to be sorted.
[0059] In one possible implementation, updating the sequence of adjacent points based on the filtering results may include: if there is no target adjacent point of the current adjacent point among the multiple corner points to be sorted, then the sequence of adjacent points is determined as a new sequence of adjacent points.
[0060] Specifically, it is possible that the neighboring points of the current target point have been completely detected, or that the neighboring points of the current target point were not detected during corner detection due to distortion or brightness issues. As a result, there may be a situation where the target neighboring point is not present among multiple corner points to be sorted. In this case, the target neighboring point sequence can be retained, and the current target neighboring point sequence can be directly determined as the new target neighboring sequence without processing it.
[0061] In another possible implementation, a new sequence of adjacent points is determined based on the filtering results and the sorting index of the current adjacent points. This can include: if there is a target adjacent point of the current adjacent point among multiple corner points to be sorted, then the distance prediction value of the target adjacent point is determined, and the sorting index of the target adjacent point is determined based on the sorting index of the current adjacent points, and the target adjacent point is added to the sequence of adjacent points to obtain a new sequence of adjacent points to be obtained.
[0062] Specifically, when there is a target neighbor of the current neighbor among the corner points to be sorted, the target neighbor can be added to the sequence of neighbor points to be sorted, so that the target neighbor can be determined as the current neighbor to be sorted, and the corresponding target neighbor can be found by continuing to explore the surrounding area based on the distance prediction value of the current neighbor to be sorted, until the edge of the chessboard is found (the sequence of neighbor points to be sorted is empty or the corner points to be sorted are empty).
[0063] In one embodiment of this disclosure, determining the sorting index of the target neighbor based on the sorting index of the current neighbor to be adjacent may include: determining the positional relationship between the current neighbor to be adjacent and the target neighbor based on the coordinates of the current neighbor to be adjacent and the coordinates of the target neighbor; and determining the sorting index of the target neighbor based on the positional relationship and the index of the current neighbor to be adjacent.
[0064] Specifically, the positional relationship between the current point to be adjacent and the target point to be adjacent can be determined based on the coordinate difference between the two corner points. For example, if the x-coordinates of the two corner points are similar and the y-coordinates differ significantly, it can be determined that the current point to be adjacent and the target point to be adjacent are in a vertical relationship. As for which corner point is on top, this can be further determined based on the magnitude of its y-coordinate. Figure 5As shown, corner point 9 and corner point 15 are in an up-down relationship. The index of corner point 15 is (3,3). Therefore, the y-index of corner point 9, which is above it, can be reduced by 1, which is (3,2).
[0065] In one embodiment of this disclosure, since the distortion conditions in the x and y directions are different, the distance prediction value may include both the distance prediction value in the x direction and the distance prediction value in the y direction for accurate calculation. Determining the distance prediction value of the target neighbor may include: determining the distance prediction value of the target neighbor in the first direction based on the actual distance between the current neighbor to be adjacent and the target neighbor.
[0066] The first direction can be the direction of the straight line between the current adjacent point and the target adjacent point. For example, such as... Figure 5 As shown, after determining that the adjacent point of corner point 21 is corner point 22, the predicted distance of corner point 22 in the x-direction can be determined based on the actual distance between corner points 21 and 22. In this case, the first direction can be the x-direction. Similarly, after determining that the adjacent point of corner point 14 is corner point 8, the predicted distance of corner point 8 in the y-direction can be determined based on the actual distance between corner points 14 and 8. In this case, the first direction can be the y-direction.
[0067] Optionally, determining the predicted distance value of the target neighbor point may further include: determining whether the target neighbor point has an existing neighbor point in the second direction based on the sorting index of the target neighbor point; and determining the predicted distance value of the target neighbor point in the second direction based on the coordinates of the existing neighbor point and the coordinates of the target neighbor point if the target neighbor point has an existing neighbor point in the second direction. If the target neighbor point does not have an existing neighbor point in the second direction, then the predicted distance value of the target neighbor point in the second direction is determined based on the predicted distance value of the current neighbor point to be adjacent in the second direction.
[0068] Specifically, after determining the predicted distance of the target neighbor in the first direction, the predicted distance in the second direction can be determined based on the actual distance between the target neighbor and its adjacent points in the second direction. If no such distance exists, the predicted distance in the second direction can be determined by referring to the actual distance between the target neighbor's adjacent points in the first direction and its adjacent corner points in the second direction.
[0069] For example, such as Figure 5As shown, after determining the predicted distance of corner point 8 in the y-direction based on the actual distance between corner point 14 and corner point 8, we can search among the sorted corner points to see if there is an adjacent point of corner point 8 in the x-direction. Specifically, we can search based on the sorting index value. Corner point 8 has a sorting index of (2, 2). We can check if there is a corner point with a sorting index of (1, 2) or (3, 2) among the sorted corner points (completed points and unadjacent points). If it exists, for example, if corner point 9 is sorted, we can determine the predicted distance of corner point 8 in the x-direction based on the actual distance between corner point 9 and corner point 8. If it does not exist, we can refer to the predicted distance of corner point 14 in the x-direction; that is, the actual distance between corner point 14 and its adjacent corner point 15 in the x-direction can be determined as the predicted distance of corner point 8 in the x-direction.
[0070] This embodiment takes into account the different distortions in different directions, the possibility of missing corner points, or the fact that adjacent points in a certain direction have not yet been sorted. It adopts a method of borrowing the predicted distance values of adjacent corner points in the same direction in parallel. This avoids the problem of reduced calculation accuracy due to different distortions in different directions.
[0071] 404. Process the new sequence of adjacent points to obtain the corner sorting result.
[0072] Specifically, it can be determined whether there are remaining corner points in the new sequence of unadjacent points, and whether there are remaining corner points in multiple unsorted corner points. If there are remaining corner points in multiple unsorted corner points, and there are remaining corner points in the new sequence of unadjacent points, then the current unadjacent point is selected from the new sequence of unadjacent points, and steps 401 to 403 are returned to be executed.
[0073] If there are no remaining corner points among the multiple unsorted corner points or no remaining corner points in the new sequence of unadjacent corner points, the corner point sorting result is determined based on the sorting index of the multiple unadjacent corner points deleted from the sequence of unadjacent corner points.
[0074] As described above, by analyzing the proximity between the predicted and actual distances of each of the multiple unsorted corner points obtained from the detection algorithm, the algorithm gradually explores and searches for adjacent points from the current unsorted point, determines the sorting index of each found adjacent point, and completes the sorting of multiple unsorted corner points. This method can sort the detected valid corner points even when the detection algorithm cannot detect all corner points completely. Furthermore, the sorted corner points can be mapped to world coordinates to achieve camera intrinsic and extrinsic parameter calibration and camera lens distortion correction.
[0075] refer to Figure 6 , Figure 6This is a schematic flowchart of the corner sorting method provided in this embodiment. This embodiment details the entire process from initial corner determination to iterative detection. The corner sorting method includes:
[0076] 601. Obtain the sorting index and initial distance of the initial corner point; the initial corner point is a corner point among multiple corner points to be sorted; the initial distance is determined based on the actual distance between the initial corner point and at least one of its adjacent points.
[0077] 602. Based on the initial distance of the initial corner point, filter the target adjacent points of the initial corner point from multiple unsorted corner points, and determine the sorting index of the target adjacent points of the initial corner point based on the sorting index of the initial corner point.
[0078] 603. Add the target adjacent points of the initial corner point to the sequence of adjacent points to be adjacent, and determine the current adjacent points to be adjacent in the sequence of adjacent points to be adjacent from the target adjacent points of the initial corner point.
[0079] 604. For each of the multiple unsorted corner points, determine the actual distance between the unsorted corner point and the current unsorted neighbor point in the sequence of unsorted neighbor points based on the coordinates of the unsorted corner point and the coordinates of the current unsorted neighbor point in the sequence of unsorted neighbor points.
[0080] 605. Based on multiple actual distances and the distance prediction values of the current neighboring point, filter the target neighboring points of the current neighboring point from multiple unsorted corner points. The distance prediction values are determined based on the actual distance between the current neighboring point and the corresponding neighboring point in the sorted corner points; the sorted corner points are corner points with known sorting indices; the current neighboring point is the target neighboring point of the corresponding neighboring point in the sorted corner points.
[0081] 606. Determine whether there is a target neighbor point of the current neighbor point among the multiple corner points to be sorted. If there is, proceed to step 607; otherwise, proceed to step 608.
[0082] 607. Determine the predicted distance value of the target neighbor point, and determine the sorting index of the target neighbor point based on the sorting index of the current neighbor point to be adjacent, and add the target neighbor point to the neighbor point sequence to obtain a new neighbor point sequence.
[0083] 608. Determine the sequence of nodes to be adjacent as the new sequence of nodes to be adjacent.
[0084] 609. Determine whether there are any remaining corner points in the new sequence of unadjacent points, and whether there are any remaining corner points among the multiple unsorted corner points. If there are remaining corner points among the multiple unsorted corner points, and there are remaining corner points in the new sequence of unadjacent points, then execute step 609. If there are no remaining corner points among the multiple unsorted corner points or no remaining corner points in the new sequence of unadjacent points, then execute step 610.
[0085] 610. Select the current node to be adjacent from the new sequence of nodes to be adjacent, and return to step 603.
[0086] 611. Determine the corner point sorting result based on the sorting index of multiple adjacent points to be deleted from the adjacent point sequence.
[0087] As can be seen from the above description, the corner point sorting method provided in this embodiment sorts multiple corner points to be sorted by gradually exploring and searching for adjacent points from the current adjacent point to the surrounding area based on the closeness between the predicted distance value and the actual distance. The sorting index of each found adjacent point is determined, and the sorting of multiple corner points to be sorted is completed. This method can sort the detected effective corner points even when the detection algorithm cannot completely detect all corner points. Then, the sorted corner points can be mapped to world coordinates to realize the calibration of camera intrinsic and extrinsic parameters and the distortion correction of camera lens.
[0088] Corresponding to the corner sorting method in the above embodiment, Figure 7 This is a structural block diagram of a corner sorting device provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 7 The device 70 includes: a processing module 701, a screening module 702, and a determination module 703.
[0089] The processing module 701 is used to determine the actual distance between the corner point to be sorted and the current neighboring point in the sequence of neighboring points, based on the coordinates of the corner point to be sorted and the coordinates of the current neighboring point in the sequence of neighboring points.
[0090] The filtering module 702 is used to filter the target adjacent points of the current corner point from multiple unsorted corner points based on multiple actual distances and the distance prediction value of the current adjacent point; the distance prediction value is determined based on the actual distance between the current adjacent point and the corresponding adjacent point in the sorted corner points; the sorted corner points are corner points with known sorting indices; the current adjacent point is the target adjacent point of the corresponding adjacent point in the sorted corner points;
[0091] The determination module 703 is used to determine the corner point sorting result based on the filtering result and the sorting index of the current neighboring point; the sorting index of the current neighboring point is determined based on the sorting index of the corresponding neighboring point among the sorted corner points.
[0092] In one embodiment of this disclosure, the device 70 further includes an initialization module, configured to obtain the sorting index and distance prediction value of the initial corner point; the initial corner point is a corner point among a plurality of corner points to be sorted; the distance prediction value is the distance prediction value between the initial corner point and the corresponding adjacent point among the plurality of corner points to be sorted; the initial corner point is added to the sequence of adjacent points to be sorted, and the initial corner point is determined as the current adjacent point to be sorted.
[0093] In one embodiment of this disclosure, the determining module 703 is specifically used to determine a new sequence of adjacent points based on the filtering results and the sorting index of the current adjacent points; and to process the new sequence of adjacent points to obtain the corner sorting result.
[0094] In one embodiment of this disclosure, the determining module 703 is specifically used to determine the distance prediction value of the target neighboring point if there is a target neighboring point of the current neighboring point among a plurality of corner points to be sorted, and to determine the sorting index of the target neighboring point according to the sorting index of the current neighboring point, and to add the target neighboring point to the sequence of neighboring points to obtain a new sequence of neighboring points to be sorted.
[0095] In one embodiment of this disclosure, the determining module 703 is specifically used to determine the positional relationship between the current neighboring point and the target neighboring point based on the coordinates of the current neighboring point and the coordinates of the target neighboring point; and to determine the sorting index of the target neighboring point based on the positional relationship and the index of the current neighboring point.
[0096] In one embodiment of this disclosure, the determining module 703 is specifically used to determine the distance prediction value of the target neighbor in a first direction based on the actual distance between the current neighbor to be adjacent and the target neighbor.
[0097] In one embodiment of this disclosure, the determining module 703 is specifically used to determine whether there are existing adjacent points of the target adjacent point in the second direction according to the sorting index of the target adjacent points; there is an angle between the first direction and the second direction; if there are existing adjacent points of the target adjacent point in the second direction, then the distance prediction value of the target adjacent point in the second direction is determined according to the coordinates of the existing adjacent points and the coordinates of the target adjacent point.
[0098] In one embodiment of this disclosure, the determining module 703 is specifically used to determine the distance prediction value of the target neighbor in the second direction based on the distance prediction value of the current neighbor to be adjacent in the second direction if the target neighbor does not have an existing neighbor in the second direction.
[0099] In one embodiment of this disclosure, the determining module 703 is specifically used to determine the sequence of adjacent points as a new sequence of adjacent points if there is no target adjacent point among the multiple corner points to be sorted.
[0100] In one embodiment of this disclosure, the determining module 703 is specifically configured to: if there are remaining corner points among multiple unsorted corner points, and there are remaining corner points in the new sequence of unsorted adjacent points, then repeatedly execute the following steps: selecting the current unsorted adjacent point from the new sequence of unsorted adjacent points; for each unsorted corner point, determining the actual distance between the unsorted corner point and the current unsorted adjacent point based on the coordinates of the unsorted corner point and the coordinates of the current unsorted adjacent point; determining whether there is a target adjacent point of the current unsorted adjacent point among multiple unsorted corner points based on multiple actual distances and the distance prediction value of the current unsorted adjacent point; deleting the current unsorted adjacent point from the new sequence of unsorted adjacent points; and determining the new sequence of unsorted adjacent points based on the filtering result and the sorting index of the current unsorted adjacent point, until there are no remaining corner points among multiple unsorted corner points or no remaining corner points in the new sequence of unsorted adjacent points; then determining the corner point sorting result based on the sorting index of the multiple unsorted adjacent points deleted from the sequence of unsorted adjacent points.
[0101] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0102] To implement the above embodiments, this disclosure also provides an electronic device.
[0103] refer to Figure 8 The diagram illustrates a structural schematic of an electronic device 800 suitable for implementing embodiments of the present disclosure. The electronic device 800 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 8 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0104] like Figure 8As shown, the electronic device 800 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the electronic device 800. The processing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0105] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 807 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 808 including, for example, magnetic tapes, hard disks, etc.; and communication devices 809. Communication device 809 allows electronic device 800 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 An electronic device 800 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0106] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by a processing device 801, it performs the functions defined in the methods of embodiments of this disclosure.
[0107] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0108] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0109] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0110] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0111] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0112] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0113] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0114] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0115] In a first aspect, according to one or more embodiments of this disclosure, a corner point sorting method is provided, comprising: for each of a plurality of corner points to be sorted, determining the actual distance between the corner point to be sorted and the current adjacent point in the sequence of adjacent points to be sorted, based on the coordinates of the corner point to be sorted and the coordinates of the current adjacent point in the sequence of adjacent points to be sorted; filtering target adjacent points of the current adjacent point from the plurality of corner points to be sorted based on the plurality of actual distances and the distance prediction value of the current adjacent point; the distance prediction value is determined based on the actual distance between the current adjacent point and the corresponding adjacent point in the sorted corner points; the sorted corner points are corner points with known sorting indices; the current adjacent point is the target adjacent point of the corresponding adjacent point in the sorted corner points; determining the corner point sorting result based on the filtering result and the sorting index of the current adjacent point; the sorting index of the current adjacent point is determined based on the sorting index of the corresponding adjacent point in the sorted corner points.
[0116] According to one or more embodiments of this disclosure, the method further includes: obtaining the sorting index and distance prediction value of the initial corner point; the initial corner point is a corner point among a plurality of corner points to be sorted; the distance prediction value is the distance prediction value between the initial corner point and the corresponding adjacent point among the plurality of corner points to be sorted; adding the initial corner point to the sequence of adjacent points to be sorted, and determining the initial corner point as the current adjacent point to be sorted.
[0117] According to one or more embodiments of this disclosure, determining the corner sorting result based on the filtering result and the sorting index of the current neighboring points includes: determining a new sequence of neighboring points based on the filtering result and the sorting index of the current neighboring points; and processing the new sequence of neighboring points to obtain the corner sorting result.
[0118] According to one or more embodiments of this disclosure, a new sequence of adjacent points is determined based on the filtering results and the sorting index of the current adjacent points, including: if there is a target adjacent point of the current adjacent point among multiple corner points to be sorted, then the distance prediction value of the target adjacent point is determined, and the sorting index of the target adjacent point is determined according to the sorting index of the current adjacent points, and the target adjacent point is added to the sequence of adjacent points to obtain a new sequence of adjacent points to be obtained.
[0119] According to one or more embodiments of this disclosure, determining the sorting index of a target neighbor based on the sorting index of the current neighbor to be adjacent includes: determining the positional relationship between the current neighbor to be adjacent and the target neighbor based on the coordinates of the current neighbor to be adjacent and the coordinates of the target neighbor; and determining the sorting index of the target neighbor based on the positional relationship and the index of the current neighbor to be adjacent.
[0120] According to one or more embodiments of the present disclosure, determining a distance prediction value for a target neighbor includes: determining a distance prediction value for the target neighbor in a first direction based on the actual distance between the current neighbor to be adjacent and the target neighbor.
[0121] According to one or more embodiments of this disclosure, determining the distance prediction value of a target neighbor point further includes: determining whether there is an existing neighbor point of the target neighbor point in a second direction based on the sorting index of the target neighbor point; there is an angle between the first direction and the second direction; if there is an existing neighbor point of the target neighbor point in the second direction, then determining the distance prediction value of the target neighbor point in the second direction based on the coordinates of the existing neighbor point and the coordinates of the target neighbor point.
[0122] According to one or more embodiments of this disclosure, determining the distance prediction value of a target neighbor point further includes: if the target neighbor point does not have an existing neighbor point in the second direction, then determining the distance prediction value of the target neighbor point in the second direction based on the distance prediction value of the current neighbor point to be adjacent in the second direction.
[0123] According to one or more embodiments of this disclosure, updating the sequence of adjacent points based on the screening results includes: if there is no target adjacent point of the current adjacent point among the multiple corner points to be sorted, then the sequence of adjacent points is determined as a new sequence of adjacent points.
[0124] According to one or more embodiments of this disclosure, processing a new sequence of unadjacent points to obtain a corner point sorting result includes: if there are remaining corner points among multiple unadjacent corner points, and there are remaining corner points in the new sequence of unadjacent points, then repeatedly selecting the current unadjacent point from the new sequence of unadjacent points; for each unadjacent corner point, determining the actual distance between the unadjacent corner point and the current unadjacent point based on the coordinates of the unadjacent corner point and the coordinates of the current unadjacent point; determining whether there is a target neighbor point of the current unadjacent point among multiple unadjacent corner points based on multiple actual distances and the distance prediction value of the current unadjacent point; deleting the current unadjacent point from the new sequence of unadjacent points; and determining a new sequence of unadjacent points based on the filtering result and the sorting index of the current unadjacent point, until there are no remaining corner points among multiple unadjacent corner points or no remaining corner points in the new sequence of unadjacent points, then determining the corner point sorting result based on the sorting index of the multiple unadjacent points deleted from the sequence of unadjacent points.
[0125] Secondly, according to one or more embodiments of this disclosure, a corner sorting device is provided, comprising: a processing module, configured to determine, for each of a plurality of corners to be sorted, the actual distance between the corner to be sorted and the current neighboring point in the sequence of neighboring points, based on the coordinates of the corner to be sorted and the coordinates of the current neighboring point in the sequence of neighboring points; a filtering module, configured to filter target neighboring points of the current neighboring point from the plurality of corners to be sorted based on the plurality of actual distances and the distance prediction value of the current neighboring point; the distance prediction value is determined based on the actual distance between the current neighboring point and the corresponding neighboring point in the sorted corners; the sorted corners are corners with known sorting indices; the current neighboring point is the target neighboring point of the corresponding neighboring point in the sorted corners; and a determining module, configured to determine the corner sorting result based on the filtering result and the sorting index of the current neighboring point; the sorting index of the current neighboring point is determined based on the sorting index of the corresponding neighboring point in the sorted corners.
[0126] According to one or more embodiments of this disclosure, the device 70 further includes an initialization module, configured to obtain the sorting index and distance prediction value of an initial corner point; the initial corner point is a corner point among a plurality of corner points to be sorted; the distance prediction value is the distance prediction value between the initial corner point and the corresponding adjacent point among the plurality of corner points to be sorted; the initial corner point is added to the sequence of adjacent points to be sorted, and the initial corner point is determined as the current adjacent point to be sorted.
[0127] According to one or more embodiments of this disclosure, the determining module is specifically used to determine a new sequence of adjacent points based on the filtering results and the sorting index of the current adjacent points; and to process the new sequence of adjacent points to obtain the corner point sorting result.
[0128] According to one or more embodiments of this disclosure, the determining module is specifically configured to determine the distance prediction value of the target neighboring point if there is a target neighboring point of the current neighboring point among a plurality of corner points to be sorted, determine the sorting index of the target neighboring point according to the sorting index of the current neighboring point, and add the target neighboring point to the sequence of neighboring points to obtain a new sequence of neighboring points to be sorted.
[0129] According to one or more embodiments of this disclosure, the determining module is specifically configured to determine the positional relationship between the current neighboring point and the target neighboring point based on the coordinates of the current neighboring point and the coordinates of the target neighboring point; and to determine the sorting index of the target neighboring point based on the positional relationship and the index of the current neighboring point.
[0130] According to one or more embodiments of this disclosure, a determining module is specifically configured to determine a distance prediction value of the target neighbor in a first direction based on the actual distance between the current neighbor to be adjacent and the target neighbor.
[0131] According to one or more embodiments of this disclosure, the determining module is specifically configured to determine whether there are existing adjacent points of the target adjacent point in the second direction based on the sorting index of the target adjacent points; there is an angle between the first direction and the second direction; if there are existing adjacent points of the target adjacent point in the second direction, then the distance prediction value of the target adjacent point in the second direction is determined based on the coordinates of the existing adjacent points and the coordinates of the target adjacent point.
[0132] According to one or more embodiments of this disclosure, the determining module is specifically configured to determine the distance prediction value of the target neighbor in the second direction based on the distance prediction value of the current neighbor to be adjacent in the second direction if the target neighbor does not have an existing neighbor in the second direction.
[0133] According to one or more embodiments of this disclosure, the determining module is specifically used to determine the sequence of adjacent points as a new sequence of adjacent points if there is no target adjacent point among the multiple corner points to be sorted.
[0134] According to one or more embodiments of this disclosure, a determining module is specifically configured to: if there are remaining corner points among multiple unsorted corner points, and there are remaining corner points in the new sequence of unsorted adjacent points, repeatedly execute the following steps: selecting the current unsorted adjacent point from the new sequence of unsorted adjacent points; for each unsorted corner point, determining the actual distance between the unsorted corner point and the current unsorted adjacent point based on the coordinates of the unsorted corner point and the coordinates of the current unsorted adjacent point; determining whether there is a target adjacent point of the current unsorted adjacent point among multiple unsorted corner points based on multiple actual distances and the distance prediction value of the current unsorted adjacent point; deleting the current unsorted adjacent point from the new sequence of unsorted adjacent points; and determining a new sequence of unsorted adjacent points based on the filtering results and the sorting index of the current unsorted adjacent point, until there are no remaining corner points among multiple unsorted corner points or no remaining corner points in the new sequence of unsorted adjacent points; and then determining the corner point sorting result based on the sorting index of the multiple unsorted adjacent points deleted from the sequence of unsorted adjacent points.
[0135] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;
[0136] The memory stores the instructions that the computer executes;
[0137] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the corner sorting method of the first aspect above and various possible designs of the first aspect.
[0138] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, which stores computer-executable instructions that, when executed by a processor, implement the corner sorting method of the first aspect and various possible designs of the first aspect.
[0139] Fifthly, according to one or more embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the corner sorting method described in the first aspect above and various possible designs of the first aspect.
[0140] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0141] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0142] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A corner point sorting method, characterized in that, include: For each of the multiple unsorted corner points, the actual distance between the unsorted corner point and the current unsorted neighbor point is determined based on the coordinates of the unsorted corner point and the coordinates of the current unsorted neighbor point in the sequence of unsorted neighbor points. Based on multiple actual distances and the distance prediction values of the current target neighbor, the target neighbor of the current target neighbor is selected from multiple unsorted corner points; the distance prediction values are determined based on the actual distance between the current target neighbor and the corresponding neighbor in the sorted corner points; the sorted corner points are corner points with known sorting indices. The current neighboring point is the target neighboring point of the corresponding neighboring point among the sorted corner points; Based on the filtering results and the sorting index of the current adjacent points, the corner point sorting result is determined; The sorting index of the current neighboring point is determined based on the sorting index of the corresponding neighboring point among the sorted corner points.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the sorting index and initial distance of the initial corner point; the initial corner point is a corner point among multiple corner points to be sorted; the initial distance is determined based on the actual distance between the initial corner point and at least one of its adjacent points; Based on the initial distance of the initial corner point, the target adjacent points of the initial corner point are filtered from multiple corner points to be sorted, and the sorting index of the target adjacent points of the initial corner point is determined according to the sorting index of the initial corner point. Add the target adjacent points of the initial corner point to the sequence of adjacent points to be adjacent, and determine the current adjacent point to be adjacent in the sequence of adjacent points to be adjacent from the target adjacent points of the initial corner point.
3. The method according to claim 1, characterized in that, The step of determining the corner sorting result based on the filtering results and the sorting index of the current adjacent points includes: Based on the filtering results and the sorting index of the current neighboring nodes, a new sequence of neighboring nodes is determined; The new sequence of adjacent points is processed to obtain the corner point sorting result.
4. The method according to claim 3, characterized in that, The step of determining a new sequence of nodes to be adjacent based on the filtering results and the sorting index of the current nodes to be adjacent includes: If a target neighbor of the current neighbor exists among the multiple corner points to be sorted, then the distance prediction value of the target neighbor is determined, and the sorting index of the target neighbor is determined according to the sorting index of the current neighbor. The target neighbor is then added to the sequence of neighbor points to be sorted to obtain a new sequence of neighbor points to be sorted.
5. The method according to claim 4, characterized in that, Determining the sorting index of the target neighbor based on the sorting index of the current neighbor to be adjacent includes: Based on the coordinates of the current point to be adjacent and the coordinates of the target point, determine the positional relationship between the current point to be adjacent and the target point; The sorting index of the target neighbor is determined based on the positional relationship and the index of the current neighbor to be adjacent.
6. The method according to claim 4, characterized in that, Determining the predicted distance value of the target neighbor point includes: Based on the actual distance between the current neighboring point and the target neighboring point, determine the predicted distance value of the target neighboring point in the first direction.
7. The method according to claim 6, characterized in that, The step of determining the predicted distance value of the target adjacent point further includes: Based on the sorting index of the target adjacent points, determine whether the target adjacent point has an existing adjacent point in the second direction; there is an angle between the first direction and the second direction; If the target neighbor point has existing neighbor points in the second direction, then the distance prediction value of the target neighbor point in the second direction is determined based on the coordinates of the existing neighbor points and the coordinates of the target neighbor point.
8. The method according to claim 7, characterized in that, The step of determining the predicted distance value of the target adjacent point further includes: If the target neighbor does not have an existing neighbor in the second direction, then the distance prediction value of the target neighbor in the second direction is determined based on the distance prediction value of the current neighbor to be adjacent in the second direction.
9. The method according to any one of claims 4-8, characterized in that, The step of updating the sequence of nodes to be adjacent based on the filtering results includes: If none of the target adjacent points of the current adjacent point are found among the multiple corner points to be sorted, then the sequence of adjacent points to be sorted is determined as a new sequence of adjacent points to be sorted.
10. The method according to any one of claims 4-8, characterized in that, The process of processing the new sequence of adjacent nodes to obtain the corner sorting result includes: If there are remaining corner points among the multiple unsorted corner points, and there are remaining corner points in the new sequence of unadjacent points, then the process of selecting the current unadjacent point from the new sequence of unadjacent points is repeated. For each unsorted corner point, the actual distance between the unsorted corner point and the current unadjacent point is determined based on the coordinates of the unsorted corner point and the coordinates of the current unadjacent point. Based on the multiple actual distances and the distance prediction values of the current unadjacent point, it is determined whether there is a target neighbor point of the current unadjacent point among the multiple unsorted corner points. The current unadjacent point is then deleted from the new sequence of unadjacent points. Based on the filtering results and the sorting index of the current unadjacent point, a new sequence of unadjacent points is determined. This process continues until there are no remaining corner points among the multiple unsorted corner points or no remaining corner points in the new sequence of unadjacent points. Then, the corner point sorting result is determined based on the sorting index of the multiple unadjacent points deleted from the sequence of unadjacent points.
11. A corner point sorting device, characterized in that, include: The processing module is used to determine the actual distance between each corner point to be sorted and the current neighbor point in the sequence of neighbor points, based on the coordinates of the corner point to be sorted and the coordinates of the current neighbor point in the sequence of neighbor points. A filtering module is used to filter target neighboring points of the current neighboring point from multiple unsorted corner points based on multiple actual distances and the distance prediction value of the current neighboring point, and delete the current neighboring point from the sequence of neighboring points; the distance prediction value is determined based on the actual distance between the current neighboring point and the corresponding neighboring point in the sorted corner points; the sorted corner points are corner points with known sorting indices; The current neighboring point is the target neighboring point of the corresponding neighboring point among the sorted corner points; The determination module is used to determine the corner point sorting result based on the filtering result and the sorting index of the current adjacent point; the sorting index of the current adjacent point is determined based on the sorting index of the corresponding adjacent point among the sorted corner points.
12. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the corner sorting method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the corner sorting method as described in any one of claims 1 to 10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the corner sorting method as described in any one of claims 1 to 10.