Data processing method and device and medical imaging equipment

By judging the position of key frames in 3D scanning technology for surface cropping and correction, the problem of low surface accuracy in the existing technology is solved, and more efficient data fusion and accurate 3D model construction are achieved.

CN118781024APending Publication Date: 2024-10-15HEFEI MEIYA OPTOELECTRONICS TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310326848.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In existing 3D scanning technology, the data registration method has the problem of low surface accuracy. In particular, rigid registration causes the overlapping area to be slightly warped, while flexible registration loses surface quality while improving accuracy.

Method used

This paper proposes a data processing method that determines whether the current frame in the retrace data frame reaches the key frame position, performs surface cropping and closure correction, and calculates similarity to determine whether to perform surface restoration or correction, thereby improving the accuracy of the fused surface.

Benefits of technology

It improves the accuracy of three-dimensional surface fusion, reduces cracking caused by scanning errors, saves doctor-patient time, and reduces computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118781024A_ABST
    Figure CN118781024A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device and medical imaging equipment. The method comprises the following steps: judging whether a current frame position in a flyback data frame reaches a key frame position or not; if yes, cutting the overall curved surface to obtain a cut curved surface and a cut curved surface; performing closed correction on the cut curved surface by using the current frame, and calculating the similarity before and after the closed correction; and if the similarity is greater than a similarity threshold value, performing curved surface recovery on the clipped curved surface by using the clipped curved surface, otherwise, performing curved surface correction on the clipped curved surface by using the frame data corresponding to the clipped curved surface. According to the method, the accuracy of data registration can be improved, the data fusion effect is improved, each frame of data does not need to be registered, the calculation complexity is low, and the fusion speed is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional scanning technology, and in particular to a data processing method, device and medical imaging equipment. Background Art

[0002] Optical imaging equipment can be used to scan and obtain frame data, and then the obtained frame data is registered and fused to obtain the corresponding three-dimensional surface. The data registration methods used in this process of the related technology are divided into flexible registration and rigid registration, both of which have the problem of low surface accuracy, that is, the obtained three-dimensional surface is different from the surface of the actual scanned object. Specifically, rigid registration will cause the overlapping area to be slightly warped, making the surface obtained after fusion not very accurate, and although flexible registration has a better visual effect after registration, it is achieved at the cost of surface accuracy.

[0003] Based on this, it is necessary to propose a data processing method to improve the accuracy of the fused surface. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the related art to at least some extent. To this end, the present invention aims to provide a data processing method, device and medical imaging equipment to improve the accuracy of obtaining a fused surface based on scan data.

[0005] In the first aspect, the present invention proposes a data processing method, which includes: determining whether the current frame position in the retrace data frame reaches the key frame position; if so, cropping the overall surface to obtain a cropped surface and a cropped surface; using the current frame to perform closure correction on the cropped surface, and calculating the similarity before and after the closure correction; if the similarity is greater than a similarity threshold, using the cropped surface to perform surface restoration on the cropped surface, otherwise using the frame data corresponding to the cropped surface to perform surface correction on the cropped surface.

[0006] In this technical solution, during the retrace process, when the current frame reaches the key frame, the overall surface is cropped, and then closure correction is performed using the current frame and the cropped surface. Based on the similarity, it is determined whether surface correction is needed, thereby improving the accuracy of the obtained fused surface.

[0007] In addition, the data processing method of the embodiment of the present invention may also have the following additional technical features:

[0008] According to an embodiment of the present invention, the clipping of the overall curved surface includes: determining a clipping start frame; and segmenting the curved surface between the clipping start frame and the current frame from the overall curved surface.

[0009] According to an embodiment of the present invention, the determining of the cropping start frame includes: taking the frame that reaches the key frame last time as the cropping start frame.

[0010] According to one embodiment of the present invention, the use of the current frame to perform closure correction on the cropped surface includes: based on the scanning alignment matrix of the current frame, finely aligning the point cloud data corresponding to the current frame with the cropped surface; if they match, executing the step of calculating the similarity before and after the closure correction; if they do not match and the normal is correct, after coarsely aligning and finely aligning the point cloud data corresponding to the current frame with the cropped surface in sequence and matching, executing the step of calculating the similarity before and after the closure correction.

[0011] According to one embodiment of the present invention, the method also includes: when the point cloud data corresponding to the current frame is precisely aligned with the cropped surface and fails to match and the normal is incorrect, and / or, when the point cloud data corresponding to the current frame is coarsely aligned and precisely aligned with the cropped surface in sequence and fails to match, using the cropped surface to perform surface restoration on the cropped surface.

[0012] According to one embodiment of the present invention, the normal judgment method includes: rotating and translating the point cloud data corresponding to the current frame according to the rotation and translation matrix obtained by precise alignment to obtain a common area; respectively calculating the normals of the point cloud data corresponding to the current frame and the point cloud data corresponding to the common area to obtain a first normal vector and a second normal vector; when the dot product of the first normal vector and the second normal vector is less than 0, it is determined that the normal is incorrect.

[0013] According to one embodiment of the present invention, the calculation of the similarity before and after the closure correction includes: obtaining a rotation difference and a translation difference based on a rotation and translation matrix obtained by precise alignment of the point cloud data corresponding to the current frame and a scanning alignment matrix of the current frame, and determining the similarity based on the rotation difference and the translation difference; wherein, if both the rotation difference and the translation difference are smaller than a difference threshold, it is determined that the similarity is greater than the similarity threshold, otherwise it is determined that the similarity is less than or equal to the similarity threshold.

[0014] According to one embodiment of the present invention, the surface correction of the cropped surface using the frame data corresponding to the cropped surface includes: if the point cloud data corresponding to the current frame is directly matched through fine alignment, then the rotation and translation matrix of each frame between the cropping start frame and the current frame is corrected based on the rotation and translation matrix obtained by the fine alignment, and the point cloud data corresponding to the corresponding frames are fused according to the corrected rotation and translation matrix; if the point cloud data corresponding to the current frame is matched through coarse alignment and fine alignment, then the frame between the cropping start frame and the current frame is divided into multiple segments, and the rotation and translation matrix of each frame in each segment is corrected, and the point cloud data corresponding to the corresponding frames are fused according to the corrected rotation and translation matrix.

[0015] According to one embodiment of the present invention, the rotation and translation matrix of each frame between the cropping start frame and the current frame is corrected based on the rotation and translation matrix obtained by the precise registration, including: obtaining the change matrix of the current frame according to the rotation and translation matrix obtained by precise registration of point cloud data corresponding to the current frame and the scanning registration matrix of the current frame; normalizing the change matrix of the current frame to obtain Euler angle coefficients; determining the scale value of each frame; obtaining the change matrix of each frame according to the Euler angle coefficients and the scale value of each frame; and obtaining the corrected rotation and translation matrix of each frame according to the change matrix of each frame and the scanning registration matrix.

[0016] According to one embodiment of the present invention, determining the proportional value of each frame includes: setting the proportional value of the current frame to a first value and the proportional value of the cropping start frame to a second value; obtaining the surface center points of the cropping start frame, the current frame, and each frame between the cropping start frame and the current frame after rotation and translation transformation by their respective scanning alignment matrices; performing curve fitting on the surface center points, and obtaining the proportional value of each frame based on the length of the curve obtained by fitting, the first value, and the second value.

[0017] In a second aspect, the present invention proposes a data registration and fusion device, comprising a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, the data processing method of the above embodiment is implemented.

[0018] In a third aspect, the present invention provides a medical imaging device, comprising the data registration and fusion device of the above embodiment.

[0019] The data processing method, device and medical imaging equipment of the embodiments of the present invention perform overall surface cropping based on key frames, and use frame data corresponding to the cropped surface to correct the cropped surface, thereby improving the accuracy of data registration and improving data fusion effect.

[0020] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flow chart of a key frame extraction method according to an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of a fitting plane of an example of the present invention;

[0023] Figure 3 is a flowchart of a key frame extraction method of an example of the present invention;

[0024] Figure 4 is a schematic diagram of an envelope grid of an example of the present invention;

[0025] Figure 5 is a schematic diagram of point cloud data corresponding to a key frame of an example of the present invention;

[0026] Figure 6 is a flow chart of a data processing method according to an embodiment of the present invention;

[0027] Figure 7 is a schematic diagram of an oral scanning direction according to an embodiment of the present invention;

[0028] Figure 8 is a schematic diagram of the effect of curved surface cutting according to an embodiment of the present invention;

[0029] Fig. 9 is a schematic diagram of the effect of surface closure correction according to an embodiment of the present invention;

[0030] Fig.10 is a structural block diagram of a data registration and fusion device according to an embodiment of the present invention;

[0031] Fig.11 It is a structural block diagram of a medical imaging device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0033] In the embodiment of the present invention, when the intraoral scanner is used to scan the patient's oral cavity in real time, the point cloud data of each frame obtained by the scan is subjected to operations such as registration and fusion to obtain a curved surface. In order to reduce the amount of calculation for registration and fusion, a key frame can be selected from each frame of point cloud data obtained by the scan, and then the registration and fusion operation can be performed based on the key frame. In order to improve the registration and fusion effect, a curved surface correction can be performed.

[0034] First, the key frame extraction method of the embodiment of the present invention is described. Figure 1 FIG. 1 is a flowchart of a key frame extraction method according to an embodiment of the present invention. Figure 1 As shown, the key frame extraction method of the embodiment of the present invention includes the following steps:

[0035] S101, determining whether the current frame satisfies a key frame update start condition.

[0036] It should be noted that the process of scanning and registering and fusing may include two types of surfaces. One is the surface corresponding to the point cloud data of a single frame, and the other is the continuously growing overall surface obtained by continuously registering and fusing the point cloud data of a single frame used for registration and fusion to the overall surface. The initial overall surface may be the point cloud data of the initial frame.

[0037] There are at least two types of frame sequences. The first type of frame sequence is a scanning frame sequence obtained by scanning, which at least includes valid frames determined by registration calculation for registration and fusion to obtain the overall surface, and discarded frames that are not used for registration and fusion to obtain the overall surface; the second type of frame sequence is a valid frame sequence composed of valid frames used for registration and fusion to obtain the overall surface.

[0038] In the embodiment of the present invention, the key frame extraction method is aimed at the time sequence of point cloud data, mainly the valid frame sequence, and the current frame is recorded as the point cloud data frame currently being processed in the time sequence. In addition, the present invention can pre-set the key frame update function, specifically, when the key frame update function is turned on, the key frame is updated, and when the key frame update function is not turned on or turned off, the key frame is not updated.

[0039] S102: If the conditions are met, key frame update is started, and key frame update is performed according to the current frame, and then the next frame is judged; otherwise, the next frame is directly judged.

[0040] The next frame refers to the next frame of the current frame in the valid frame sequence.

[0041] In some embodiments of the present invention, determining whether the current frame satisfies the key frame update start condition may include:

[0042] S201, determining whether the current frame is an initial frame, where the initial frame is the first frame used to fuse into an overall curved surface.

[0043] Specifically, the initial frame is the first frame used for registration and fusion, that is, the first frame in a valid frame sequence.

[0044] S202: If yes, determine whether the current frame satisfies the key frame update start condition.

[0045] In one embodiment, the initial frame is obtained in the following manner: obtain a target frame and multiple frames scanned continuously thereafter, the target frame being the first frame of the scanning frame sequence; determine whether the spatial distance and registration results between the target frame and multiple frames scanned continuously thereafter meet preset conditions; if so, determine the target frame as the initial frame, which is beneficial to improving the accuracy and stability of subsequent registration and fusion results. In specific applications, this step can be looped until the initial frame is obtained. The discarding here mainly refers to the frames that are not used for registration and fusion to the overall surface.

[0046] The process of processing data can be a process of scanning and acquiring a frame sequence while performing registration and fusion, and discarding inappropriate frames at the same time. In the initial scanning process, a scanning frame sequence is first acquired, and the first frame is used as the target frame. It is determined whether the spatial distance and registration results between the target frame and other frames in the scanning frame sequence meet the preset conditions. If they do, the target frame is determined as the initial frame. If not, the scanning frame sequence can be discarded, and the scanning continues to acquire a new scanning frame sequence, in which the first frame becomes the target frame. In this way, the target frame and multiple frames of continuous scanning thereafter are regained, and the above judgment on the spatial distance and registration results is repeated until the initial frame is acquired, that is, the first frame used for registration and fusion, that is, the first valid frame, which is also the first frame in the valid frame sequence.

[0047] Furthermore, in one implementation, determining whether the spatial distance between the target frame and other frames in the scanning frame sequence and the registration result meet preset conditions includes:

[0048] A1. Calculate the distances between the center points of the multiple frames scanned continuously after the target frame and the center point of the target frame, and obtain the registration result of the N-1 frame.

[0049] A2. If the N-1 distances are all less than the first threshold value, and the N-1 registration results are all higher than the preset accuracy, it is determined that the spatial distance and registration results between the target frame and the subsequent continuously scanned multiple frames meet the preset conditions, which means that the initial frame has a certain stability.

[0050] In another implementation, determining whether the spatial distance and registration results between the target frame and the subsequent continuously scanned multiple frames meet preset conditions specifically includes:

[0051] B1. Calculate the distances between the center points of adjacent frames in the target frame and the multiple frames scanned continuously thereafter, and obtain the registration result of the N-1 frame, wherein the N-1 frame is the multiple frames scanned continuously thereafter.

[0052] B2. If the distances between the center points of adjacent frames are all less than the second threshold value, and the N-1 registration results are all higher than the preset accuracy, it is determined that the spatial distance and registration results between the target frame and the multiple frames scanned continuously thereafter meet the preset conditions, which means that the initial frame has a certain stability.

[0053] Specifically, the above-mentioned registration results refer to the registration results of the point cloud data corresponding to the N-1 frames after the target frame and the previously calculated registration fusion surfaces, a total of N-1 registration results, and the first threshold, the second threshold and the preset accuracy can be set according to the actual situation. For the above-mentioned previous frames, for example, at this time, the three consecutive frames scanned after the initial frame meet the conditions of the above-mentioned steps A1 and A2. When the next frame, that is, the fifth frame, is scanned, the fifth frame is registered with the overall point cloud data composed of the previous initial frame, the second frame, the third frame and the fourth frame, and then it is determined whether the registration result is higher than the preset accuracy, and so on, until the registration results of the consecutive N-1 frames scanned after the initial frame are higher than the preset accuracy.

[0054] S203: If no, that is, when the current frame is not the initial frame, determine whether the current frame meets the start condition according to the spatial information of the current frame and / or the temporal information of the current frame.

[0055] Determining whether the current frame meets the start-up condition according to the spatial information of the current frame includes: calculating the size change of the current frame compared with the previous frame; if the size change is greater than the offset threshold, determining that the current frame meets the start-up condition.

[0056] The size of a single frame can be described by the space occupied by the point cloud data. For example, in a certain coordinate system, the distance between the extreme coordinates of the point cloud in a certain direction can be used to describe its size. The size can also be described by the length, width and height of the bounding box that envelops the single frame point cloud data. The size change can be expressed by subtracting the corresponding values ​​of the two and then taking the absolute value.

[0057] Specifically, the coordinate system can be determined in the following way: plane fitting is performed on the center points of the current frame and its previous frames to obtain a fitting plane; curve fitting is performed on the projection points of the center points of the current frame and its previous frames in the fitting plane to obtain a fitting curve; the direction of the line connecting the endpoints of the fitting curve is taken as the X-axis, the direction perpendicular to the X-axis in the fitting plane is taken as the Y-axis, and the direction perpendicular to the fitting plane is taken as the Z-axis. Based on this step, a coordinate system can be determined. In the process of continuously registering and fusing different single-frame point cloud data to the overall surface, the overall surface continues to grow, and the determined coordinate system will also change accordingly.

[0058] The above fitting plane, fitting curve, and current frame can all be referenced Figure 2 For example, the center point of the current frame and the previous frame is the center of gravity of each frame, that is, the location of the average value of the coordinates of each point in each frame in the X-axis, Y-axis, and Z-axis directions.

[0059] The size change of the current frame compared to the previous frame can be determined in any one or more of the following ways:

[0060] Method 1: Calculate the first difference between the X value of the bounding box of the current frame and the X value of the bounding box of the previous frame, and use the first difference as the size change;

[0061] Method 2: Calculate the second difference between the Y value of the bounding box of the current frame and the Y value of the bounding box of the previous frame, and use the second difference as the size change;

[0062] Method 3: Calculate the third difference between the Z value of the bounding box of the current frame and the Z value of the bounding box of the previous frame, and use the third difference as the size change. These differences may be absolute values.

[0063] The X value of the bounding box refers to the length of the bounding box in the X direction, the Y value of the bounding box refers to the length of the bounding box in the Y direction, and the Z value of the bounding box refers to the length of the bounding box in the Z direction. That is, the size change amount may include any one of the first difference, the second difference, and the third difference, or any two or three. The offset threshold may be set for the first difference, the second difference, and the third difference, respectively.

[0064] In some embodiments of the present invention, judging whether the current frame satisfies the start condition according to the spatial information of the current frame may include:

[0065] S301, calculating the size change of the current frame compared with the previous frame.

[0066] It should be noted that, in order to facilitate the registration and fusion operation, the point cloud data obtained by scanning can be quantized to the same coordinate system, such as the world coordinate system O-XYZ.

[0067] Specifically, calculating the size change of the current frame compared to the previous frame may include:

[0068] B1. Perform plane fitting on the center points of the current frame and the previous frame to obtain a fitting plane, and perform curve fitting on the projection points of the center points of the current frame and the previous frame on the fitting plane to obtain a fitting curve.

[0069] The above fitting plane, fitting curve, and current frame can all be referenced Figure 2 For example, the center point of the current frame and the previous frame is the center of gravity of each frame, that is, the average coordinate position of each point in each frame in the X-axis, Y-axis, and Z-axis. It should be noted that the direction of the line connecting the endpoints of the fitting curve is taken as the X-axis. Figure 2 The marking of the X-axis direction.

[0070] B2. The length of the line connecting the endpoints of the fitting curve is used as the X value of the current frame, and the maximum distance from the point on the fitting curve to the line connecting the endpoints is used as the Y value of the current frame.

[0071] B3. Calculate a first difference between the X value of the current frame and the X value of the previous frame, and use the first difference as the size change amount; and / or calculate a difference between the Y value of the current frame and the Y value of the previous frame, and use the second difference as the size change amount.

[0072] The first difference value and the second difference value of the previous frame are determined based on a fitting curve obtained by curve fitting the projection points of each center point of the previous frame and the previous frame on the above fitting plane.

[0073] S302: If the size change is greater than the offset threshold, it is determined that the current frame meets the start condition.

[0074] Specifically, step S302 includes executing any of the following methods:

[0075] Mode 1: The first difference is greater than the X-direction offset threshold, and the second difference is greater than the Y-direction offset threshold, and the current frame is determined to meet the opening condition; Mode 2: The first difference is greater than the X-direction offset threshold, and the current frame is determined to meet the opening condition; Mode 3: The second difference is greater than the Y-direction offset threshold, and the current frame is determined to meet the opening condition.

[0076] For example, the X value of the bounding box of the current frame is recorded as X2, the X value of the bounding box of the previous frame is recorded as X1, the Y value of the bounding box of the current frame is recorded as Y2, the Y value of the bounding box of the previous frame is recorded as Y1, the X-direction offset threshold is recorded as ΔX, and the Y-direction offset threshold is recorded as ΔY. Therefore, if X2-X1>ΔX, and / or, Y2-Y1>ΔY, it is determined that the current frame meets the key frame update start condition. It should be noted that the above-mentioned X-direction offset threshold ΔX and Y-direction offset threshold ΔY can be set according to actual conditions. The larger the value, the lower the frequency of key frame updates and the fewer frames used for key frame updates. To ensure the effectiveness of the extracted key frames, both offset thresholds can be between 10-30 mm, and the value can be 20 mm.

[0077] In some embodiments of the present invention, judging whether the current frame meets the start condition according to the time information of the current frame may include:

[0078] S401, determining a first frame number corresponding to a current regression frame, wherein the regression frame is a preset frame.

[0079] Since the present invention is aimed at the time sequence of point cloud data, that is, the valid frame sequence, each frame has its own ranking, such as the initial frame is ranked first, that is, the frame number corresponding to the initial frame is 1; the nth frame is ranked nth, that is, the frame number corresponding to the nth frame is n. Among them, the above frame number can reflect the time information, the higher the ranking, the smaller the frame number, and the earlier the corresponding scanning time.

[0080] S402, calculating the difference between the second frame number corresponding to the current frame and the first frame number, and determining whether the difference is greater than a frame number threshold.

[0081] S403: If not, determine whether the current frame meets the start condition.

[0082] For example, the first frame number corresponding to the current regression frame is recorded as n1, the second frame number corresponding to the current frame is recorded as n2, and the frame number threshold is recorded as Δf. If n2-n1>Δf, it is determined that the current frame does not meet the key frame update start condition, otherwise, it is determined that the current frame meets the key frame update start condition. Among them, the frame number threshold Δf can be set according to actual conditions. The value of the frame number threshold Δf is used to determine when to close the update in time. The smaller the value, the closer the frame to the current regression frame is to perform key frame update. The frame number threshold Δf can be, for example, 50.

[0083] It should be noted that the position corresponding to the regression frame is the position of the frame where the scan is more than halfway, such as the position of the frame where the half-jaw is scanned again, and the frame number corresponding to the regression frame is also updated in real time. The specific updating method can refer to the content of the following step S602. In addition, the above regression frame does not exist at the beginning, and its corresponding frame number does not exist. Therefore, when judging whether the opening condition is met according to the spatial information or time information of the current frame in the above step S203, if the frame number corresponding to the regression frame does not exist at present, the above step S203 can also judge whether the opening condition is met according to the spatial information of the current frame.

[0084] In the above step S101, it is determined whether the current frame meets the start condition of key frame update. As an example, refer to Figure 3 , real-time scanning frame, first determine whether the current frame is the initial frame, if the current frame is the initial frame, start the key frame update; if the current frame is not the initial frame, determine whether the spatial information and / or temporal information of the current frame meets the start condition, if so, start the key frame update.

[0085] In some embodiments of the present invention, updating a key frame according to the current frame may include:

[0086] S501: If the current frame is an initial frame, the current frame is used as a key frame.

[0087] The initial frame is the first frame used to form the overall surface. Since unstable conditions such as scanning jitter may occur during the initial scan, it is necessary to perform stability detection on the target frame to determine whether the target frame is valid. If it is valid, it can be used as the initial frame, thereby making the initial frame more accurate. Therefore, the initial frame can be selected as a key frame.

[0088] S502, if the current frame is the first frame that meets the start condition after the initial frame, determine the bounding box of the current overall surface, and take the frame where the minimum X-axis coordinate, the frame where the maximum X-axis coordinate, the frame where the minimum Y-axis coordinate, the frame where the maximum Y-axis coordinate, the frame where the minimum Z-axis coordinate, and the frame where the maximum Z-axis coordinate on the bounding box are located as key frames, and are recorded as KeyXMin, KeyXMax, KeyYMin, KeyYMax, KeyZMin, and KeyZMax respectively.

[0089] Specifically, the current overall surface refers to the overall surface formed by the registration and fusion of the valid frames before the current frame. The current overall surface is enveloping with a cube grid to obtain its corresponding bounding box. After enveloping, the cube grid forms a cuboid or a cube area. Figure 4As shown, the current overall surface can be obtained by the N frames used to determine the stability of the initial frame. The frame containing the minimum X-axis coordinate, the frame containing the maximum X-axis coordinate, the frame containing the minimum Y-axis coordinate, the frame containing the maximum Y-axis coordinate, the frame containing the minimum Z-axis coordinate, the frame containing the maximum Z-axis coordinate and the initial frame on the above-mentioned bounding box are used as key frames, totaling seven key frames. It should be noted that since the overall surface is constantly increasing during the scanning process, but since the dental arch is a curve, the size of the bounding box of the corresponding overall surface when the current frame is in different frame positions may be different or the same, and the size of the bounding box increases or remains unchanged as the overall surface increases.

[0090] For the selection of the seven key frames mentioned above, refer to Figure 5 Although there are many point cloud data in a single frame, if a coarse registration method is selected, the SIFT (Scale-invariant feature transform) feature points are used. Considering that there are few SIFT feature points in a single frame, it is easy to have errors when used for coarse registration. Therefore, it is necessary to select the feature points and feature histogram descriptors of the overall point cloud data of the 30 frames before and after each key frame as the feature points and feature histogram descriptors of each key frame position, that is, the point cloud data of the 30 frames before and after each key frame are added together as a whole, which are used to represent the seven key frames respectively. And because the frame rate is very fast, the area selected by adding up the 30 frames before and after is not much different from the single frame area, and it can also improve the accuracy of coarse registration.

[0091] S503, if the current frame is the nth frame that meets the start condition after the initial frame, then calculate the minimum X-axis coordinate, maximum X-axis coordinate, minimum Y-axis coordinate, maximum Y-axis coordinate, minimum Z-axis coordinate, and maximum Z-axis coordinate of the current frame, respectively, and correspond to the differences between the minimum X-axis coordinate of KeyXMin, the maximum X-axis coordinate of KeyXMax, the minimum Y-axis coordinate of KeyYMin, the maximum Y-axis coordinate of KeyYMax, the minimum Z-axis coordinate of KeyZMin, and the maximum Z-axis coordinate of KeyZMax, and when there is a difference greater than the movement threshold, update the key frame corresponding to the difference to the current frame, where n is an integer greater than 1.

[0092] The movement threshold ΔK can be set according to actual conditions. The larger the value, the fewer frames that can be updated as key frames. To ensure the validity of the extracted frames, ΔK can be set within a distance of 10-30 points, such as 20 points.

[0093] In addition, when it is determined that the current frame does not meet the start condition for key frame update, the key frame update is turned off, and the above key frame remains unchanged. When it is determined that the current frame meets the start condition for key frame update, the key frame is updated.

[0094] In some embodiments of the present invention, the method further comprises:

[0095] S601, record the update times of KeyXMin, KeyXMax, KeyYMin, KeyYMax, KeyZMin, and KeyZMax respectively.

[0096] S602: When the current frame is a non-key frame, the method may include:

[0097] C1. If the update times of KeyXMin is greater than the update times of KeyXMax, and the size of the current bounding box in the X-axis direction is greater than the third threshold, determine whether the X-axis coordinate of the center point of the current frame is less than the average of the maximum X-axis coordinate of the current KeyXMax and the minimum X-axis coordinate of the current KeyXMin. If it is less than, determine whether there is a frame number corresponding to the regression frame, that is, determine whether there is a frame that has been set as the regression frame. If not, take the frame number corresponding to the current frame as the frame number corresponding to the regression frame, that is, take the current frame as the regression frame, and record the KeyXMin corresponding to the regression frame. If there is a frame number corresponding to the regression frame, that is, there is a frame that has been set as the regression frame, and the KeyXMin corresponding to the regression frame changes, that is, the current KeyXMax changes compared to the last time the regression frame was updated, then the frame number corresponding to the current regression frame is updated to the frame number corresponding to the current frame.

[0098] The third threshold value may be determined according to the dental arch length, and the third threshold value needs to be greater than or equal to the dental arch length to ensure that more than half of the jaw is scanned.

[0099] C2. If the update times of KeyXMax is greater than the update times of KeyXMin, and the size of the current bounding box in the X-axis direction is greater than the third threshold, determine whether the X-axis coordinate of the center point of the current frame is greater than the average of the maximum X-axis coordinate of the current KeyXMax and the minimum X-axis coordinate of the current KeyXMin. If it is greater, determine whether there is a frame number corresponding to the regression frame, that is, there is a frame that has been set as the regression frame. The frame number corresponding to the current frame is used as the frame number corresponding to the regression frame, and the KeyXMax corresponding to the regression frame is recorded. If there is a frame number corresponding to the regression frame and the KeyXMax corresponding to the regression frame changes, the frame number corresponding to the current regression frame is updated to the frame number corresponding to the current frame.

[0100] It should be noted that the feature points and feature histogram descriptors of the overall point cloud data of multiple frames before and after the key frame, such as 30 frames, can be selected as the feature points and feature histogram descriptors of the seven key frame positions and updated in real time. The reason is: there are few feature points in a single frame, which is easy to mismatch during registration, so the image of these frames added together is used as the key frame image, so there are more feature points, and because the frame rate is very fast, nearly 200 per second, and 30 per second, so there is not much area in the 30 frames before and after, which looks not much larger than a single frame, but because the feature points are superimposed, there is a big change in the number of feature points.

[0101] In summary, the key frame extraction method sets the start condition for the key frame update, and starts the update only when the start condition is met. The key frame update can reduce the amount of subsequent registration and fusion calculations and avoid using every frame for registration and fusion. At the same time, the spatial information and time information of the point cloud data are used to determine whether the key frame is updated, which can ensure the validity of the extracted key frame and avoid taking the wrong frame, i.e. the split frame, as the key frame, which is beneficial to improve the accuracy of the surface correction in the future.

[0102] The following describes a data processing method, apparatus, and medical imaging device according to an embodiment of the present invention.

[0103] Figure 6 is a flow chart of a data processing method according to an embodiment of the present invention. Figure 6 As shown, the data processing method includes:

[0104] S61, determining whether the current frame position in the retrace data frame reaches the key frame position.

[0105] The key frames may be obtained by using the key frame extraction method of the above embodiment, or by using other key frame extraction methods, for example, extracting key frames according to time sequence intervals.

[0106] Specifically, it is determined whether the current frame position in the retrace data frame reaches the key frame position, that is, it is determined whether the current frame meets the conditions of the opening and closing algorithm. The judgment method is: first extract the key frame, and when the intraoral scanner retrace, the key frame extraction can continue, and it is determined whether the current frame position is near the key frame position. In other words, the current frame position reaches the key frame position, which means that it reaches the vicinity of the key frame position after scanning the key frame and returning, and the current frame position reaching the vicinity of the key frame position just confirmed does not count as the current frame position reaching the key frame position. For example, if the mth frame and the m+ath frame are key frames in the first scan, and the scan is reversed after the m+bth frame is scanned, when the m+cth frame is scanned, if the m+cth frame is at the same position as the m+ath frame, or is closer to the m+ath frame, then the m+cth frame is considered to have reached the key frame (m+ath frame) position; when the m+dth frame is scanned, if the m+dth frame is at the same position as the mth frame, or is closer to the mth frame, then the m+dth frame is considered to have reached the key frame (mth frame) position. Wherein, m, a, b, c, d are all positive integers, and d>c>b>a.

[0107] Among them, the intraoral scanner retrace means that the intraoral scanner first scans from the first direction to the second direction. To ensure a comprehensive scan, the intraoral scanner will scan from the second direction to the first direction, that is, perform a retrace, and the data obtained is the retrace data. If the intraoral scanner scans from the first direction to the second direction again, it is a second retrace, and the data obtained is also the retrace data. Specifically, the teeth have three surfaces, the occlusal surface, the lingual side, and the mandibular side. Figure 7 As shown, it can be the leading edge Figure 7 Scan the tongue side in the S1 direction, and then Figure 7 Scan the occlusal surface in the S2 direction, and finally Figure 7 The side of the jaw is scanned in the S3 direction. It is precisely because of this scanning method that the error superposition is in one direction, which may cause cracking and require correction.

[0108] The current frame position is near the key frame position, which means that the point cloud data corresponding to the current frame position overlaps with the key frame point cloud data after extension in the X, Y, and Z directions, and overlaps in the X and Y directions without extension. Overlap after extension means that the three-dimensional bounding box of the current frame point cloud data and the extended three-dimensional bounding box of the key frame point cloud data are determined separately. The extension can be to extend the edges of the three-dimensional bounding box by 0.2mm. For example, the coordinates of the three-dimensional bounding box are originally [xmin, ymin, zmin, xmax, ymax, zmax], and the coordinates of the three-dimensional bounding box after extension are [xmin-0.2, ymin-0.2, zmin-0.2, xmax+0.2, ymax+0.2, zmax+0.2]), and the two boxes have overlapping (intersecting) parts. Overlap without extension means that the XY two-dimensional bounding box of the current frame point cloud data and the XY two-dimensional bounding box of the key frame point cloud data are determined separately, and the two surfaces have overlapping (intersecting) parts.

[0109] S62: If yes, the overall surface is trimmed to obtain a trimmed surface and a trimmed surface.

[0110] In some embodiments, cropping the overall curved surface may include: determining a cropping start frame; and segmenting the curved surface between the cropping start frame and the current frame from the overall curved surface. The frame that last reached the key frame may be used as the cropping start frame, for example, the m+cth frame mentioned above may be used as the cropping start frame of the m+dth frame. It should be noted that although the m+cth frame mentioned above also reaches the key frame position, the boundary area of ​​the overall curved surface formed by the m+ath frame to the m+cth frame does not need to be corrected, so it may not be cropped.

[0111] For example, if the overall surface is a MC (Marching Cubes) surface (obtained from the point cloud data of each frame), after determining the cropping start frame, the surface from the cropping start frame to the current frame (for example, the surface (point cloud data) between the m+cth frame and the m+dth frame) is directly segmented using fast cropping. The cropping effect is as follows: Figure 8 As shown, the cut surface is Figure 8 The difference between the surface before and after cropping, including the surface between the m+cth frame, the m+dth frame, and the surface between the m+cth frame and the m+dth frame. To facilitate processing, a flag bit bRemove can be set, and bRemove at the position of the frame to be cropped can be set to true. The surface fusion module is modified synchronously, and bRemove judgment is added. If bRemove is true, the fusion process will not be entered.

[0112] It should be noted that if the corresponding overall surface is saved directly as the overall surface, the above-mentioned overall surface cropping refers to directly cropping the overall surface; if the corresponding overall surface is saved as the surface of each frame, the surface from the starting frame to the current frame can be directly split out.

[0113] S63, performing closure correction on the cropped surface using the current frame, and calculating the similarity before and after the closure correction.

[0114] Specifically, when the current frame in the retrace data frame reaches the key frame position, the cropped surface is cropped and the frame data corresponding to the cropped surface is used to perform closing correction on the cropped surface, which can achieve real-time correction of scanned split data, avoid the occurrence of data clearing and rescanning due to scanning errors, and save time for doctors and patients.

[0115] In some embodiments, the current frame is used to perform closure correction on the cropped surface, including: based on the scanning alignment matrix of the current frame, the point cloud data corresponding to the current frame is precisely aligned with the cropped surface (such as iterative closest point ICP precise alignment); if they match, the step of calculating the similarity before and after the closure correction is performed; if they do not match and the normal is correct, the point cloud data corresponding to the current frame and the cropped surface are coarsely aligned and precisely aligned in sequence, and if they match, the step of calculating the similarity before and after the closure correction is performed.

[0116] Among them, the scanning registration matrix of the current frame refers to the initial translation transformation matrix of the current frame obtained during the scanning process.

[0117] Specifically, the registration used in the closure correction needs to obtain the rotation and translation matrix, and then perform the closure correction. The current frame surface and the cropped overall surface are registered. During the registration, the initial translation transformation matrix of the current frame real-time scanning registration is used as the initial registration matrix, and ICP (Iterative Closest Point) precise registration is directly performed. This precise registration is more accurate than the registration during real-time scanning, which is specifically reflected in the following points:

[0118] 1) The ICP iteration convergence condition includes two aspects: one is the distance of corresponding points, and the other is the rotation and translation matrix, that is, the average distance of corresponding points fCPDistance is less than the distance threshold fD, the Euler angles α, β, γ (representing the rotation component) are less than the rotation threshold fR, and the translation TX, TY, TZ (representing the translation components in the X, Y, and Z directions, respectively) are less than the offset threshold fT, as shown in the following formula. This convergence condition is more accurate and can be performed simultaneously from the distance and the offset change of the rotation and translation matrix, with higher accuracy.

[0119]

[0120] 2) Improve the matching standard, that is, the set value in the matching determination condition should be stricter than that in real-time scanning. Among them, the determination conditions are as follows:

[0121] Condition 1: The proportion of valid point pairs is greater than Y1. A valid point pair is a point pair for which the nearest point can be found. Among them, the value of Y1 is determined according to the overlapping area of the two point cloud data. The minimum overlap is 30%-40%, that is, 0.3-0.4. A little wider range can be taken on both sides, and 0.2 < Y1 < 0.5 can be set.

[0122] Condition 2: The proportion of matched point pairs is greater than Y2. A matched point pair is a point pair in the valid point pairs whose point pair distance is less than the set threshold. Among them, the set threshold is a relatively small value, which can be taken in the range of 0.001-0.2, such as 0.005mm; 0.5 < Y2 < 0.99. For example, if Y2 is 0.8, it means 80% is matched.

[0123] Condition 3: The proportion of non-matched point pairs is less than Y3. Non-matched point pairs = valid point pairs - matched point pairs. Among them, 0.05 < Y3 < 0.4. For example, it can be taken as 0.1, which means that it is not allowed that more than 10% of the area is not matched.

[0124] In some embodiments, when the point cloud data corresponding to the current frame is precisely registered with the cropped surface and is not matched and the normal is incorrect, and / or when the point cloud data corresponding to the current frame is sequentially subjected to rough registration and precise registration with the cropped surface and is not matched, the cropped surface is used to perform surface restoration on the cropped surface.

[0125] Specifically, if the registration in the closed correction is matched, then the similarity is judged. If it is not matched and the normal is correct, then rough registration and ICP precise registration are sequentially performed; if it is not matched and the normal is incorrect, then surface restoration is directly performed, and then real-time scanning continues. Among them, surface restoration is the inverse process of the above surface cropping, and it can be to Figure 4 restore the cropped surface to the surface before cropping. It should be noted that the surface restoration here is fast surface restoration, and only the flag bit needs to be changed. According to the flag bit set during cropping, that is, the data flag bit bRemove indicating whether it has been cropped is changed from true to false, and then it enters the fusion again.

[0126] Among them, the coarse registration can be the general SAC-IA (Sample Consensus InitialAligment) coarse registration algorithm used in real-time scanning, in which SIFT key points and FPFH feature descriptors are used. If it does not match and the normal is correct, it means that the split is too large after ICP fine registration, and it is not appropriate to use the initial rotation and translation matrix of the real-time scan as the coarse registration matrix. It is necessary to perform coarse registration before ICP fine registration. If it matches, the step of calculating the similarity of the overall surface before and after the closure correction is executed; if it still does not match, the overall surface is restored.

[0127] In some examples, the normal determination method includes: rotating and translating the point cloud data corresponding to the current frame according to the rotation and translation matrix obtained by precise alignment to obtain a common area; respectively calculating the normals of the point cloud data corresponding to the current frame and the point cloud data corresponding to the common area to obtain a first normal vector and a second normal vector; when the dot product of the first normal vector and the second normal vector is less than 0, it is determined that the normal is incorrect.

[0128] Specifically, the common area refers to the area enclosed by the bounding box of the point cloud data corresponding to the current frame after rotation and translation according to the rotation and translation matrix obtained by ICP precise registration. The average normal vector is calculated for the feature points of the current frame (such as SIFT feature points) and the feature points of the common area (such as SIFT feature points). When the dot product of the two is less than 0, it is considered that the alignment was reversed. For example, the anterior tooth area is almost a plane, and it is possible that it was matched with a 180-degree reversal after ICP precise registration; for another example, because there are too few actual common areas, the lingual side and the maxillary side are matched reversely, and they are also matched with a 180-degree reversal, and the normals are opposite. These alignment results are all wrong and are not suitable for closing operations.

[0129] The SIFT feature points can be obtained by using the SIFT feature point method provided by opencv. The average normal direction can refer to the average value of the normal vectors (X, Y, Z) of all feature points obtained in the current frame and the average value of the normal vectors (X, Y, Z) of all feature points obtained in the common area.

[0130] The dot product of the first normal and the second normal is: Among them, PresentNormalX is the normal in the X direction of the point cloud data corresponding to the current frame, PresentNormalY is the normal in the Y direction of the current frame, PresentNormalZ is the normal in the Z direction of the point cloud data corresponding to the current frame, CutSurfaceNormalX is the normal in the X direction of the public area, CutSurfaceNormalY is the normal in the Y direction of the public area, and CutSurfaceNormalZ is the normal in the Z direction of the public area.

[0131] In the embodiment of the present invention, the similarity is mainly used to detect whether the overall surface is cracked before and after the closure correction and whether a merging algorithm is needed. The similarity can be obtained by using the matched rotation and translation matrix and the initial rotation and translation matrix obtained by real-time scanning.

[0132] In some embodiments, the calculation of the similarity before and after the closure correction includes: obtaining the rotation difference and the translation difference based on the rotation and translation difference obtained by precise alignment of the point cloud data corresponding to the current frame and the scanning alignment matrix of the current frame, and determining the similarity based on the rotation difference and the translation difference.

[0133] S64, if the similarity is less than the similarity threshold, performing surface restoration on the cropped surface using the cropped surface, otherwise performing surface correction on the cropped surface using the frame data corresponding to the cropped surface.

[0134] Specifically, the similarity includes rotation difference and translation difference. If the rotation difference and translation difference are both small enough (i.e., both are smaller than the difference threshold), indicating that the overall surface is not split before and after the closure correction, then it is determined that the similarity is greater than the similarity threshold, and the cropped surface is used to perform surface restoration on the cropped surface, and then real-time scanning is continued; if any of the rotation difference and translation difference is large and greater than the difference threshold, indicating that the overall surface is split before and after the closure correction, then it is determined that the similarity is less than or equal to the similarity threshold, and at this time, a merging algorithm is required to use the frame data corresponding to the cropped surface to perform surface correction on the cropped surface.

[0135] In some embodiments, the cropped surface is corrected using the frame data corresponding to the cropped surface, including: if the point cloud data corresponding to the current frame is directly matched after fine alignment, then the rotation and translation matrices of the frames between the cropping start frame and the current frame are corrected based on the rotation and translation matrix obtained by the fine alignment, and the point cloud data corresponding to the corresponding frames are fused according to the corrected rotation and translation matrix; if the point cloud data corresponding to the current frame is matched after coarse alignment and fine alignment, then the frames between the cropping start frame and the current frame are divided into multiple segments, and the rotation and translation matrices of the frames in each segment are corrected, and the point cloud data corresponding to the corresponding frames are fused according to the corrected rotation and translation matrix.

[0136] Specifically, the merging algorithm is a fusion algorithm after the rotation and translation matrix is ​​obtained in the closure correction, which mainly regenerates the overall surface. That is, the original overall surface is split, such as Fig. 9As shown in the figure, the cropped overall surface and the section from the cropping start frame to the current frame need to be re-fused. If the existing rigid registration algorithm is used, there will be a slight warping, and although the fusion can be turned into a single-layer surface, the accuracy is not high; if flexible registration is performed, the local distortion is large, and the accuracy is even more affected.

[0137] To this end, the present invention adopts the following method: if the current frame does not enter the coarse registration, it is directly finely registered, then the frames between the cropping start frame and the current frame are corrected by the rotation and translation matrix, and the rotation and translation matrix obtained after the correction is used for fusion. If the current frame enters the coarse registration and then the fine registration is used, it is considered that the error of the current frame is too large, and the value with a larger distance value of the corresponding point returned by the real-time scan can be used as a segmentation point for re-registration, that is, the section from the cropping start frame to the current frame is divided into several sections according to this point, and each section is calculated according to the correction rotation and translation matrix. In this way, local distortion can be reduced, and the warping situation can be avoided. At the same time, it is avoided that each frame is registered and calculated, so that the amount of calculation is reduced, and the speed of obtaining the final surface is improved.

[0138] In some embodiments, the rotation and translation matrix of each frame between the cropping start frame and the current frame is corrected based on the rotation and translation matrix obtained by the precise alignment, including: obtaining the change matrix of the current frame according to the rotation and translation matrix obtained by precise alignment of the point cloud data corresponding to the current frame and the scanning alignment matrix of the current frame; normalizing the change matrix of the current frame to obtain the Euler angle coefficient; determining the scale value of each frame; obtaining the change matrix of each frame according to the Euler angle coefficient and the scale value of each frame; and obtaining the corrected rotation and translation matrix of each frame according to the change matrix of each frame and the scanning alignment matrix.

[0139] Among them, determining the proportional value of each frame may include: setting the proportional value of the current frame to a first value, and the proportional value of the cropping start frame to a second value; obtaining the surface center point of the cropping start frame, the current frame, and each frame between the cropping start frame and the current frame after rotation and translation transformation by their respective scanning alignment matrices; performing curve fitting on the surface center point, and obtaining the proportional value of each frame according to the length of the curve obtained by fitting, the first value, and the second value.

[0140] Specifically, performing rotation and translation matrix correction on the point cloud data corresponding to each frame includes:

[0141] 1) Obtain the change matrix of the point cloud data corresponding to the current frame using the following formula:

[0142] Δ matrix = New matrix * Old matrix ′

[0143] Among them, the Δ matrix is ​​the change matrix of the point cloud data corresponding to the current frame, the New matrix is ​​the rotation and translation matrix obtained by the precise registration of the point cloud data corresponding to the current frame, and the Old matrix ' is the scanning registration matrix of the point cloud data corresponding to the current frame.

[0144] 2) Normalize the change matrix of the point cloud data corresponding to the current frame to obtain the Euler angle coefficients in the three directions of XYZ. The calculation formula is as follows:

[0145]

[0146]

[0147] 3) Path fitting and calculation of the scale value fScale of each frame. The default fScale of the current frame is 1, the fScale of the cropping start frame is 0, and the rest are values ​​between 0 and 1 according to the fitting curve. Specifically, the center point of the surface after real-time scanning, rotation and translation transformation of each frame from the cropping start frame to the current frame is obtained, and then each surface center point is fitted into a curve, and fScale is calculated according to the length of the curve, that is, the scale value fScale of each frame is the ratio of the length from the corresponding surface center point on the fitting curve to the cropping start frame to the total length of the curve.

[0148] 4) Obtain the change matrix of each frame according to the ratio value of each frame, as follows:

[0149] Δ(0,0)=cos(α*fScale)*cos(β*fScale)

[0150] Δ(0,1)=cos(α*fScale)*sin(β*fScale)*sin(γ*fScale)-sin(α*fScale)*cos(γ*fScale)

[0151] Δ(0,2)=cos(α*fScale)*sin(β*fScale)*cos(γ*fScale)+sin(α*fScale)*sin(γ*fScale)

[0152] Δ(0,3)=x*fScale

[0153] Δ(1,0)=sin(α*fScale)*cos(β*fScale)

[0154] Δ(1,1)=sin(α*fScale)*sin(β*fScale)*sin(γ*fScale)+cos(α*fScale)*cos(γ*fScale)

[0155] Δ(1,2)=sin(α*fScale)*sin(β*fScale)*cos(γ*fScale)-cos(α*fScale)*sin(γ*fScale)

[0156] Δ(1,3)=y*fScale

[0157] Δ(2,0)=-sin(β*fScale)

[0158] Δ(2,1)=cos(β*fScale)*sin(γ*fScale)

[0159] Δ(2,2)=cos(β*fScale)*cos(γ*fScale)

[0160] Δ(2,3)=z*fScale

[0161] Δ(3,0)=0

[0162] Δ(3,1)=0

[0163] Δ(3,2)=0

[0164] Δ(3,3)=1

[0165] Among them, Δ(0,0)~Δ(3,3) is the 4*4 rotation and translation matrix corresponding to the transformation matrix.

[0166] 5) Each frame is fused according to the new rotation and translation matrix, where the new rotation and translation matrix New matrix of each frame is equal to the multiplication of the transformation matrix of each frame and the scanning registration matrix.

[0167] At the same time, TSDF color correction is performed during fusion, and color areas that are too dark (too poor contrast) or too bright (possibly reflective) are not fused into the overall surface to improve fusion accuracy.

[0168] Another embodiment is described below, in which key frame acquisition and related data processing are performed in the following manner:

[0169] 1. Keyframe position setting

[0170] Use a rectangular grid envelope for the entire dental arch data, take the frames with the minimum and maximum values ​​in the X, Y, and Z directions in the envelope grid as key frames, and get six key frames. Since the initial frame has undergone stability judgment and has a high accuracy, the initial frame is taken as the seventh key frame. Among them, the stability judgment means that if the center distances of N consecutive frames are less than the threshold, and the returned alignment results are higher than the preset accuracy, the initial frame is considered to be stable and is a valid initial frame, otherwise the data is cleared and rescanned until the initial frame is stable. Optionally, the overall point cloud feature points and feature histogram descriptors of a certain number of frames before and after the key frame can be selected as the feature points and feature histogram descriptors of the seven key frame positions, and updated in real time.

[0171] Regarding the update, it is not always on, but needs to be turned off when certain conditions are met. The purpose of doing this is, first, to reduce the amount of calculation and avoid turning on the update for each frame, and second, to avoid treating the wrong frame, i.e. the split frame, as a key frame and avoid making corrections based on the wrong frame, because making corrections based on the wrong frame will only make it more distorted.

[0172] The specific steps are as follows:

[0173] (1) The first frame is updated by default.

[0174] (2) Determine when to turn off the update from the spatial position. Fit the scan path, first take the center point of each frame, then perform plane fitting and project each point, and perform curve fitting on the projected point. The line connecting the endpoints of the curve is the direction of the X coordinate axis of the world coordinate system, and the direction perpendicular to the fitting plane is the direction of the Z coordinate axis of the world coordinate system. If the X size of the current frame bounding box is greater than the X size of the previous frame bounding box plus Δx (X direction offset threshold, such as 20), or if the Y size of the current frame bounding box is greater than the Y size of the previous frame bounding box plus Δy (y direction offset threshold, such as 20), then turn on the update, otherwise turn off the update.

[0175] (3) Determine when to turn off the update based on the time position. If the current frame number is greater than the regression frame plus the frame number threshold Δf, such as 40-50, then turn off the update. The regression frame position is the frame position after scanning half of the jaw and then retracement, and the regression frame position is also updated in real time.

[0176] When the update is turned on, determine whether the maximum and minimum positions of X, Y, and Z of the current frame and the six key frames move more than ΔK, such as 20-50. If any of them exceeds, the current frame is updated to that key frame, and the number of updates is recorded.

[0177] The regression frame position calculation mentioned in this embodiment is as follows: First, the current frame is not a key frame. Then, if the update number of KeyXMin (the key frame with the minimum X position) is more than KeyXMax, and the size of the bounding box in the X direction is greater than SX (the minimum size threshold in the X direction), if the X center of the current frame is less than the average of the maximum X value of KeyXMax and the minimum X value of KeyXMin, when the regression frame has no value, update the current frame to the regression frame, and record the corresponding KeyXMin key frame of the regression frame; when the regression frame has a value, if KeyXMin changes, update the current frame to the regression frame. If the update number of KeyXMax is more than KeyXMin, and the size of the bounding box in the X direction is greater than SX, if the X center of the current frame is greater than the average of the maximum X value of KeyXMax and the minimum X value of KeyXMin, when the regression frame has no value, update the current frame to the regression frame, and record the corresponding KeyXMax key frame of the regression frame; when the regression frame has a value, if KeyXMax changes, update the current frame to the regression frame.

[0178] 2. Judgment

[0179] Determine whether the current frame position reaches the key frame position. Specifically, the conditions for starting the split algorithm are: first, the current frame is near the key frame. The judgment method for whether it is near is: the current frame overlaps with the key frame after the XYZ three-direction extension, and does not overlap in the XY direction without extension, and it is scanned past the key frame and then returns. The key frame that has just been confirmed is not counted, that is, there is a situation where the current frame is not near the key frame and then enters the key frame area.

[0180] 3. Cutting

[0181] Determine the start frame of the cropped surface. The latest frame that passes the previous key frame position is used as the start frame of the cropped surface. The overall point cloud is cropped, that is, the surface from the start frame of the cropped surface to the current frame is cropped. For example, for MC surfaces, fast cropping can be used. A flag bit bRemove can be set, and bRemove at the position to be cropped is set to true. The surface fusion module is modified synchronously, and bRemove judgment is added. If bRemove is true, fusion will not be performed.

[0182] It should be noted that what can be saved all the time is the overall surface, so the overall surface needs to be cropped to achieve the purpose of surface segmentation. If the surface of each frame is saved, the segmentation can be performed directly.

[0183] 4. Registration

[0184] This registration is the one used in closed-loop calibration. It is necessary to obtain the rotation and translation matrix for closed-loop calibration through registration and then perform closed-loop calibration. The current frame is registered with the overall surface after surface segmentation. During registration, rough registration is not performed first. Instead, the matrix obtained from the real-time scan registration of the current frame is directly used as the matrix for rough registration, and then ICP fine registration is directly carried out. This fine registration needs to be more accurate than real-time scan, which is reflected in the following aspects:

[0185] (1) The ICP iteration convergence condition is carried out from two aspects. One is the distance between corresponding points, and the other is the rotation and translation matrix, that is, simultaneously satisfying that the average distance fCPDistance of corresponding points is less than the distance threshold fD, the Euler angles α, β, γ of rotation (representing the rotation component) are less than the rotation threshold fR, and the translations TX, TY, TZ (representing the translation components in the XYZ three directions) are less than the offset threshold fT. This convergence condition is more accurate and can be carried out simultaneously from both the distance aspect and the offset change amount of the rotation and translation matrix, with higher accuracy.

[0186]

[0187] (2) The standard for determining whether registration is successful is improved, that is, the set value for successful registration should be more stringent than that of real-time scan.

[0188] The following are the conditions for successful registration, and the specific set values (Y1, Y2, Y3) of the conditions are more stringent. The determination conditions simultaneously satisfy the following conditions:

[0189] A. The ratio of the number of valid point pairs to the total number of points in the point cloud [P] is greater than Y1. A valid point pair means a point pair for which the nearest point can be found. When projecting to find the nearest point, there may be a situation where none of the projected points fall on the triangular mesh, and in this case, no corresponding point can be found, which is an invalid point pair. 0.2 < Y1 < 0.5, which is determined according to the overlapping area of the two point clouds. The minimum overlap is 30% - 40%, that is, 0.3 - 0.4, and a slightly wider range is taken on both sides.

[0190] B. The ratio of the number of registered point pairs to the number of valid point pairs is greater than Y2. A registered point pair means that the distance between the point pair is less than a small value of the set threshold, indicating a point pair that is very closely matched. The range of the threshold can be set from 0.001 - 0.2, and the setting range of Y2 is 0.5 < Y2 < 0.99.

[0191] C. The ratio of the number of non-registered point pairs to the total number of points in the point cloud [P] is less than Y3. The number of non-registered point pairs = the number of valid point pairs - the number of registered point pairs. 0.05 < Y3 < 0.4. For example, if the value is 0.2, it means that no more than 20% of the area can be unregistered. The larger the value of Y2, the more accurate it is, but some well-matched point clouds will be removed. Therefore, a smaller value can be set, such as 70% - 80%, but this will increase the number of non-registered point pairs to prevent the value of the first point from being very large. If it is 100% for all, and the value of the second point is very small but still satisfies, that is 80%, in this case, if the surface is not good, the third condition will not be satisfied.

[0192] If they match, proceed to the next step of similarity judgment. If they do not match and the normal is correct, proceed to coarse registration (coarse registration is the general SAC coarse registration algorithm used for real-time scanning, which uses SIFT key points and FPFH feature descriptors) plus the fine registration in this embodiment. In this case, the crack is too large, and it is inappropriate to use the rotation and translation matrix of the real-time scan as the coarse registration matrix. Normal coarse registration is required before entering this step. If the normal is incorrect, surface recovery is performed directly and real-time scanning continues.

[0193] Normal judgment: Rotate and translate the current frame according to the obtained rotation and translation matrix, then select the common area of ​​the segmented surface, and calculate the average normal vector of the SIFT feature points of the current frame and the feature points of the common area. When the dot product of the two is less than 0, it is considered that the matching is reversed. For example, the front tooth area is almost a plane, and it is possible that it is matched by 180 degrees after ICP, or because there are too few actual common areas, the lingual side and the jaw side are matched reversely, and they are also matched by 180 degrees. The normal is opposite, and these matching results are wrong. These positions are not suitable for splitting operations whether they are too flat (lack of feature points) or have too few overlapping common areas.

[0194] 5. Surface recovery

[0195] Surface restoration is the reverse process of the surface clipping above. Here, fast surface restoration is also used. You only need to change the flag bit. According to the flag bit set during clipping, that is, whether it has been clipped (bRemove), change the clipped data flag bit to true. This position enters fusion again.

[0196] 6. Similarity judgment

[0197] The similarity judgment is mainly to detect whether the surface is cracked and whether a merging algorithm is needed. This is done after the aforementioned registration in this embodiment. The rotation and translation matrix after registration and the rotation and translation matrix obtained by real-time scanning are used for similarity judgment, mainly to judge whether the changes in the rotation difference and the translation difference are small enough. If they are small enough, it means there is no crack, then enter the previous step of surface recovery and continue real-time scanning, otherwise, it is considered to be cracked and enter the merging algorithm.

[0198] 7. Merge Algorithm

[0199] The merging algorithm is a fusion algorithm after obtaining the rotation and translation matrix in the closure correction. It mainly regenerates the overall surface. The original overall surface is split, and it is necessary to reintegrate the segmented surface and the section from the cropping start frame to the current frame. If the existing rigid registration algorithm is used, there will be a slight warping. Although it can be turned into a single-layer surface after fusion, the accuracy is not high. If flexible registration is performed, the local distortion is large and the accuracy is even more affected. The method adopted in this embodiment is the path fitting method. First, it is a rigid registration, and there is no large local distortion. Secondly, it avoids the warping. Thirdly, it avoids the calculation of registration for each frame, which greatly reduces the amount of calculation and improves the speed. The details are as follows:

[0200] If the coarse registration is not entered and the fine registration is performed directly, the rotation and translation matrices of each frame from the cropping start frame to the current frame are corrected and fused according to the corrected rotation and translation matrix. The rotation and translation matrix correction algorithm is shown in the next step. For the coarse registration and then the fine registration, if the data error is too large, it is necessary to add a step to the above steps, that is, take the larger value of the corresponding point distance returned by the real-time scan as the segmentation point, and perform re-registration, that is, divide the section from the cropping start frame to the current frame into several sections according to these points, and calculate each section according to the corrected rotation and translation matrix.

[0201] 8. Rotation and translation matrix correction

[0202] The rotation and translation matrix correction is used in the above merging algorithm, which is described as follows:

[0203] (1) Obtain the change matrix - Δ matrix, which is equal to the New matrix of the split registration multiplied by the inverse matrix of the Old matrix of the current frame in the real-time scanning process.

[0204] Δ matrix = New matrix * Old matrix ′

[0205] (2) Calculate the normalized XYZ Euler angle coefficients of the Δ matrix. The calculation formula is as follows:

[0206]

[0207]

[0208] (3) Path fitting and calculation of the scale value fScale of each frame. The default fScale of the current frame is between 0 and 1, the fScale of the cropping start frame is between 0 and 0.5, and the rest are between 0 and 1 according to the fitting curve. Specifically, the center point of the surface after real-time scanning rotation and translation transformation of each frame from the cropping start frame to the current frame is obtained, and then each point is fitted into a curve, and fScale is calculated based on the length of the curve, that is, the ratio of the length from the point on the curve to the cropping start frame to the total length of the curve.

[0209] (4) According to the proportional value of each frame, the transformation matrix of each frame is as follows:

[0210] Δ(0,0)=cos(α*fScale)*cos(β*fScale)

[0211] Δ(0,1)=cos(α*fScale)*sin(β*fScale)*sin(γ*fScale)-sin(α*fScale)*cos(γ*fScale)

[0212] Δ(0,2)=cos(α*fScale)*sin(β*fScale)*cos(γ*fScale)+sin(α*fScale)*sin(γ*fScale)

[0213] Δ(0,3)=x*fScale

[0214] Δ(1,0)=sin(α*fScale)*cos(β*fScale)

[0215] Δ(1,1)=sin(α*fScale)*sin(β*fScale)*sin(γ*fScale)+cos(α*fScale)*cos(γ*fScale)

[0216] Δ(1,2)=sin(α*fScale)*sin(β*fScale)*cos(γ*fScale)-cos(α*fScale)*sin(γ*fScale)

[0217] Δ(1,3)=y*fScale

[0218] Δ(2,0)=-sin(β*fScale)

[0219] Δ(2,1)=cos(β*fScale)*sin(γ*fScale)

[0220] Δ(2,2)=cos(β*fScale)*cos(γ*fScale)

[0221] Δ(2,3)=z*fScale

[0222] Δ(3,0)=0

[0223] Δ(3,1)=0

[0224] Δ(3,2)=0

[0225] Δ(3,3)=1

[0226] (5) Each frame is fused according to the new rotation and translation matrix. The new rotation and translation matrix is ​​the multiplication of the transformation matrix of each frame and the real-time scanning matrix, that is, the old matrix. TSDF color correction is performed during fusion. Color areas that are too dark (too poor contrast) or too bright (possibly reflective) are not fused into the overall surface. This step can effectively improve the accuracy.

[0227] Fig.10 It is a structural block diagram of a data registration and fusion device according to an embodiment of the present invention.

[0228] like Fig.10 As shown, the data registration and fusion device 900 includes: a processor 901 and a memory 903. The processor 901 and the memory 903 are connected, such as through a bus 902. Optionally, the data registration and fusion device 900 may also include a transceiver 904. It should be noted that in actual applications, the transceiver 904 is not limited to one, and the structure of the data registration and fusion device 900 does not constitute a limitation on the embodiment of the present invention.

[0229] Processor 901 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the present invention. Processor 901 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0230] The bus 902 may include a path to transmit information between the above components. The bus 902 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 902 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0231] The memory 903 is used to store a computer program corresponding to the data processing method of the above embodiment of the present invention, and the computer program is controlled and executed by the processor 901. The processor 901 is used to execute the computer program stored in the memory 903 to implement the content shown in the above method embodiment.

[0232] Fig.10 The data registration and fusion device 900 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0233] Fig.11 It is a structural block diagram of a medical imaging device according to an embodiment of the present invention.

[0234] like Fig.11 As shown, the medical imaging device 1000 includes the data registration and fusion device 900 of the above embodiment.

[0235] In summary, the data processing method, device and medical imaging equipment of the embodiments of the present invention perform overall surface cropping based on key frames, and use the frame data corresponding to the cropped surface to correct the cropped surface, thereby improving the accuracy of data registration and the data fusion effect. There is no need to align each frame of data (i.e., the point cloud data corresponding to each frame), so the computational complexity is low and the fusion speed is fast.

[0236] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0237] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0238] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0239] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0240] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0241] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0242] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.

[0243] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A data processing method, characterized in that: The method comprises: Determine whether the current frame position in the retrace data frame reaches the key frame position; If yes, the overall surface is clipped to obtain a clipped surface and a clipped surface; Performing closure correction on the cropped curved surface using the current frame, and calculating the similarity before and after the closure correction; If the similarity is greater than the similarity threshold, the cropped surface is used to perform surface restoration on the cropped surface; otherwise, the cropped surface is corrected using the frame data corresponding to the cropped surface.

2. The data processing method according to claim 1, characterized in that: The clipping of the overall surface includes: Determine the cropping start frame; The curved surface between the cropping start frame and the current frame is separated from the overall curved surface.

3. The data processing method according to claim 2, characterized in that: The step of determining the cropping start frame comprises: The frame that reaches the key frame last time is used as the cropping start frame.

4. The data processing method according to claim 2, characterized in that: The using the current frame to perform closure correction on the cropped curved surface includes: Based on the scanning registration matrix of the current frame, accurately aligning the point cloud data corresponding to the current frame with the cropped surface; If it matches, then the step of calculating the similarity before and after the closure correction is performed; If they are not matched and the normal is correct, then after the point cloud data corresponding to the current frame and the cropped surface are coarsely and finely aligned in sequence and matched, the step of calculating the similarity before and after the closure correction is performed.

5. The data processing method according to claim 4, characterized in that: The method further comprises: When the point cloud data corresponding to the current frame is precisely aligned with the cropped surface and fails to match and the normal is incorrect, and / or when the point cloud data corresponding to the current frame is coarsely and precisely aligned with the cropped surface in sequence and fails to match, the cropped surface is used to perform surface restoration on the cropped surface.

6. The data processing method according to claim 4 or 5, characterized in that: Normal direction determination methods include: Rotate and translate the point cloud data corresponding to the current frame according to the rotation and translation matrix obtained by precise registration to obtain a common area; Respectively calculating the normals of the point cloud data corresponding to the current frame and the point cloud data corresponding to the common area to obtain a first normal vector and a second normal vector; When the dot product of the first normal vector and the second normal vector is less than 0, it is determined that the normal is incorrect.

7. The data processing method according to claim 4 or 5, characterized in that: The calculating the similarity before and after the closure correction includes: Obtaining a rotation difference and a translation difference according to a rotation and translation matrix obtained by precise registration of the point cloud data corresponding to the current frame and a scanning registration matrix of the current frame, and determining the similarity according to the rotation difference and the translation difference; If both the rotation difference and the translation difference are smaller than the difference threshold, it is determined that the similarity is greater than the similarity threshold; otherwise, it is determined that the similarity is less than or equal to the similarity threshold.

8. The data processing method according to claim 4 or 5, characterized in that: The using the frame data corresponding to the cropped curved surface to perform curved surface correction on the cropped curved surface comprises: If the point cloud data corresponding to the current frame is directly matched after precise registration, the rotation and translation matrix of each frame between the cropping start frame and the current frame is corrected based on the rotation and translation matrix obtained by the precise registration, and the point cloud data corresponding to the corresponding frames are fused according to the corrected rotation and translation matrix; If the point cloud data corresponding to the current frame is matched after coarse alignment and fine alignment, the frame between the cropping start frame and the current frame is divided into multiple segments, and the rotation and translation matrix is ​​corrected for each frame in each segment, and the point cloud data corresponding to the corresponding frames are fused according to the corrected rotation and translation matrix.

9. The data processing method according to claim 8, characterized in that: The correction of the rotation and translation matrix of each frame between the cropping start frame and the current frame based on the rotation and translation matrix obtained by the precise registration includes: Obtaining a change matrix of the current frame according to a rotation and translation matrix obtained by precise registration of the point cloud data corresponding to the current frame and a scanning registration matrix of the current frame; Normalizing the change matrix of the current frame to obtain Euler angle coefficients; Determine the scale value of each frame; According to the Euler angle coefficient and the ratio value of each frame, a change matrix of each frame is obtained; The corrected rotation and translation matrix of each frame is obtained according to the change matrix of each frame and the scanning registration matrix.

10. The data processing method according to claim 9, characterized in that: Determining the ratio value of each frame includes: Set the ratio value of the current frame to a first value, and the ratio value of the cropping start frame to a second value; Obtaining the center points of the surfaces of the cropping start frame, the current frame, and each frame between the cropping start frame and the current frame after being rotated and translated by their respective scanning registration matrices; A curve fitting is performed on the center point of the curved surface, and a ratio value of each frame is obtained according to the length of the curve obtained by fitting, the first value, and the second value.

11. A data registration and fusion device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 10 is implemented.

12. A medical imaging device, characterized in that: It comprises the data registration and fusion device as described in claim 11.

Citation Information

Patent Citations

  • Method for realizing Z-pin implantation on complex curved surface

    CN111583309A

  • Data processing method, point cloud data registration method and device and intraoral scanning equipment

    CN114693751A

  • Point cloud data processing method, registration device and intraoral scanning equipment

    CN114693881A

  • Robot operation track generation method based on complex grid curved surface NURBS fitting

    CN114708402A

  • Tooth segmentation method, tooth surface data acquisition method and oral CT equipment

    CN115272359A