Three-dimensional scanning result evaluation method and electronic equipment
By obtaining the current point coordinates in the three-dimensional scanning process in real time, determining its neighborhood points, reference planes and local entropy, and outputting evaluation results in real time, solving the problem of insufficient accuracy and integrity in the three-dimensional scanning technology, achieving efficient scanning process and high-quality data quality.
Patent Information
- Application Number
- CN202411931769.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-18
AI Technical Summary
The existing three-dimensional scanning technology has insufficient accuracy and integrity, resulting in repeated scanning and time and space losses.
Provide a three-dimensional scanning result evaluation method, which can obtain the coordinates of the current point in real time, determine its neighborhood point, reference plane and local entropy, and output the evaluation results in real time to dynamically adjust the scanning strategy.
It realizes real-time evaluation of the stability and accuracy of scanned data during the three-dimensional scanning process, avoiding repeated scanning, improving efficiency, and ensuring data quality.
Smart Images

Figure CN119845142A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional scanning technology, and more specifically, to a three-dimensional scanning result evaluation method and electronic equipment. Background Art
[0002] 3D scanning technology provides a fast, accurate and efficient way to capture the 3D shape or size of an object or environment, thereby improving the efficiency and accuracy of work in related areas. Although 3D scanning technology has great potential and value in many fields, there are still technical and practical challenges in its application.
[0003] The traditional scanning measurement method is to use a calibration tool to obtain accurate calibration parameters, then use reflective marker points as features for data stitching. After the scanning is completed, the points are constructed into a polyhedral mesh for post-processing optimization, and finally the obtained model is subjected to feature detection and measurement tasks.
[0004] However, if there are problems with the accuracy and integrity of the scanned data in traditional technologies, they may not be discovered until the entire scanning process is completed, which may lead to repetitive scanning work. For larger objects, repeated scanning will result in huge time and space losses. Summary of the invention
[0005] The purpose of this application is to provide a three-dimensional scanning result evaluation method and electronic device to address the deficiencies in the above-mentioned prior art, so as to solve the problems of insufficient accuracy and completeness, and large time and space losses in the prior art.
[0006] To achieve the above objectives, the technical solutions adopted in this application are as follows:
[0007] In a first aspect, the present application provides a three-dimensional scanning result evaluation method, the method comprising:
[0008] Get the current point scanned during real-time 3D scanning;
[0009] Determine at least one neighboring point of the current point according to the coordinates of the current point;
[0010] Determine a reference plane of the current point according to the coordinates of the current point and the coordinates of each neighboring point of the current point;
[0011] Determine the local entropy of the current point according to the coordinates of the current point, the reference plane of the current point and the coordinates of each neighboring point of the current point, where the local entropy is used to characterize the stability and accuracy of the current point;
[0012] According to the local entropy of the current point, an evaluation result of the current point is determined and output.
[0013] Optionally, determining the reference plane of the current point according to the coordinates of the current point and the coordinates of each neighboring point of the current point includes:
[0014] A fitting process is performed according to the coordinates of the current point, the coordinates of the neighborhood points of the current point and preset reference plane parameters to determine the reference plane of the current point.
[0015] Optionally, determining the local entropy of the current point according to the coordinates of the current point, the reference plane of the current point, and the coordinates of each neighboring point of the current point includes:
[0016] Determine the normal angle of the current point according to the coordinates of the current point, the coordinates of each neighboring point of the current point and the reference plane of the current point;
[0017] Determine the normal angle of each neighborhood point;
[0018] The local entropy of the current point is determined according to the normal angle of the current point and the normal angles of each neighboring point.
[0019] Optionally, determining the normal angle of the current point according to the coordinates of the current point, the coordinates of each neighboring point of the current point, and a reference plane of the current point includes:
[0020] Determine the normal vector of the current point;
[0021] Determine a normal vector of a reference plane of the current point;
[0022] The normal angle of the current point is determined according to the normal vector of the current point and the normal vector of the reference plane of the current point.
[0023] Optionally, determining the local entropy of the current point according to the normal angle of the current point and the normal angles of each neighboring point includes:
[0024] Determine a first probability according to the normal angle of the current point and the normal angles of each neighboring point of the current point;
[0025] Taking the logarithm of the first probability as a first logarithm;
[0026] Calculate a first product of the first probability and the first logarithm, and use the negative of the first product as a first parameter;
[0027] Determine, according to the normal angle of each neighborhood point, a second probability corresponding to each neighborhood point, take the logarithm of each second probability as a second logarithm, calculate the product of the first probability and each second logarithm, and obtain a second product corresponding to each neighborhood point;
[0028] The negative of the sum of the second products corresponding to all neighborhood points is used as the second parameter;
[0029] The sum of the first parameter and the second parameter is used as the local entropy of the current point.
[0030] Optionally, determining and outputting an evaluation result of the current point according to the local entropy of the current point includes:
[0031] Determine the gradient value of the local entropy of the current point according to the local entropy of the current point;
[0032] According to the local entropy of the current point, the gradient value of the local entropy of the current point and a preset weight coefficient, an evaluation result of the current point is determined and output.
[0033] Optionally, determining and outputting an evaluation result of the current point according to the local entropy of the current point, the gradient value of the local entropy of the current point and a preset weight coefficient includes:
[0034] Calculate the product of the local entropy of the current point and the first weight system in the preset weight coefficient to obtain a third product;
[0035] Calculate the product of the gradient value of the local entropy of the current point and the second weight system in the preset weight coefficient to obtain a fourth product;
[0036] Calculate the sum of the third product, the fourth product and 1, and use the reciprocal of the sum as the evaluation value of the current point;
[0037] An evaluation result of the current point is determined and output according to the evaluation value of the current point.
[0038] Optionally, determining and outputting an evaluation result of the current point according to the evaluation value of the current point:
[0039] Get the preset scanning threshold;
[0040] Determine whether the evaluation value of the current point is less than the preset scanning threshold;
[0041] If so, a preset color is superimposed and displayed when displaying the three-dimensional scanning result of the current point.
[0042] Optionally, determining at least one neighborhood point of the current point according to the coordinates of the current point includes:
[0043] Generate a hash value corresponding to the current point according to the coordinates of the current point;
[0044] Determine, according to the hash value corresponding to the current point, a current grid unit where the current point is located and adjacent grid units of the current grid unit, wherein the current grid unit is one of a plurality of grid units obtained by dividing the three-dimensional space;
[0045] The neighborhood points of the current point are determined according to the coordinates of the current point, the coordinates of each point in the current grid unit, and the coordinates of each point in the adjacent grid units.
[0046] In a second aspect, the present application provides a three-dimensional scanning result evaluation device, the device comprising:
[0047] An acquisition module is used to acquire the current point scanned during real-time three-dimensional scanning;
[0048] A first determining module, configured to determine at least one neighboring point of the current point according to the coordinates of the current point;
[0049] A second determination module, used for determining a reference plane of the current point according to the coordinates of the current point and the coordinates of each neighboring point of the current point;
[0050] A third determination module, used to determine the local entropy of the current point according to the coordinates of the current point, the reference plane of the current point and the coordinates of each neighboring point of the current point, wherein the local entropy is used to characterize the stability and accuracy of the current point;
[0051] The output module is used to determine and output the evaluation result of the current point according to the local entropy of the current point.
[0052] In a third aspect, the present application provides an electronic device comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the above-mentioned three-dimensional scanning result evaluation method.
[0053] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned three-dimensional scanning result evaluation method are executed.
[0054] The beneficial effects of the present application are: determining the neighborhood points of the current point according to the acquired coordinates of the current point, then determining the reference plane of the current point according to the coordinates of the current point and the coordinates of the neighborhood points, then determining the local entropy of the current point according to the reference plane of the current point, the coordinates of the current point and the coordinates of each neighborhood point, and determining and outputting the evaluation result of the current point according to the local entropy of the current point. This embodiment acquires the current point obtained in the three-dimensional scanning process in real time, and determines the evaluation result of the current point in real time, so that the scanning strategy in the three-dimensional scanning process can be dynamically adjusted in real time according to the evaluation result of the current point during the three-dimensional scanning process, without the need for repeated scanning caused by judging whether the scanning accuracy meets the requirements after the overall three-dimensional scanning, avoiding the loss caused by repeated scanning, and in the absence of reference data, improving the efficiency of the scanning process, ensuring the quality of the scanning data, and making full and effective use of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 It is a flow chart of a three-dimensional scanning result evaluation method provided in an embodiment of the present application;
[0057] Figure 2 is a schematic diagram of a process for determining the local entropy of a current point provided in an embodiment of the present application;
[0058] Figure 3 It is a schematic diagram of a process for determining the normal angle of a current point provided in an embodiment of the present application;
[0059] Figure 4 is another flow chart of determining the local entropy of the current point provided by an embodiment of the present application;
[0060] Figure 5 It is a flowchart of determining and outputting the evaluation result of the current point provided by an embodiment of the present application;
[0061] Figure 6 It is another flow chart of determining and outputting the evaluation result of the current point provided by an embodiment of the present application;
[0062] Figure 7 This is a schematic diagram of a process for determining at least one neighboring point of a current point provided by an embodiment of the present application;
[0063] Figure 8It is a structural schematic diagram of a three-dimensional scanning result evaluation device provided in an embodiment of the present application;
[0064] Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0066] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0067] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0068] The traditional scanning measurement method is to use a calibration tool to obtain accurate calibration parameters, then use reflective marker points as features for data splicing, and after scanning, construct the points into a polyhedral mesh for post-processing optimization, and finally perform feature detection and measurement tasks on the obtained model. However, if there are problems with the accuracy and integrity of the scanned data in traditional technology, they may not be discovered until the entire scanning process is completed, which may lead to repetitive scanning work. For larger objects, repeated scanning will bring huge time and space losses.
[0069] Based on this, the present invention proposes a three-dimensional scanning result evaluation method, which determines at least one neighborhood point based on the current point acquired in real time, then determines the reference plane of the current point based on the current point and the neighborhood point, then determines the local entropy of the current point based on the coordinates of the current point, the reference plane of the current point and the coordinates of the neighborhood point of the current point, and finally determines and outputs the evaluation result of the current point based on the local entropy of the current point. The evaluation result of the current point is generated based on the acquired points without reference data, and the stability and accuracy of the scanning data can be analyzed. In addition, the present invention acquires the current point obtained in the three-dimensional scanning process in real time, and determines the evaluation result of the current point in real time, so that the scanning strategy in the three-dimensional scanning process can be dynamically adjusted according to the evaluation result of the current point in real time during the three-dimensional scanning process, without the need for repeated scanning caused by judging whether the scanning accuracy meets the requirements after the overall three-dimensional scanning, thereby avoiding the loss caused by repeated scanning, improving the efficiency of the scanning process, and ensuring the quality of the scanning data.
[0070] Currently, there are two types of scanning scenarios: one is when reference data exists, and the other is when there is no reference data. When reference data exists, the completeness and sufficiency of the scanning results can be determined by comparing the scanned data with the reference data, thereby adjusting the scanning strategy, where the reference data can be a digital model of the scanned object. This application proposes a three-dimensional scanning result evaluation method for the case where there is no reference data, so that the scanning strategy can be adjusted according to the three-dimensional scanning results in the absence of reference data to improve the scanning efficiency.
[0071] Next, refer to Figure 1 The evaluation method of 3D scanning results is introduced. Figure 1 3D scanning result evaluation method provided in an embodiment of the present application is a flow chart of a method for evaluating a 3D scanning result. Optionally, the method for evaluating a 3D scanning result can be applied to an electronic device with computing capabilities.
[0072] S101, obtaining a current point scanned during real-time three-dimensional scanning.
[0073] Optionally, line structured light 3D can be realized by using line laser to encode information of the object. Specifically, based on the epipolar matching relationship of binocular stereo vision, the successfully matched laser line points are fused into the preset spatial voxels, and then the distance vector pointing to the real surface of the three-dimensional object is calculated according to the spatial information stored in each voxel, and finally the Sign Distance Field (SDF) is obtained. The SDF can be used to reconstruct the high-precision three-dimensional data of the scanned object. The high-precision three-dimensional data includes at least one point, and one of the points is used as the current point.
[0074] Optionally, due to factors such as noise or calculation errors, the three-dimensional data of the scanned object is not reliable, that is, each point is not stable. Therefore, it is necessary to judge the stability of each point to determine whether the area where each point is located needs to be rescanned or the scanning strategy needs to be changed.
[0075] It should be understood that during the scanning process, the three-dimensional data obtained by scanning the entire object tends to be stable. As the laser line matching point information is gradually integrated into the spatial voxels, the three-dimensional data will gradually be corrected to reduce the influence of noise and errors, thereby gradually approaching the real three-dimensional information.
[0076] S102: Determine at least one neighboring point of the current point according to the coordinates of the current point.
[0077] Optionally, an incremental neighborhood data query method can be used to determine at least one neighboring point of the current point based on the coordinates of the current point. Among them, the incremental neighborhood data query method can be a hash-based grid neighborhood search method, which generates a hash value for each point, and then determines the current grid unit and the neighboring grid unit of the current point, and then determines at least one neighboring point of the current point through the coordinates of the current point and the coordinates of each point in the current grid unit and the coordinates of each point in the neighboring grid unit. The incremental neighborhood data query method can also be a dynamic tree structure query. For example, such as iKD-Tree (Incremental KD-Tree), this method supports incremental addition and deletion of points, and does not need to rebuild the entire tree structure each time the point is updated, thereby improving the update efficiency.
[0078] Optionally, the number of neighborhood points may be determined according to a neighborhood query radius preset by a user.
[0079] S103: Determine a reference plane of the current point according to the coordinates of the current point and the coordinates of each neighboring point of the current point.
[0080] Optionally, the reference plane of the current point may be a plane formed by fitting the current point and neighboring points of the current point, and the current point and the neighboring points of the current point are both on one side of the reference plane or on the reference plane.
[0081] As an optional implementation, the reference plane of the current point can be determined based on the coordinates of the current point and the coordinates of the neighboring points of the current point based on methods such as least squares method, principal components analysis (PCA) and random sample consensus algorithm (RANSAC).
[0082] S104, determining the local entropy of the current point according to the coordinates of the current point, the reference plane of the current point and the coordinates of each neighboring point of the current point, where the local entropy is used to characterize the stability and accuracy of the current point.
[0083] Optionally, the local entropy of the current point can characterize the stability, accuracy and complexity of the current point. Specifically, the smaller the local entropy, the higher the stability and accuracy of the current point, and the larger the local entropy, the lower the stability and accuracy of the current point.
[0084] As an optional implementation, the normal angle of the current point can be determined based on the coordinates of the current point and the reference plane of the current point, and the normal angles of the neighboring points of the current point can be calculated. Then, the local entropy of the current point can be determined based on the normal angle of the current point and the normal angles of the neighboring points.
[0085] S105. Determine and output an evaluation result of the current point according to the local entropy of the current point.
[0086] Optionally, based on the local entropy of the current point, it can be determined whether the current point is stable, and the evaluation result of the current point is determined and output based on the determination result.
[0087] As an optional implementation, the evaluation result of the current point can be displayed in text form superimposed on the three-dimensional scanning result.
[0088] As another optional implementation, the evaluation result of the current point may be superimposed on the three-dimensional scanning result in the form of different colors.
[0089] Optionally, when the evaluation result of the current point indicates instability or inaccuracy for a long time, the scanning strategy may be adjusted or the scanning may be continued, thereby increasing the reliability of the scanning data.
[0090] Optionally, the stability of the current point at the current moment is determined based on the points acquired in real time. As the points are updated and added during the three-dimensional scanning process, the local entropy of each point becomes smaller and smaller, and the evaluation results of more and more points can be determined and output until the evaluation results of all points are stable, which means that the scanning result is accurate and the scanning can be stopped.
[0091] It is worth noting that if the current point is updated at the next moment, the evaluation result of the point needs to be updated.
[0092] In this embodiment, the neighborhood points of the current point are determined according to the coordinates of the current point obtained, and then the reference plane of the current point is determined according to the coordinates of the current point and the coordinates of the neighborhood points, and then the local entropy of the current point is determined according to the reference plane of the current point, the coordinates of the current point and the coordinates of each neighborhood point, and the evaluation result of the current point is determined and output according to the local entropy of the current point. In this embodiment, the current point obtained in the three-dimensional scanning process is obtained in real time, and the evaluation result of the current point is determined in real time, so that the scanning strategy in the three-dimensional scanning process can be dynamically adjusted in real time according to the evaluation result of the current point during the three-dimensional scanning process, and there is no need to perform repeated scanning after the overall three-dimensional scanning to determine whether the scanning accuracy meets the requirements, thereby avoiding losses caused by repeated scanning, and in the absence of reference data, improving the efficiency of the scanning process, ensuring the quality of the scanning data, and making full and effective use of resources.
[0093] Next, the specific process of determining the reference plane of the current point according to the coordinates of the current point and the coordinates of each neighboring point of the current point in the above step S103 is introduced.
[0094] Optionally, fitting processing is performed according to the coordinates of the current point, the coordinates of the neighborhood points of the current point and preset reference plane parameters to determine the reference plane of the current point.
[0095] The preset reference plane parameters may be determined according to the reference plane fitting result of the current point and the actual result of the reference plane of the current point.
[0096] Specifically, the formula for determining the reference plane of the current point is as follows (1):
[0097]
[0098] Among them, Plane_ref i is the reference plane of the current point, the coordinates of the current point are (x, y, z), Among them, x i is the x-axis coordinate of the neighborhood point i, Among them, y i is the y-axis coordinate of the neighborhood point i, Among them, z i is the z-axis coordinate of the neighborhood point i, k is the number of neighborhood points, a i 、b i 、c i and i are the preset reference plane parameters.
[0099] In this embodiment, the reference plane of the current point is determined by fitting according to the coordinates of the current point, the coordinates of the neighborhood points of the current point and the preset reference plane parameters, so that the reference plane of the current point is determined based on the acquired points without relying on reference data, which is suitable for situations where there is no reference data.
[0100] Next, refer to Figure 2 The specific steps of determining the local entropy of the current point according to the coordinates of the current point, the reference plane of the current point and the coordinates of each neighboring point of the current point in the above step S104 are introduced. Figure 2 It is a schematic diagram of a process for determining the local entropy of the current point provided in an embodiment of the present application.
[0101] S201. Determine the normal angle of the current point according to the coordinates of the current point, the coordinates of each neighboring point of the current point, and the reference plane of the current point.
[0102] As an optional implementation, the normal vector of the current point is determined according to the coordinates of the current point and the coordinates of the neighboring points of the current point, and the normal angle of the current point is determined according to the reference plane of the current point and the normal vector of the current point.
[0103] The normal angle of the current point represents the angle between the normal vector of the current point and the normal vector of the reference plane of the current point.
[0104] S202: Determine the normal angle of each neighborhood point.
[0105] As an optional implementation, the neighborhood points of each neighborhood point are determined according to the reference plane of each neighborhood point, specifically, according to the coordinates of each neighborhood point. The neighborhood point of the current point is called the first neighborhood point, and the neighborhood point of the first neighborhood point is called the second neighborhood point. Then, according to the coordinates of each first neighborhood point and the coordinates of each second neighborhood point, the reference plane of each first neighborhood point is determined. According to the coordinates of each first neighborhood point and the coordinates of the second neighborhood point, the normal vector of each first neighborhood point is determined, and then according to the reference plane of each first neighborhood point, the normal vector of the reference plane of each first neighborhood point is determined. According to the normal vector of the first neighborhood point and the normal vector of the reference plane of the first neighborhood point, the normal angle of each first neighborhood point, that is, the normal angle of each neighborhood point of the current point, is determined.
[0106] S203: Determine the local entropy of the current point according to the normal angle of the current point and the normal angles of each neighboring point.
[0107] Optionally, the larger the normal angle of the current point and the normal angle of each neighboring point are, the larger the local entropy of the current point is; the smaller the normal angle of the current point and the normal angle of each neighboring point are, the smaller the local entropy of the current point is.
[0108] In this embodiment, by determining the normal angle of the current point and the normal angle of each neighboring point, and then determining the local entropy of the current point, the stability and accuracy state of the current point can be determined without relying on reference data, which is suitable for situations where there is no reference data.
[0109] Next, refer to Figure 3 The step of determining the normal angle of the current point according to the coordinates of the current point, the coordinates of the neighboring points of the current point and the reference plane of the current point in the above step S201 is introduced. Figure 3 It is a schematic diagram of a process for determining the normal angle of the current point provided in an embodiment of the present application.
[0110] S301, determine the normal vector of the current point.
[0111] As an optional implementation, based on the PCA algorithm, the normal vector of the current point is determined according to the coordinates of the current point and the coordinates of each neighboring point of the current point.
[0112] S302: Determine the normal vector of the reference plane of the current point.
[0113] It is worth mentioning that the direction of the normal vector of the reference plane of the current point and the direction of the normal vector of the current point are located on the same side of the reference plane of the current point.
[0114] S303: Determine the normal angle of the current point according to the normal vector of the current point and the normal vector of the reference plane of the current point.
[0115] Optionally, the formula for determining the normal angle of the current point may be as follows (2):
[0116]
[0117] Among them, θ i is the normal angle of the current point, n i is the normal vector of the current point, n r is the reference plane of the current point, n r It can be expressed as (a i ,b i ,c i ).
[0118] It is worth mentioning that the normal angle of each neighborhood point in the above step S202 can also be determined by referring to the above formula (2), which will not be described in detail in this embodiment.
[0119] In this embodiment, the normal vector of the current point and the normal vector of the reference plane are determined to determine the normal angle of the current point, and then the stability and accuracy of the current point are determined by the normal angle of the current point and the normal angle of the neighboring points. This is suitable for situations where there is no reference data.
[0120] Next, refer to Figure 4 The specific steps of determining the local entropy of the current point according to the normal angle of the current point and the normal angles of each neighboring point in the above step S203 are introduced. Figure 4 It is a schematic diagram of another process for determining the local entropy of the current point provided in an embodiment of the present application.
[0121] S401. Determine a first probability according to the normal angle of the current point and the normal angles of neighboring points of the current point.
[0122] Specifically, the formula for determining the first probability may be as shown in the following formula (3):
[0123]
[0124] in, is the first probability, which indicates the probability that the normal vector of the current point in each neighborhood point falls within the normal vector of the reference plane. i is the normal angle of the current point, θ i(j) is the normal angle of each neighboring point of the current point.
[0125] S402: Taking the logarithm of the first probability as the first logarithm.
[0126] It is worth noting that, based on the characteristics of the logarithmic function, the logarithm of the first probability is a negative value.
[0127] S403: Calculate a first product of the first probability and the first logarithm, and use the negative of the first product as a first parameter.
[0128] Optionally, since the first logarithm is a negative value, the first parameter is a positive value.
[0129] S404. Determine the second probability corresponding to each neighborhood point according to the normal angle of each neighborhood point, use the logarithm of each second probability as the second logarithm, calculate the product of the first probability and each second logarithm, and obtain the second product corresponding to each neighborhood point.
[0130] Specifically, the formula for determining the second probability may be as shown in the following formula (4):
[0131]
[0132] in, is the second probability, which indicates the probability that the normal vector of the neighborhood point j falls within the normal vector of the reference plane, θ j is the normal angle of the jth neighboring point of the current point.
[0133] It should be understood that if the second logarithm is a negative value, then the second product corresponding to each neighborhood point is a negative value.
[0134] S405. Take the negative of the sum of the second products corresponding to all neighborhood points as the second parameter.
[0135] Optionally, the second product is a negative value and the second parameter is a positive value.
[0136] S406: Taking the sum of the first parameter and the second parameter as the local entropy of the current point.
[0137] Specifically, the formula for determining the local entropy of the current point can be shown as the following formula (5):
[0138]
[0139] Among them, E i is the local entropy of the current point, is the first probability, is the first logarithm, is the first parameter, is the second probability, is the second logarithm, is the second product, is the second parameter.
[0140] In this embodiment, the local entropy of the current point is calculated to determine the stability and accuracy of the current point, and then the evaluation result of the current point is output.
[0141] The above process can determine the evaluation result of the current point through the local entropy of the current point. However, at some points in special positions such as chamfers or grooves, as the scanning process proceeds, the local entropy of the point may not decrease with the increase in the number of scans, but will become regionally stable with the increase in the number of scans. Therefore, in addition to directly determining the stability and accuracy of the current point through the local entropy of the current point, the evaluation result can also be determined by the following method.
[0142] Optionally, according to the local entropy of the current point, a gradient value of the local entropy of the current point is determined.
[0143] Among them, the gradient value of the local entropy of the current point is the rate of change of the local entropy of the current point. The larger the gradient value, the greater the change of the local entropy, and the smaller the gradient value, the smaller the change of the local entropy.
[0144] Optionally, the evaluation result of the current point is determined and output according to the local entropy of the current point, the gradient value of the local entropy of the current point and a preset weight coefficient.
[0145] Optionally, the larger the local entropy and gradient values of the current point are, the more unstable the current point is, and the smaller the local entropy and gradient values of the current point are, the more stable the current point is.
[0146] In this embodiment, by determining the gradient value of the local entropy of the current point, and based on the local entropy of the current point, the gradient value of the local entropy of the current point and the preset weight coefficient, the evaluation result of the current point is determined and output, so that the output evaluation result of the current point is more accurate, avoiding misjudgment caused by the large local entropy of points at special positions.
[0147] Further, refer to Figure 5 The process of determining and outputting the evaluation result of the current point according to the local entropy of the current point, the gradient value of the local entropy of the current point and the preset weight coefficient is introduced. Figure 5 It is a flowchart of determining and outputting the evaluation result of the current point provided in an embodiment of the present application.
[0148] S501. Calculate the product of the local entropy of the current point and the first weight system in the preset weight coefficient to obtain a third product.
[0149] S502: Calculate the product of the gradient value of the local entropy of the current point and the second weight system in the preset weight coefficient to obtain a fourth product.
[0150] S503. Calculate the sum of the third product, the fourth product and 1, and use the reciprocal of the sum as the evaluation value of the current point.
[0151] Specifically, the evaluation value of the current point can be calculated by the following formula (6):
[0152]
[0153] Among them, S i is the evaluation value of the current point, α is the first weight, β is the second weight, E i is the local entropy of the current point, is the gradient value of the local entropy at the current point.
[0154] The ratio of the first weight to the second weight may be adjusted according to actual conditions so that the local entropy or gradient value has a greater weight.
[0155] S504: Determine and output the evaluation result of the current point according to the evaluation value of the current point.
[0156] Optionally, the higher the evaluation value of the current point is, the more stable the evaluation result of the current point indicates.
[0157] Optionally, for points in non-special areas, when the local entropy is small, even if the gradient value changes, the evaluation value is at a high value. For points in special areas, if the local entropy value is large and the gradient value is low, it means that the point changes steadily and the evaluation value of the point is high. If the local entropy value is large and the gradient value is high, it means that the point changes unstably and the evaluation value of the point is low.
[0158] In this embodiment, the evaluation result of the current point is determined and output according to the evaluation value of the current point, so that the output evaluation result of the current point is more accurate, avoiding misjudgment caused by large local entropy of points at special positions.
[0159] As an optional implementation, refer to Figure 6 The specific process of determining and outputting the evaluation result of the current point according to the evaluation value of the current point in the above step S504 is introduced. Figure 6 It is another flowchart for determining and outputting the evaluation result of the current point provided in an embodiment of the present application.
[0160] S601: Obtain a preset scanning threshold.
[0161] The larger the preset scanning threshold is, the higher the requirement for the three-dimensional scanning result is.
[0162] S602: Determine whether the evaluation value of the current point is less than a preset scanning threshold.
[0163] Optionally, the difference between the evaluation value of the current point and the preset scanning threshold may be calculated. If the difference is greater than 0, it means that the evaluation value of the current point is greater than the preset scanning threshold.
[0164] Specifically, whether the evaluation value of the current point is less than a preset scanning threshold can be determined by the following formula (7).
[0165] C scan =sgn(S adequacy -V threshold )(7)
[0166] Among them, C scan To judge the result, S adequacy is the evaluation value of the current point, V threshold is the preset scanning threshold of the current point. The Sgn function can indicate the positive or negative value of the difference. scan When it is 1, the evaluation value of the current point is greater than the preset scanning threshold. scan When it is 0, the evaluation value of the current point is equal to the preset scanning threshold. scan When it is -1, the evaluation value of the current point is less than the preset scanning threshold.
[0167] S603: If yes, displaying a preset color superimposed on the 3D scanning result of the current point.
[0168] As an optional implementation, if the evaluation value of the current point is less than the preset scanning threshold, it means that the current point is unstable, and the preset unstable color, such as red, is superimposed when displaying the 3D scanning result of the current point. If the evaluation value of the current point is not less than the preset scanning threshold, it means that the current point is stable, and the preset stable color, such as green, or no color is displayed when displaying the 3D scanning result of the current point.
[0169] In this embodiment, by judging whether the evaluation value of the current point is less than the preset scanning threshold, the preset color is superimposed and displayed when displaying the three-dimensional scanning result of the current point. The real-time displayed color can quickly provide feedback on the stability and reliability of the current description data, thereby judging whether the current scanning data is sufficient.
[0170] As an optional implementation, refer to Figure 7 The specific implementation method of determining at least one neighboring point of the current point according to the coordinates of the current point in the above step S102 is as follows. Figure 7 It is a schematic diagram of a process for determining at least one neighboring point of a current point provided in an embodiment of the present application.
[0171] S701. Generate a hash value corresponding to the current point according to the coordinates of the current point.
[0172] Specifically, a corresponding different hash value is generated for each point in the three-dimensional scanning data.
[0173] S702. Determine a current grid unit where the current point is located and adjacent grid units of the current grid unit according to a hash value corresponding to the current point, wherein the current grid unit is one of a plurality of grid units obtained by dividing the three-dimensional space.
[0174] Specifically, the three-dimensional space is divided into a plurality of grid cells according to a preset division strategy, and then the current grid cell and the adjacent grid cells where the current point is located are determined according to the hash value corresponding to the current point.
[0175] Optionally, when there are newly added points, it is only necessary to distribute the points in each current grid unit according to the hash value of the newly added point.
[0176] S703 , determining the neighborhood points of the current point according to the coordinates of the current point, the coordinates of each point in the current grid unit, and the coordinates of each point in the adjacent grid units.
[0177] Optionally, the neighborhood point of the current point may be a point of the current grid unit or a point of a neighboring grid unit.
[0178] In this embodiment, by finding the neighboring points of the current point at each point in the current grid unit and each point in the adjacent grid units, the search range is made smaller and the amount of calculation is reduced.
[0179] Based on the same inventive concept, a three-dimensional scanning result evaluation device corresponding to the three-dimensional scanning result evaluation method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned three-dimensional scanning result evaluation method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0180] Reference Figure 8 FIG. 1 is a schematic diagram of a structure of a three-dimensional scanning result evaluation device provided in an embodiment of the present application, wherein the device comprises:
[0181] An acquisition module 801 is used to acquire a current point obtained during real-time three-dimensional scanning;
[0182] A first determining module 802, configured to determine at least one neighboring point of the current point according to the coordinates of the current point;
[0183] A second determination module 803 is used to determine a reference plane of the current point according to the coordinates of the current point and the coordinates of each neighboring point of the current point;
[0184] A third determination module 804 is used to determine the local entropy of the current point according to the coordinates of the current point, the reference plane of the current point and the coordinates of each neighboring point of the current point, wherein the local entropy is used to characterize the stability and accuracy of the current point;
[0185] The output module 805 is used to determine and output the evaluation result of the current point according to the local entropy of the current point.
[0186] Optionally, the second determining module 803 is specifically configured to:
[0187] A fitting process is performed according to the coordinates of the current point, the coordinates of the neighborhood points of the current point and preset reference plane parameters to determine the reference plane of the current point.
[0188] Optionally, the third determining module 804 is specifically configured to:
[0189] Determine the normal angle of the current point according to the coordinates of the current point, the coordinates of each neighboring point of the current point and the reference plane of the current point;
[0190] Determine the normal angle of each neighborhood point;
[0191] The local entropy of the current point is determined according to the normal angle of the current point and the normal angles of each neighboring point.
[0192] Optionally, the third determining module 804 is specifically configured to:
[0193] Determine the normal vector of the current point;
[0194] Determine a normal vector of a reference plane of the current point;
[0195] The normal angle of the current point is determined according to the normal vector of the current point and the normal vector of the reference plane of the current point.
[0196] Optionally, the third determining module 804 is specifically configured to:
[0197] Determine a first probability according to the normal angle of the current point and the normal angles of each neighboring point of the current point;
[0198] Taking the logarithm of the first probability as a first logarithm;
[0199] Calculate a first product of the first probability and the first logarithm, and use the negative of the first product as a first parameter;
[0200] Determine, according to the normal angle of each neighborhood point, a second probability corresponding to each neighborhood point, take the logarithm of each second probability as a second logarithm, calculate the product of the first probability and each second logarithm, and obtain a second product corresponding to each neighborhood point;
[0201] The negative of the sum of the second products corresponding to all neighborhood points is used as the second parameter;
[0202] The sum of the first parameter and the second parameter is used as the local entropy of the current point.
[0203] Optionally, the output module 805 is specifically used for:
[0204] Determine the gradient value of the local entropy of the current point according to the local entropy of the current point;
[0205] According to the local entropy of the current point, the gradient value of the local entropy of the current point and a preset weight coefficient, an evaluation result of the current point is determined and output.
[0206] Optionally, the output module 805 is specifically used for:
[0207] Calculate the product of the local entropy of the current point and the first weight system in the preset weight coefficient to obtain a third product;
[0208] Calculate the product of the gradient value of the local entropy of the current point and the second weight system in the preset weight coefficient to obtain a fourth product;
[0209] Calculate the sum of the third product, the fourth product and 1, and use the reciprocal of the sum as the evaluation value of the current point;
[0210] An evaluation result of the current point is determined and output according to the evaluation value of the current point.
[0211] Optionally, the output module 805 is specifically used for:
[0212] Get the preset scanning threshold;
[0213] Determine whether the evaluation value of the current point is less than the preset scanning threshold;
[0214] If so, a preset color is superimposed and displayed when displaying the three-dimensional scanning result of the current point.
[0215] Optionally, the first determining module 802 is specifically configured to:
[0216] Generate a hash value corresponding to the current point according to the coordinates of the current point;
[0217] Determine, according to the hash value corresponding to the current point, a current grid unit where the current point is located and adjacent grid units of the current grid unit, wherein the current grid unit is one of a plurality of grid units obtained by dividing the three-dimensional space;
[0218] The neighborhood points of the current point are determined according to the coordinates of the current point, the coordinates of each point in the current grid unit, and the coordinates of each point in the adjacent grid units.
[0219] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0220] The present application also provides an electronic device, such as Fig. 9 , which is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, includes: a processor 901, a memory 902 and a bus. The memory 902 stores machine-readable instructions executable by the processor 901 (for example, Figure 8 In the device, the execution instructions corresponding to the acquisition module 801, the first determination module 802, the second determination module 803, the third determination module 804 and the output module 805 are obtained, etc.), when the computer device is running, the processor 901 communicates with the memory 902 through a bus, and when the machine-readable instructions are executed by the processor 901, the above-mentioned three-dimensional scanning result evaluation method is executed.
[0221] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned three-dimensional scanning result evaluation method are executed.
[0222] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0223] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.
[0224] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A three-dimensional scanning result evaluation method, characterized in that: The method comprises: Get the current point scanned during real-time 3D scanning; Determine at least one neighboring point of the current point according to the coordinates of the current point; Determine a reference plane of the current point according to the coordinates of the current point and the coordinates of each neighboring point of the current point; Determine the local entropy of the current point according to the coordinates of the current point, the reference plane of the current point and the coordinates of each neighboring point of the current point, where the local entropy is used to characterize the stability and accuracy of the current point; According to the local entropy of the current point, an evaluation result of the current point is determined and output.
2. The three-dimensional scanning result evaluation method according to claim 1, characterized in that: The step of determining a reference plane of the current point according to the coordinates of the current point and the coordinates of each neighboring point of the current point includes: A fitting process is performed according to the coordinates of the current point, the coordinates of the neighborhood points of the current point and preset reference plane parameters to determine the reference plane of the current point.
3. The three-dimensional scanning result evaluation method according to claim 1, characterized in that: The determining the local entropy of the current point according to the coordinates of the current point, the reference plane of the current point and the coordinates of each neighboring point of the current point includes: Determine the normal angle of the current point according to the coordinates of the current point, the coordinates of each neighboring point of the current point and the reference plane of the current point; Determine the normal angle of each neighborhood point; The local entropy of the current point is determined according to the normal angle of the current point and the normal angles of each neighboring point.
4. The three-dimensional scanning result evaluation method according to claim 3, characterized in that: The determining the normal angle of the current point according to the coordinates of the current point, the coordinates of each neighboring point of the current point and the reference plane of the current point includes: Determine the normal vector of the current point; Determine a normal vector of a reference plane of the current point; The normal angle of the current point is determined according to the normal vector of the current point and the normal vector of the reference plane of the current point.
5. The three-dimensional scanning result evaluation method according to claim 3, characterized in that: Determining the local entropy of the current point according to the normal angle of the current point and the normal angles of each neighboring point includes: Determine a first probability according to the normal angle of the current point and the normal angles of each neighboring point of the current point; Taking the logarithm of the first probability as a first logarithm; Calculate a first product of the first probability and the first logarithm, and use the negative of the first product as a first parameter; Determine, according to the normal angle of each neighborhood point, a second probability corresponding to each neighborhood point, take the logarithm of each second probability as a second logarithm, calculate the product of the first probability and each second logarithm, and obtain a second product corresponding to each neighborhood point; The negative of the sum of the second products corresponding to all neighborhood points is used as the second parameter; The sum of the first parameter and the second parameter is used as the local entropy of the current point.
6. The three-dimensional scanning result evaluation method according to claim 1, characterized in that: The step of determining and outputting an evaluation result of the current point according to the local entropy of the current point includes: Determine the gradient value of the local entropy of the current point according to the local entropy of the current point; According to the local entropy of the current point, the gradient value of the local entropy of the current point and a preset weight coefficient, an evaluation result of the current point is determined and output.
7. The three-dimensional scanning result evaluation method according to claim 6, characterized in that: The step of determining and outputting an evaluation result of the current point according to the local entropy of the current point, the gradient value of the local entropy of the current point, and a preset weight coefficient includes: Calculate the product of the local entropy of the current point and the first weight system in the preset weight coefficient to obtain a third product; Calculate the product of the gradient value of the local entropy of the current point and the second weight system in the preset weight coefficient to obtain a fourth product; Calculate the sum of the third product, the fourth product and 1, and use the reciprocal of the sum as the evaluation value of the current point; An evaluation result of the current point is determined and output according to the evaluation value of the current point.
8. The three-dimensional scanning result evaluation method according to claim 7, characterized in that: Determine and output the evaluation result of the current point according to the evaluation value of the current point: Get the preset scanning threshold; Determine whether the evaluation value of the current point is less than the preset scanning threshold; If so, a preset color is superimposed and displayed when displaying the three-dimensional scanning result of the current point.
9. The three-dimensional scanning result evaluation method according to claim 1, characterized in that: The step of determining at least one neighboring point of the current point according to the coordinates of the current point includes: Generate a hash value corresponding to the current point according to the coordinates of the current point; Determine, according to the hash value corresponding to the current point, a current grid unit where the current point is located and adjacent grid units of the current grid unit, wherein the current grid unit is one of a plurality of grid units obtained by dividing the three-dimensional space; The neighborhood points of the current point are determined according to the coordinates of the current point, the coordinates of each point in the current grid unit, and the coordinates of each point in the adjacent grid units.
10. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor executes the machine-readable instructions to perform the steps of the three-dimensional scanning result evaluation method as described in any one of claims 1 to 9.