Three-dimensional model data compression method and device, three-dimensional model data decompression method and device and electronic equipment
By dividing the three-dimensional model data into multiple segmented blocks and compressing the data based on voxel values and consecutive occurrence numbers, the problem of the three-dimensional model data occupying a large amount of storage space is solved, and efficient storage compression is achieved.
Patent Information
- Application Number
- CN202311624252.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
Due to its three-dimensional data information characteristics, three-dimensional model data occupies a large amount of storage space, and existing storage methods are inefficient.
The three-dimensional model data is compressed by dividing the three-dimensional model data into multiple segmented blocks, and based on the voxel value in each segmented block and the number of voxel values that appear continuously, the data pair corresponding to the voxel value is determined, thereby compressing the three-dimensional model data.
It effectively reduces the storage space required for three-dimensional model data, makes full use of the same-value neighborhood for data compression, and improves storage efficiency.
Smart Images

Figure CN120070605A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and more particularly to a method for compressing three-dimensional model data, a method for decompressing three-dimensional model data, a device for compressing three-dimensional model data, a device for decompressing three-dimensional model data, an electronic device, and a storage medium. Background Art
[0002] Three-dimensional model data can represent the three-dimensional information of an object and is applied in many technical fields. For example, in the field of ultrasonic imaging, it is often necessary to store a large amount of three-dimensional model data obtained by ultrasonic imaging on a hardware device. Currently, the commonly used storage method is to directly store the entire three-dimensional model data into the hardware device after applying for a continuous storage space in the hardware storage space.
[0003] However, since three-dimensional model data has data information in three dimensions, it will surely occupy a large amount of storage space. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed. The present application provides a method for compressing three-dimensional model data, a method for decompressing three-dimensional model data, a device for compressing three-dimensional model data, a device for decompressing three-dimensional model data, an electronic device, and a storage medium.
[0005] According to one aspect of the present invention, a method for compressing three-dimensional model data is provided, including: dividing the three-dimensional model data to be compressed into multiple divided blocks; for each divided block, determining data pairs corresponding to respective voxel values based on the voxel values of the voxels in the divided block and the number of consecutive occurrences of each voxel value, and determining the compressed three-dimensional model data based on the data pairs.
[0006] Exemplarily, determining data pairs corresponding to respective voxel values based on the voxel values of the voxels in the divided block and the number of consecutive occurrences of each voxel value includes: traversing the voxel values of all voxels in the divided block, and when the current voxel value is the same as the next adjacent voxel value, incrementing the number of consecutive occurrences of the current voxel value until the current voxel value is different from the next adjacent voxel value, so as to obtain the number of consecutive occurrences of the current voxel value, and determining the number of consecutive occurrences and the current voxel value as the data pair corresponding to the current voxel value.
[0007] Exemplarily, determining the compressed three-dimensional model data based on the data pairs includes: counting the number of the determined data pairs; storing the number of data pairs and all the data pairs as the compressed three-dimensional model data.
[0008] Exemplarily, dividing the three-dimensional model data to be compressed into multiple divided blocks includes: evenly dividing the three-dimensional model data to be compressed into multiple divided blocks.
[0009] Exemplarily, before dividing the three-dimensional model data to be compressed into multiple divided blocks, the compression method further includes: obtaining target three-dimensional model data; determining padding sizes in three dimensions respectively according to the sizes of the target three-dimensional model data in the three dimensions and the preset sizes of the divided blocks, where the padding sizes are used to pad the target three-dimensional model data into the three-dimensional model data to be compressed, and the sizes of the three-dimensional model data to be compressed in the three dimensions are integer multiples of the preset sizes of the divided blocks in the three dimensions respectively; padding the target three-dimensional model data according to the determined padding sizes in the three dimensions to generate the three-dimensional model data to be compressed.
[0010] Exemplarily, determining the padding sizes in three dimensions respectively required to pad the target three-dimensional model data into the three-dimensional model data to be compressed according to the sizes of the target three-dimensional model data and the divided blocks in the three dimensions respectively includes: in any dimension, taking the remainder of the size of the target three-dimensional model data in this dimension divided by the preset size of the divided block in this dimension; for the case where the remainder is 0, determining the padding size in this dimension as 0; for the case where the remainder is not 0, determining the padding size in this dimension as the difference between the preset size of the divided block in this dimension and the remainder.
[0011] Exemplarily, the three-dimensional model data to be compressed is three-dimensional ultrasonic imaging data.
[0012] Exemplarily, the compression method further includes: in response to a cropping operation by the user, determining the voxel values of the three-dimensional ultrasonic imaging data; where the voxel values corresponding to each cropping operation are the same voxel value, and this same voxel value is the same as the voxel value of the background part, and the voxel values corresponding to different cropping operations are different voxel values.
[0013] Exemplarily, the compression method further includes: performing target recognition on the three-dimensional ultrasonic imaging data, and determining the voxel values of the three-dimensional ultrasonic imaging data based on the recognized targets; where the voxel values of each recognized target are the same voxel value, and this same voxel value is different from the voxel value of the background part, and the voxel values of different recognized targets are different voxel values.
[0014] According to another aspect of the present invention, there is also provided a method for decompressing three-dimensional model data. The three-dimensional model data to be decompressed includes a plurality of data groups, each data group includes at least one data pair, each data pair includes information of the voxel value corresponding to the data pair and information of the number of consecutive occurrences of the voxel value, and each data group corresponds to a preset number of voxel values. The decompression method includes: for each data group in the three-dimensional model data to be decompressed, based on the voxel value corresponding to each data pair in the data group and the number of consecutive occurrences of the voxel value, determining the decompressed block data of the data group; splicing the decompressed block data of each data group to obtain the decompressed three-dimensional model data.
[0015] Exemplarily, each data group further includes information of the number of data pairs in the data group. Based on the voxel value corresponding to each data pair in the data group and the number of consecutive occurrences of the voxel value, determining the decompressed block data of the data group includes: based on the number of data pairs in the data group, traversing each data pair in the data group, and for each data pair, decompressing the voxel value corresponding to the number of consecutive occurrences into the decompressed block data of the data group.
[0016] Exemplarily, the number of voxel values corresponding to all data groups is the same.
[0017] According to yet another aspect of the present invention, there is also provided a compression device for three-dimensional model data, including: a segmentation module for segmenting the three-dimensional model data to be compressed into a plurality of segmented blocks; a compression module for, for each segmented block, based on the voxel values of the voxels in the segmented block and the number of consecutive occurrences of each voxel value, determining data pairs corresponding to each voxel value respectively, and based on the data pairs, determining the compressed three-dimensional model data.
[0018] According to yet another aspect of the present invention, there is also provided a decompression device for three-dimensional model data. The three-dimensional model data to be decompressed includes a plurality of data groups, each data group includes at least one data pair, each data pair includes information of the voxel value corresponding to the data pair and information of the number of consecutive occurrences of the voxel value, and each data group corresponds to a preset number of voxel values; the decompression device includes: a decompression module for, for each data group in the three-dimensional model data to be decompressed, based on the voxel value corresponding to each data pair in the data group and the number of consecutive occurrences of the voxel value, determining the decompressed block data of the data group; a splicing module for splicing the decompressed block data of each data group to obtain the decompressed three-dimensional model data.
[0019] According to yet another aspect of the present invention, there is also provided an electronic device, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are run by the processor, they are used to execute the above-mentioned compression method of three-dimensional model data and / or the above-mentioned decompression method of three-dimensional model data.
[0020] According to another aspect of the present invention, there is also provided a storage medium, on which program instructions are stored, and the program instructions are used to execute the above-mentioned three-dimensional model data compression method and / or the above-mentioned three-dimensional model data decompression method when running.
[0021] In the above technical solution, first, the three-dimensional model data is divided into multiple divided blocks, and then data pairs are formed according to the voxel values in the divided blocks and the number of adjacent voxels with the same voxel values to obtain the compressed three-dimensional model data. In short, this solution can preferably compress the three-dimensional model data of voxels with the same voxel values, minimizing the storage space occupied by the compressed data. This fully utilizes the homogeneous neighborhood in the three-dimensional model data for data compression, effectively reducing the storage space required for the three-dimensional model data.
[0022] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other objects, features and advantages of the present invention more obvious and understandable, the following specifically illustrates the specific embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] By describing the embodiments of the present invention in more detail in conjunction with the drawings, the above and other objects, features and advantages of the present invention will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings, the same reference numerals generally represent the same components or steps.
[0024] Figure 1 Shows a schematic diagram of three-dimensional model data according to an embodiment of the present application;
[0025] Figure 2 Shows a schematic diagram of the storage space of three-dimensional model data in the related art;
[0026] Figure 3 Shows a schematic diagram of the three-dimensional ultrasound imaging data of a fetus's body-scissored according to an embodiment of the present application;
[0027] Figure 4 Shows a schematic diagram of the three-dimensional ultrasound imaging data of a female follicle according to an embodiment of the present application;
[0028] Figure 5 Shows a schematic flowchart of the three-dimensional model data compression method according to an embodiment of the present application;
[0029] Figure 6Shows a schematic diagram of the uniform segmentation of three-dimensional model data according to an embodiment of the present application;
[0030] Figure 7 Shows a schematic flowchart of a compression method for segmented blocks in three-dimensional model data according to an embodiment of the present application;
[0031] Figure 8 Shows a schematic diagram of the storage space of compressed three-dimensional model data according to an embodiment of the present application;
[0032] Figure 9 Shows a schematic flowchart of generating three-dimensional model data to be compressed according to another embodiment of the present application;
[0033] Figure 10 Shows a schematic diagram of mapping pixels on the screen to three-dimensional model data according to an embodiment of the present application;
[0034] Figure 11 Shows a schematic diagram of mapping a marked area on the screen to a marked area of three-dimensional model data according to an embodiment of the present application;
[0035] Figure 12a Shows a schematic diagram of three-dimensional ultrasonic imaging data without any cropping according to an embodiment of the present application;
[0036] Figure 12b Shows a schematic diagram of three-dimensional ultrasonic imaging data after 3 times of cropping according to an embodiment of the present application;
[0037] Figure 12c Shows a schematic diagram of three-dimensional ultrasonic imaging data after 10 times of cropping according to an embodiment of the present application;
[0038] Figure 12d Shows a schematic diagram of three-dimensional ultrasonic imaging data after 15 times of cropping according to an embodiment of the present application;
[0039] Figure 13 Shows a schematic flowchart of a decompression method for data groups in three-dimensional model data according to an embodiment of the present application;
[0040] Figure 14 Shows a schematic block diagram of a compression device for three-dimensional model data according to an embodiment of the present application;
[0041] Figure 15 Shows a schematic block diagram of a decompression device for three-dimensional model data according to an embodiment of the present application;
[0042] Figure 16 Shows a schematic block diagram of an electronic device according to an embodiment of the present application. Detailed Implementation Manner
[0043] In order to make the objectives, technical solutions, and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments of the present invention. It should be understood that the present invention is not limited by the exemplary embodiments described herein. Based on the embodiments of the present invention described herein, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
[0044] Figure 1 A schematic diagram of three-dimensional model data is shown. Figure 2 It shows the related art Figure 1 A schematic diagram of the storage space of the three-dimensional model data shown. As Figure 1 shown, the dimensions of the three-dimensional model data in the X-axis, Y-axis, and Z-axis directions are xSize, ySize, and zSize respectively. In the related art, a storage space with a length of xSize * ySize * zSize is applied for on the memory. As Figure 2 shown, the entire three-dimensional model data includes zSize slices. Each slice includes ySize lines. Each line includes xSize dots, that is, voxels. A voxel is the smallest information unit for the segmentation of three-dimensional model data in three-dimensional space. Each voxel has a voxel value, which represents the data information of the three-dimensional model data at the position where the voxel is located. For any voxel with coordinates (x, y, z) in the three-dimensional model data, its position offset relative to the starting address of the storage space is equal to z * ySize * xSize + y * xSize + x. It can be seen that the three-dimensional model data in the related art requires a large storage space to store.
[0045] In many actual application scenarios, there is a high probability that the voxel values of adjacent voxels in the three-dimensional model data are equal. For example, for the three-dimensional model data obtained by three-dimensional ultrasonic imaging, the entire three-dimensional model data is often divided into multiple regions according to a certain characteristic, and then different marker bits are used to mark each region. Therefore, there are multiple regions in the marked three-dimensional model data where the voxel values of the voxels are equal. Specifically, for example, the three-dimensional ultrasonic imaging data after three-dimensional body cutting. Figure 3 It shows the three-dimensional ultrasonic imaging data of a fetus after body cutting according to an embodiment of the present application. As Figure 3As shown, the three-dimensional ultrasound imaging data of the fetus is marked 4 times. In the 4 marked regions, the voxel values of the voxels in each region are equal; in the remaining unmarked regions of the three-dimensional ultrasound imaging data of the fetus, the voxel values of all voxels are equal; in the background region of the three-dimensional ultrasound imaging data (i.e., the background region around the fetus), the voxel values of all voxels are equal. Figure 4 Shows three-dimensional ultrasound imaging data of a female follicle according to an embodiment of the present application. As Figure 4 shown, n follicles in a female ovary can be respectively marked with numbers 1 to n. The non-follicle regions can be marked as 0. Similarly, the marked three-dimensional ultrasound imaging data includes multiple regions where the voxel values of the voxels therein are respectively equal.
[0046] For three-dimensional model data with adjacent voxels having many equal voxel values, based on this feature, fewer data can be used to represent the voxel values of these voxels, thereby achieving the effect of compressing the three-dimensional model data.
[0047] According to one aspect of the present invention, a method for compressing three-dimensional model data is provided. Figure 5 Shows a schematic flowchart of a method for compressing three-dimensional model data according to an embodiment of the present application. As Figure 5 shown, the compression method includes the following steps S510 and step S520.
[0048] Step S510: Divide the three-dimensional model data to be compressed into multiple divided blocks.
[0049] In this step, the three-dimensional model data can be divided from one or more dimensions according to the dimensions of the three-dimensional model data in three dimensions. For example, assuming that the dimension of the three-dimensional model data in the X direction is large, while the dimensions in the Y direction and the Z direction are small, that is, the three-dimensional model data represents an elongated object, then the three-dimensional model data can be divided only in the X direction. Assuming that the dimensions of the three-dimensional model data in the X direction and the Y direction are both large, while the dimension in the Z direction is small, that is, the three-dimensional model data represents a thin sheet-like object, then the three-dimensional model data can be divided in the X direction and the Y direction. Alternatively, the three-dimensional model data can also be divided in three dimensions.
[0050] Exemplarily, the three-dimensional model data can be evenly divided. In other words, the sizes of the multiple divided blocks obtained by the division are exactly the same. Alternatively, the three-dimensional model data can also be divided unevenly according to requirements. It can be understood that in some application scenarios, the distribution of adjacent voxels with the same voxel value in the three-dimensional model data can be different. The three-dimensional model data can be divided according to the distribution of adjacent voxels with the same voxel value.
[0051] Step S520: For each segmentation block, based on the voxel values of the voxels within the segmentation block and the number of consecutive occurrences of each voxel value, determine data pairs corresponding to the respective voxel values, and based on the data pairs, determine the compressed three-dimensional model data.
[0052] Among them, the voxel value of a voxel is the marking value of the corresponding voxel. Different voxels can be marked in various ways of distinguishing marks to characterize the relationship between different voxels. Specifically, it can be distinguished and marked based on operations such as clipping and object recognition to obtain voxel values corresponding to different clipping targets, recognition targets, etc. Among them, the clipping target, recognition target, etc. can include at least one voxel. This mark can be a label number or ultrasonic data, etc.
[0053] It can be understood that each segmentation block is composed of multiple voxels. These voxels can be used to represent the segmentation block. In order to avoid adding position description information of voxels in the segmentation block, the segmentation block can be represented by voxels in a preset order, so that only the voxel values of the voxels are used to represent the segmentation block. This preset order represents the position of the voxels in the segmentation block. In other words, the position of the voxel in the segmentation block (such as its X, Y, and Z axis coordinates) determines the position of the voxel value of the voxel in the data of the segmentation block (such as the specific position of the data value in the data of the segmentation block).
[0054] Based on the data of the segmentation block, specifically including the voxel values of the voxels and the number of consecutive occurrences of different voxel values, determine data pairs corresponding to different voxel values. It can be understood that consecutive occurrences mean that the voxel values of adjacent voxels are the same.
[0055] Exemplarily, taking a certain segmentation block as an example, this segmentation block is composed of the voxel values of multiple voxels, and the voxel values of the voxels within this segmentation block are 0, 0, 0, 0, 1, 1, 1, 2, 1, 1 in sequence. For this segmentation block, the data pairs corresponding to the respective voxel values can be determined as (4, 0), (3, 1), (1, 2), and (2, 1) respectively. These data pairs respectively represent that, first, there are 4 consecutive voxels with a voxel value of 0 in this segmentation block; next, there are 3 consecutive voxels with a voxel value of 1; then there is 1 voxel with a voxel value of 2; finally, there are 2 consecutive voxels with a voxel value of 1. As shown in the above example, although there is only 1 voxel with a voxel value of 2, it also corresponds to a data pair. For the voxels with a voxel value of 1, there are a total of 5 in this segmentation block. However, these 5 voxels are not consecutive but are divided into two groups of consecutive voxels. According to the embodiments of the present application, each data pair represents consecutive voxel values. Therefore, the above 5 voxels with a voxel value of 1 need to be represented by two data pairs, namely (3, 1) and (2, 1).
[0056] Based on the determined data pairs, the compressed three-dimensional model data can be determined. Exemplarily, these determined data pairs can be used as compressed three-dimensional model data. Still taking the above-mentioned segmentation blocks 0, 0, 0, 0, 1, 1, 1, 2, 1, 1 as an example, 4, 0, 3, 1, 1, 2, 2 and 1 can be stored in the memory in sequence as compressed segmentation blocks. It can be seen that the three-dimensional model data to be compressed includes 10 numbers, but the compressed three-dimensional model data includes 8 numbers. Thus, data compression is achieved on the basis of retaining all data information of the three-dimensional model data to be compressed.
[0057] The size of the three-dimensional model data in each dimension may be large. In the above step S510, the three-dimensional model data to be compressed is first divided into multiple blocks, which makes it easier to achieve the effect of voxel values of voxels in the neighborhood to converge, thereby ensuring the effectiveness of data compression. If the three-dimensional model data to be compressed is not divided into blocks, then when judging adjacent voxels with the same value, the current voxel and the next voxel may be far apart in the physical space, thereby reducing the probability that they are voxels with the same value. For example, assuming that the size xSize of the three-dimensional model data to be compressed in the X-axis direction is 100, the voxel with an index of 99 is located at the end of the first line in the physical space, and the voxel with an index of 100 is located at the beginning of the second line in the physical space. These two voxels are far apart in the physical space, and the probability of having the same voxel value is small. If the 3D model data to be compressed is divided into 10 blocks in the X-axis direction, then for each block, the voxel with index 9 is located at the end of the first line in the physical space, and the voxel with index 10 is located at the beginning of the second line in the physical space. These two voxels are less than 10 voxels apart in the physical space, and the probability of having the same voxel value is high. Therefore, the 3D model data can be compressed more effectively.
[0058] It is understood that the above process of determining the data pairs and determining the compressed 3D model data according to the data pairs may not be performed sequentially. The compressed 3D model data may be determined during the process of determining the data pairs, i.e., according to the determined data pairs, rather than after all the data pairs are determined, and then the compressed 3D model data is determined.
[0059] In the above technical solution, first, the three-dimensional model data is divided into a plurality of partitions, and then data pairs are formed according to the voxel values in the partitions and the number of adjacent identical voxel values to obtain compressed three-dimensional model data. In short, the solution can compress voxels with identical voxel values well, minimizing the storage space occupied by the compressed data. This fully utilizes the same-value neighborhood in the three-dimensional model data for data compression, effectively reducing the storage space required for the three-dimensional model data.
[0060] In some embodiments, step S510 of dividing the three-dimensional model data to be compressed into a plurality of divided blocks may include: evenly dividing the three-dimensional model data to be compressed into a plurality of divided blocks. Figure 6 shows the three-dimensional model data after uniform equal division according to an embodiment of the present application. As Figure 6 shown, the three-dimensional model data is evenly divided into 6 divided blocks in the X-axis direction, 5 divided blocks in the Y-axis direction, and 8 divided blocks in the Z-axis direction. Thus, the three-dimensional model data is evenly divided into 240 divided blocks.
[0061] The size of each divided block can be expressed by the following formula:
[0062] blockV = blockXSize × blockYSize × blockZSize;
[0063] where blockV represents the volume of the divided block, blockXSize represents the size of the divided block in the X-axis direction, blockYSize represents the size of the divided block in the Y-axis direction, and blockZSize represents the size of the divided block in the Z-axis direction.
[0064] The number of divided blocks divided in any direction can be determined according to the size of the three-dimensional model data and the repetition probability of the voxel values of the three-dimensional model data. When the size of the divided block is too small or too large, it may not be possible to effectively compress the storage space occupied by the three-dimensional model data, and the compression effect is poor.
[0065] In addition, the number of divided blocks divided in a certain direction can also be determined according to the data storage mode of the three-dimensional model data.
[0066] For example, for three-dimensional ultrasonic imaging data, it can be stored using unsigned character type data, and the maximum value stored in an unsigned character type storage space is 255. In this case, blockV can be any value from 100 to 255. For example, it can be equal to 5×5×5. Thus, a divided block includes 125 voxels. Naturally, the maximum number of continuously occurring voxels with the same value in a divided block is also 125. The value representing the number of continuously occurring voxel values in the data pair is at most 125. 125 < 255, so it is convenient to store the compressed three-dimensional ultrasonic imaging data using unsigned character type data, effectively utilizing the storage space. It can be understood that if integer data is used to store the data, the size of the divided block can be larger.
[0067] In the above technical solution, the 3D model data is divided into uniformly sized segmentation blocks, unifying the sizes of the segmentation blocks, facilitating operations such as segmentation and determination of the compressed 3D model data, reducing the amount of data processing for compressing the 3D model data, and improving the processing speed.
[0068] Alternatively, the 3D model data can also be non-uniformly segmented to obtain segmentation blocks of different sizes. In such a technical solution, it is necessary to identify the data of different segmentation blocks in different ways to ensure that the compressed 3D model data can be correctly decompressed.
[0069] In some embodiments, in step S520, for each segmentation block, based on the voxel values of the voxels within the segmentation block and the number of consecutive occurrences of each voxel value, determining the data pairs corresponding to each voxel value respectively may include the following operations. Traverse the voxel values of all voxels within the segmentation block. When the current voxel value is the same as the next adjacent voxel value, increment the number of consecutive occurrences of the current voxel value until the current voxel value is different from the next adjacent voxel value to obtain the number of consecutive occurrences of the current voxel value, and determine the number of consecutive occurrences and the current voxel value as the data pair corresponding to the current voxel value.
[0070] The voxel values of each voxel within the segmentation block can be obtained in sequence. When the current voxel value is the same as the next adjacent voxel value, it indicates that the voxel value has appeared again, so the number of consecutive occurrences of the voxel value can be increased by 1, and the next adjacent voxel value is used as the current voxel value. When the current voxel value is different from the next adjacent voxel value, store the number of consecutive occurrences of the current voxel value and the voxel value to form the data pair corresponding to the voxel value, and use the next adjacent voxel value as the current voxel value. Based on the new current voxel value, perform the foregoing operations again until the current voxel value is the voxel value of the last voxel within the segmentation block.
[0071] Figure 7 shows a schematic flowchart of a method for compressing a segmentation block in 3D model data according to an embodiment of the present invention. As Figure 7 shown, the method for compressing the segmentation block of the 3D model data includes the following steps.
[0072] Step S702, initialize the current voxel value V as the voxel value of the first voxel in the segmentation block, and initialize the number of consecutive occurrences L of the current voxel value as 1.
[0073] Step S703, determine whether the current voxel value V is the voxel value of the last voxel within the segmentation block.
[0074] Step S704, if the current voxel value is not the voxel value of the last voxel, obtain the voxel value of the next adjacent voxel.
[0075] Step S705: Determine whether the voxel value of the next adjacent voxel is numerically the same as the current voxel value.
[0076] Step S706: If the voxel value of the next adjacent voxel is the same as the current voxel value, then the consecutive occurrence count L of this voxel value is incremented by 1, and return to the above Step S704 again.
[0077] Step S707: If the voxel value of the next adjacent voxel is not the same as the current voxel value, then store the data pair (L, V) at the end of the compressed three-dimensional model data.
[0078] Step S709: Obtain the voxel value of the next adjacent voxel, and go to Step S702.
[0079] Step S710: If it is determined in Step S703 that the current voxel value is the voxel value of the last voxel, then store the data pair (L, V) at the end of the compressed three-dimensional model data. Thus, the segmentation block compression is completed.
[0080] In the above technical solution, traverse the voxel values of all voxels within the segmentation block, and handle the cases where the current voxel value is the same as and different from the next adjacent voxel value respectively, so as to obtain the data pairs corresponding to the voxel values. This solution can determine accurate data pairs at a relatively small computational cost. Thereby, it ensures obtaining accurate compressed three-dimensional model data at a relatively fast compression speed.
[0081] In some embodiments, determining the compressed three-dimensional model data based on the data pairs includes the following operations.
[0082] First, count the number of the determined data pairs. This operation can be performed as the data pairs are determined. In other words, the number of data pairs can be counted while determining the data pairs. In this way, after all the data pairs of the segmentation block are determined, the number of all data pairs is also counted simultaneously.
[0083] Then, store the number of data pairs and all the data pairs as the compressed three-dimensional model data. Thus, the data for each segmentation block in the compressed three-dimensional model data includes the number information of the data pairs corresponding to this segmentation block. This number information of the data pairs can be used for verifying the compressed three-dimensional model data to ensure the accuracy of its compression.
[0084] Refer again to Figure 7 , the compression of the segmentation block may further include Step S701, Step S708, and Step S711.
[0085] In step S701, the number NUM_LV of data pairs is initialized to 0, i.e., NUM_LV = 0. Then, the data pairs corresponding to the voxel values of each voxel within the segmentation block are determined. During the process of determining the data pairs corresponding to each voxel value, if it is determined in step S705 that the voxel value of the next adjacent voxel is different from the current voxel value, it indicates that a new data pair will start to be determined. Thereafter, step S708 can be executed to increment the number of data pairs by 1. Then, step S709 is executed to obtain the voxel value at the next position. If it is determined in step S703 that the current voxel value is the voxel value of the last voxel, it indicates that no new data pair will appear. At this time, step S711 can be executed to store the number NUM_LV of data pairs at the head of the compressed data.
[0086] Figure 8 shows a schematic diagram of the storage space of the compressed three-dimensional model data according to an embodiment of the present invention. As Figure 8 shown, the three-dimensional model data includes a plurality of segmentation blocks. Figure 8 After each segmentation block in is compressed, it includes the information of the number of data pairs and the information of each data pair. In Figure 8 NUM_LV represents the number of data pairs in the segmentation block. V_i represents the voxel value corresponding to the data pair, where 0 < i ≤ NUM_LV. L_i represents the number of repeated occurrences of the voxel value corresponding to the data pair. (L_i, V_i) is a data pair.
[0087] In the above technical solution, the number of data pairs in the segmentation block is counted, and the information of the counted number is included in the compressed three-dimensional model data. Thus, the number of data pairs therein can correct the compressed three-dimensional model data, ensuring the accuracy of the compression result. In addition, by counting the number of data pairs in each segmentation block, the size of the segmentation block can be determined according to the number of data pairs in each segmentation block, differentiating segmentation blocks of different sizes, and ensuring the accuracy of the segmentation block during the compression process.
[0088] Alternatively, an identifier can be set before or after the data of each segmentation block to mark the data pairs of each segmentation block. The identifier can be a special symbol different from the voxel value and the number of consecutive occurrences. Whenever the identifier appears, it indicates that the subsequent data is the data of a new segmentation block. In the embodiments of the present application, no specific implementation manner of the identifier is limited, and any identifier that can be used to distinguish and mark the segmentation block is within the protection scope of the present application.
[0089] In some embodiments, Figure 9 shows a schematic flowchart of generating three-dimensional model data to be compressed according to an embodiment of the present application. As Figure 9As shown, before splitting the three-dimensional model data to be compressed into multiple split blocks in step S510, the above compression method may further include step S501, step S502, and step S503.
[0090] In step S501, target three-dimensional model data is obtained. The target three-dimensional model data may be the original three-dimensional model data to be compressed, and it may be of any shape. The target three-dimensional model data may be the original three-dimensional model data obtained through scanning, detection, etc. Taking the three-dimensional model data obtained by three-dimensional ultrasonic imaging as an example, the target three-dimensional model may be the ultrasonic original data obtained by scanning with an ultrasonic device.
[0091] In step S502, according to the sizes of the target three-dimensional model data in three dimensions and the preset sizes of the split blocks, the padding sizes in three dimensions are determined. The padding sizes are used to pad the target three-dimensional model data into the three-dimensional model data to be compressed. The sizes of the three-dimensional model data to be compressed in three dimensions are respectively integer multiples of the preset sizes of the split blocks in three dimensions.
[0092] The target three-dimensional model data can be padded in three dimensions to obtain the three-dimensional model data to be compressed. It can be understood that the three-dimensional model data to be compressed is the cuboid bounding box outside the target three-dimensional model data. The area between the target three-dimensional model data and the cuboid bounding box is the area to be padded. The size of the three-dimensional model data to be compressed is larger than the size of the target three-dimensional model data, and the three-dimensional model data to be compressed includes all the data of the target three-dimensional model data. In addition, the three-dimensional model data to be compressed obtained by padding can have a regular shape so that it can be exactly divisible by the split blocks without remaining voxels. For example, the size of the three-dimensional model data to be compressed is 320×240×240, and the size of the split block is 5×5×5. In this way, the three-dimensional model data to be compressed can be split into 64×48×48 split blocks. Thus, it is convenient to split the three-dimensional model data to be compressed into multiple split blocks.
[0093] In step S503, according to the padding sizes in three dimensions determined in step S502, the target three-dimensional model data is padded to generate the three-dimensional model data to be compressed.
[0094] During the process of padding the target three-dimensional model data, the voxel values of the voxels in the padding area can be specially marked. Using this special mark, the voxel value can be identified as an invalid value and can be not processed during data processing such as compression.
[0095] In the above technical solution, the three-dimensional model data to be compressed that can be divided evenly by the division block in size can be obtained based on the target three-dimensional model data of any shape. In this way, the compression processing operation can be performed on any three-dimensional model data more conveniently and quickly, and the universality is stronger.
[0096] In some embodiments, step S502 determines the padding sizes in the three dimensions required to pad the target three-dimensional model data into the three-dimensional model data to be compressed according to the sizes of the target three-dimensional model data in the three dimensions and the preset size of the division block, including the following steps.
[0097] First, in any dimension, take the remainder of the size of the target three-dimensional model data in this dimension divided by the preset size of the division block in this dimension. Then, for the case where the remainder is 0, determine the padding size in this dimension as 0. In other words, the size of the three-dimensional model data to be compressed in this dimension is equal to the size of the target three-dimensional model data in this dimension. For the case where the remainder is not 0, determine the padding size in this dimension as the difference between the preset size of the division block in this dimension and the remainder.
[0098] Exemplarily, the above process is described taking the X-axis direction as an example. It can be understood that the Y-axis direction and the Z-axis direction are similar to the X-axis direction, and for the sake of brevity, they will not be elaborated here. Divide the size of the target three-dimensional model data in the X-axis direction by the size of the division block in the X-axis direction to obtain the remainder. If the remainder is 0, it means that in the X-axis direction, the size of the target three-dimensional model data can be divided evenly by the size of the division block and no padding is required. The size of the target three-dimensional model data in the X-axis direction can be directly determined as the size of the three-dimensional model data to be compressed in the X-axis direction. If the remainder is non-zero, it means that in the X-axis direction, the size of the target three-dimensional model data cannot be divided evenly by the size of the division block and padding is required to obtain the three-dimensional model data to be compressed. Thus, when the remainder is non-zero, the padding size in the X-axis direction can be determined as the difference between the size of the division block in the X-axis direction and the remainder.
[0099] Therefore, when the remainder is 0, the number of division blocks in the X-axis direction is the quotient of the size of the target three-dimensional model data and the size of the division block. When the remainder is non-zero, the number of division blocks in the X-axis direction is the quotient of the size of the target three-dimensional model data and the size of the division block plus 1. Based on this, the size of the three-dimensional model data to be compressed in the X-axis direction can be expressed by the following formula.
[0100]
[0101] Among them, xSize represents the size of the three-dimensional model data to be compressed, i_volsize_x is the size of the target three-dimensional model data in the X-axis direction, blockXSize is the size of the segmentation block in the X-axis direction, and block_num_x is the number of segmentation blocks in the X-axis direction.
[0102] In the above technical solution, in three dimensions, according to the size of the target three-dimensional model data and the size of its segmentation blocks, the three-dimensional model data to be compressed is determined. This can evenly divide the target three-dimensional model data into multiple segmentation blocks, and moreover, the obtained three-dimensional model data to be compressed is as small as possible on the basis of including the complete target three-dimensional model data. Thus, the amount of data processing is reduced, and data processing operations such as compression can be performed more conveniently and quickly.
[0103] In some embodiments, the three-dimensional model data to be compressed is three-dimensional ultrasonic imaging data. Referring again to Figure 3 and Figure 4 as shown. As Figure 3 shown, 4 regions are marked in the three-dimensional ultrasonic imaging data of this fetus, and there are the same neighborhoods within the 4 marked regions respectively. Similarly, as Figure 4 shown, the follicles in the female ovary are respectively marked with numbers, and there are also the same neighborhoods within the different marked follicle regions.
[0104] There are usually one or more voxel neighborhoods with the same voxel value in the three-dimensional ultrasonic imaging data. Therefore, the above compression method for three-dimensional model data has good application prospects and compression effects in the field of three-dimensional ultrasonic imaging.
[0105] In some embodiments where the three-dimensional model data is three-dimensional ultrasonic imaging data, the above compression method may further include: determining the voxel value of the three-dimensional ultrasonic imaging data in response to a cropping operation by the user.
[0106] Optionally, the three-dimensional ultrasonic imaging data can be directly generated after being detected by an ultrasonic device. Alternatively, it can also be obtained by performing a cropping operation on the three-dimensional model data generated by the ultrasonic device according to the actual needs of the user. Therefore, the above compression method may further include: determining the voxel value of the three-dimensional ultrasonic imaging data in response to a cropping operation by the user. The voxel value corresponding to each cropping operation is the same voxel value, and this same voxel value is different from the voxel value of the background part, and the voxel values corresponding to different cropping operations are different voxel values. Among them, the background part can correspond to a background region, for example: the background region around the fetus, the background region outside the follicles.
[0107] Exemplarily, referring again to Figure 3, performing a cropping operation on the three-dimensional ultrasonic imaging data of the fetus can display the three-dimensional image of the remaining volume data after cropping from the entire three-dimensional ultrasonic imaging data. Different marked bits can be used to mark different cropped areas and remaining areas.
[0108] The following describes in detail according to an embodiment of the present application the process of determining the voxel values of the three-dimensional ultrasonic imaging data shown in response to the user's cropping operation. First, after the ultrasonic device generates the three-dimensional ultrasonic imaging data of the fetus, a two-dimensional cropping template is drawn on the three-dimensional ultrasonic imaging data in response to the user's operation. This operation can determine the display area on the screen of the voxels cropped from the three-dimensional ultrasonic imaging data by the user's operation of tracing with the mouse or the operation of the box rectangular box. The display area includes a plurality of pixel points. Then, traverse the pixel points in the display area, and determine a ray passing through the voxel according to the pixel point and the viewing point, and each voxel passed by the ray is marked. Figure 3 FIG. shows a schematic diagram of mapping pixels on the screen to three-dimensional model data according to an embodiment of the present application. Figure 10 FIG. shows a schematic diagram of mapping the marked area on the screen to the marked area of the three-dimensional model data according to an embodiment of the present application. Repeating the above process, a three-dimensional cropping template with multiple marked overlays can be obtained, and the three-dimensional cropping template includes a plurality of areas to be cropped. It can be understood that the marked values for each marking can be different. Finally, according to the numerical values marked by the three-dimensional cropping template, a cropping operation is performed on the corresponding positions in the three-dimensional ultrasonic imaging data. Figure 11
[0109] As shown in FIG., four cropping operations are performed on the three-dimensional ultrasonic imaging data of the fetus, and the areas of the first, second, third, and fourth cropping operations are respectively marked as 1, 2, 3, and 4. If more cropping operations are required, the area of the nth cropping operation can be marked as n. On the three-dimensional ultrasonic imaging data of the fetus, the areas subjected to different cropping operations respectively have the same voxel values. Figure 3
[0110] In the above technical solution, the compressed three-dimensional ultrasonic imaging data is compressed. Since the three-dimensional ultrasonic imaging data includes a neighborhood with one or more identical voxel values, the compression effect of the three-dimensional model data is more significant.
[0111]
[0112] Taking a three-dimensional ultrasonic imaging data as an example, the size of the three-dimensional ultrasonic imaging data is 320×203×261 (length×width×height), and the size of each segmentation block is 5×5×5. If the storage method of the three-dimensional model data in the related art is used, the storage space required for the three-dimensional ultrasonic imaging data is 320×203×261 = 16954560 bytes.
[0112] Figure 12a ,Figure 12b , Figure 12c and Figure 12d respectively show three - dimensional ultrasonic imaging data without any cropping, three - dimensional ultrasonic imaging data after 3 times of cropping, three - dimensional ultrasonic imaging data after 10 times of cropping, and three - dimensional ultrasonic imaging data after 15 times of cropping.
[0113] For the three - dimensional ultrasonic imaging data without any cropping, after compressing the three - dimensional ultrasonic imaging model using the compression method according to an embodiment of the present application and then storing it, the storage space used by the compressed three - dimensional ultrasonic imaging model is 139,072 bytes, and the compression ratio is 139,072 / 16,954,560 = 0.82%.
[0114] For the three - dimensional ultrasonic imaging data after 3 times of cropping, the storage space used by the compressed three - dimensional cropped model data is 754,829 bytes, and the compression ratio is 754,829 / 16,954,560 = 4.45%.
[0115] For the three - dimensional ultrasonic imaging data after 10 times of cropping, the storage space used by the compressed three - dimensional cropped model data is 1,320,777 bytes, and the compression ratio is 1,320,777 / 16,954,560 = 7.80%.
[0116] For the three - dimensional ultrasonic imaging data after 15 times of cropping, the storage space used by the compressed three - dimensional cropped model is 1,872,042 bytes, and the compression ratio is 1,872,042 / 16,954,560 = 11.04%.
[0117] Exemplarily, the above - mentioned compression method may further include the following steps. First, perform target recognition on the three - dimensional ultrasonic imaging data. This target recognition can be automatically achieved based on the voxel values in the three - dimensional ultrasonic imaging data using traditional target recognition algorithms. Alternatively, it can also be automatically achieved using a trained artificial learning model. Or alternatively, it can also be achieved by manual recognition and annotation in the three - dimensional ultrasonic imaging data. Then, determine the voxel values of the three - dimensional ultrasonic imaging data based on the recognized targets. The voxel values of each recognized target are the same voxel value, and this same voxel value is different from the voxel values of the background part, and the voxel values of different recognized targets are different voxel values. It can be understood that the targets targeted by the target recognition operation can be any object of interest in the three - dimensional ultrasonic imaging data, such as Figure 4 the follicles in the illustrated embodiment. Referring again to Figure 4 , in the three - dimensional ultrasonic imaging data through follicle recognition and according to the follicle recognition markers, the marker values in each follicle are the same, and the marker values of different follicles are different, being 1, 2, 3, 4, and 5 respectively.
[0118] As can be seen, in the technical field of three-dimensional ultrasonic imaging, the compression method of three-dimensional model data according to the embodiments of the present application can effectively compress three-dimensional mode data. In particular, after the user crops the specified area of the three-dimensional model data according to actual needs, the compression ratio of the three-dimensional model data is higher and the storage space occupied is smaller. Similarly, after target recognition of the three-dimensional ultrasonic imaging data, the compression ratio of the three-dimensional model data is also relatively high and the storage space occupied is small.
[0119] According to another aspect of the present application, a decompression method for three-dimensional model data is also provided. The three-dimensional model data to be decompressed includes a plurality of data groups. Each data group includes at least one data pair. Each data pair includes information on the voxel value corresponding to the data pair and information on the number of consecutive occurrences of the voxel value in a preset order, and each data group corresponds to a preset number of voxel values. The decompression method includes the following steps.
[0120] First, for each data group in the three-dimensional model data to be decompressed, based on the voxel value corresponding to each data pair in the data group and the number of consecutive occurrences of the voxel value, determine the decompressed block data of the data group. Then, splice the decompressed block data of each data group to obtain the decompressed three-dimensional model data.
[0121] The data groups of the three-dimensional model data to be decompressed correspond to the segmentation blocks of the three-dimensional model data before compression. For the three-dimensional model data before compression, the segmentation blocks therein can be represented by one or more data pairs. The data groups of the three-dimensional model data to be decompressed include all the data pairs corresponding to the segmentation blocks. When a data group contains only one data pair, it means that the voxel values within the corresponding segmentation block are all the same.
[0122] The size of the segmentation block is fixed, and the number of voxels included in the segmentation block can be predicted. For example, the number of voxels included in a segmentation block with a size of 5×5×5 is 125, and the number of voxels included in a segmentation block with a size of 6×6×6 is 216. Each voxel has its own voxel value. It can be understood that these voxels can have the same voxel value and / or different voxel values. The number of voxels included in the segmentation block is the number of voxel values corresponding to the data group. Thus, the data group corresponds to a preset number of voxel values.
[0123] Based on the voxel values and the information on the number of consecutive occurrences of voxel values included in the data pairs of a data group, the decompressed block data of the data group, that is, the data of the corresponding segmentation block, can be determined. In one example, each data group includes 10 voxel values, that is, the corresponding segmentation block includes 10 voxels. Suppose in the three-dimensional model data to be decompressed, the starting data pairs are (4, 0), (3, 1), (1, 2), (2, 1), and (6, 0)… According to the information on the number of consecutive occurrences of voxel values in the data pairs, it can be known that 4 + 3 + 1 + 2 = 10. From this, it can be determined that the data pair (2, 1) is the last data pair in this data group, and (6, 0) will belong to another data group. In other words, the first data group in the three-dimensional model data to be decompressed is (4, 0), (3, 1), (1, 2), and (2, 1). Also, according to the voxel value information in these data pairs, it can be known that the voxel values corresponding to the data group are 0, 0, 0, 0, 1, 1, 1, 2, 1, and 1 in sequence, that is, the decompressed block data of the data group. This block data corresponds to the segmentation block before compression.
[0124] According to the storage order of each data group, each data group is decompressed in sequence. The block data obtained after decompression is spliced to obtain the decompressed three-dimensional model data. It can be understood that the above process of decompressing the data group and the splicing process may not be two processes completely separated in time. During the process of decompressing the data group, that is, the block data obtained from the current decompression is spliced with the previously decompressed data, rather than splicing all the block data together after all the data groups are decompressed. Thus, the decompression speed of the three-dimensional model data can be accelerated and the execution efficiency can be improved.
[0125] In the above technical solution, first, based on the voxel values corresponding to each data pair in the data group and the number of consecutive occurrences of the voxel values, the decompressed block data is determined; then the block data is spliced to obtain the decompressed three-dimensional model data. This decompresses the three-dimensional model data quickly and accurately and obtains the desired decompression result.
[0126] In some embodiments, each data group further includes the information on the number of data pairs in the data group. The above step of determining the decompressed block data of the data group based on the voxel values corresponding to each data pair in the data group and the number of consecutive occurrences of the voxel values includes: based on the number of data pairs in the data group, traversing each data pair in the data group, and for each data pair, decompressing the voxel values corresponding to the number of consecutive occurrences into the decompressed block data of the data group.
[0127] Figure 13 shows a schematic flowchart of a method for decompressing a data group in three-dimensional model data according to an embodiment of the present invention. As Figure 13As shown, the method for decompressing the data group of the three-dimensional model data includes the following steps.
[0128] In step S1310, obtain the number NUM_LV of data pairs in the data group.
[0129] In step S1320, initialize the index value CUR_IDX of the compressed data of the data pair to 0, that is, CUR_IDX = 0. Refer again to Figure 8 , the index value is the sorting number corresponding to each value in the compressed data. For example, Figure 8 the index value corresponding to the number NUM_LV of data pairs in the compressed data is 0, Figure 8 the index value corresponding to L_1 in Figure 8 is 1, the index value corresponding to V_1 in
[0130] is 2, and so on.
[0131] In step S1340, if the index value CUR_IDX is less than the number NUM_LV of data pairs, determine the consecutive occurrence number L of the voxel value of the first data pair according to the data with the index value 1 + 2×CUR_IDX in the compressed data, and determine the voxel value V according to the data with the index value 1 + 2×CUR_IDX + 1.
[0132] In step S1350, write the determined consecutive L V values to the end of the decompressed data.
[0133] In step S1360, after executing the above step S1350, increment the index value CUR_IDX by 1.
[0134] Loop and execute the above steps S1330, S1340, S1350, and S1360 until the index value CUR_IDX is equal to the number NUM_LV of data pairs. When it is determined in step S1330 that the index value CUR_IDX is no longer less than the number NUM_LV of data pairs, the decompression of the data group is completed.
[0135] In the above technical solution, by the number information of the data pairs in the data group, traverse the data pairs in the data group, and perform decompression and restoration of the data according to the voxel value of each data pair in the data group and its corresponding consecutive occurrence number, so as to obtain the decompressed block data. This solution makes full use of the number information of the data pairs, not only ensuring the accuracy of the decompression process, but also improving the decompression efficiency.
[0136] In some embodiments, the number of voxel values corresponding to all data groups is the same. The fact that the number of voxel values corresponding to all data groups is the same can be understood as that the sizes of the segmentation blocks obtained by segmenting the three-dimensional model data before compression are the same. The fact that the number of voxel values corresponding to all data groups is the same can facilitate the decompression operation of the three-dimensional model data and improve the decompression efficiency.
[0137] As Figure 14 shown, according to another aspect of the present application, there is also provided a compression device 1400 for three-dimensional model data. As Figure 14 shown, the compression device 1400 includes a segmentation module 1410 and a compression module 1420. The segmentation module 1410 is configured to segment the three-dimensional model data to be compressed into a plurality of segmentation blocks. The compression module 1420 is configured to, for each segmentation block, determine data pairs respectively corresponding to the voxel values based on the voxel values of the voxels in the segmentation block and the number of consecutive occurrences of each voxel value, and determine the compressed three-dimensional model data based on the data pairs.
[0138] In some embodiments, the compression module 1420 determines the data pairs respectively corresponding to the voxel values based on the voxel values of the voxels in the segmentation block and the number of consecutive occurrences of each voxel value in the following manner: traverse the voxel values of all voxels in the segmentation block, and when the current voxel value is the same as the next adjacent voxel value, increment the number of consecutive occurrences of the current voxel value until the current voxel value is different from the next adjacent voxel value, so as to obtain the number of consecutive occurrences of the current voxel value, and determine the number of consecutive occurrences and the current voxel value as the data pair corresponding to the current voxel value.
[0139] In some embodiments, the compression module 1420 determines the compressed three-dimensional model data based on the data pairs in the following manner: count the number of the determined data pairs, and store the number of the data pairs and all the data pairs as the compressed three-dimensional model data.
[0140] In some embodiments, the segmentation module 1410 is specifically configured to evenly divide the three-dimensional model data to be compressed into a plurality of segmentation blocks.
[0141] In some embodiments, the compression device 1400 further includes an acquisition module, a padding size determination module, and a padding module. Among them, the acquisition module is configured to acquire target three-dimensional model data before dividing the three-dimensional model data to be compressed into multiple divided blocks. The padding size determination module is configured to determine the padding sizes in three dimensions respectively according to the sizes of the target three-dimensional model data in three dimensions and the preset sizes of the divided blocks, where the padding sizes are used to pad the target three-dimensional model data into the three-dimensional model data to be compressed, and the sizes of the three-dimensional model data to be compressed in three dimensions are respectively integer multiples of the preset sizes of the divided blocks in three dimensions. The padding module is configured to pad the target three-dimensional model data according to the determined padding sizes in three dimensions to generate the three-dimensional model data to be compressed.
[0142] In some embodiments, the padding size determination module determines the padding sizes in three dimensions respectively according to the sizes of the target three-dimensional model data in three dimensions and the preset sizes of the divided blocks, and is implemented by the following method: in any dimension, taking the remainder of the size of the target three-dimensional model data in this dimension divided by the preset size of the divided block in this dimension; for the case where the remainder is 0, determining the padding size in this dimension as 0; for the case where the remainder is not 0, determining the padding size in this dimension as the difference between the preset size of the divided block in this dimension and the remainder.
[0143] In some embodiments, the three-dimensional model data to be compressed is three-dimensional ultrasonic imaging data.
[0144] In some embodiments, the compression device 1400 further includes a cropping module. The cropping module is configured to determine the voxel values of the three-dimensional ultrasonic imaging data in response to a user's cropping operation. Among them, the voxel value corresponding to each cropping operation is the same voxel value, and this same voxel value is different from the voxel value of the background part, and the voxel values corresponding to different cropping operations are different voxel values.
[0145] In some embodiments, the compression device 1400 further includes an identification marking module. The identification marking module is configured to perform target identification on the three-dimensional ultrasonic imaging data and determine the voxel values of the three-dimensional ultrasonic imaging data based on the identified targets; among them, the voxel value of each identified target is the same voxel value, and this same voxel value is different from the voxel value of the background part, and the voxel values of different identified targets are different voxel values.
[0146] Such as Figure 15As shown, according to another aspect of the present application, a decompression device 1500 for three-dimensional model data is further provided. The three-dimensional model data to be decompressed includes a plurality of data groups. Each data group includes at least one data pair. Each data pair includes information on the voxel value corresponding to the data pair and information on the number of consecutive occurrences of the voxel value, and each data group corresponds to a preset number of voxel values. The decompression device 1500 includes a decompression module 1510 and a splicing module 1520. The decompression module 1510 is configured to, for each data group in the three-dimensional model data to be decompressed, determine the decompressed block data of the data group based on the voxel value corresponding to each data pair in the data group and the number of consecutive occurrences of the voxel value. The splicing module 1520 is configured to splice the decompressed block data of each data group to obtain the decompressed three-dimensional model data.
[0147] In some embodiments, each data group further includes information on the number of data pairs in the data group. The decompression module 1510 determines the decompressed block data of the data group based on the voxel value corresponding to each data pair in the data group and the number of consecutive occurrences of the voxel value by the following method: based on the number of data pairs in the data group, traverse each data pair in the data group, and for each data pair, decompress the voxel value corresponding to the number of consecutive occurrences into the decompressed block data of the data group.
[0148] In some embodiments, the number of voxel values corresponding to all data groups is the same.
[0149] Those of ordinary skill in the art can understand the specific structures and beneficial effects of the above-mentioned compression device and decompression device for three-dimensional model data by reading the above-related descriptions of the compression method and decompression method for three-dimensional model data. For the sake of brevity, they will not be elaborated here.
[0150] As Figure 16 shown, according to another aspect of the present application, an electronic device 1600 is further provided, including a processor 1610 and a memory 1620. Among them, computer program instructions are stored in the memory 1620, and when the computer program instructions are run by the processor 1610, they are used to execute the above-mentioned compression method for three-dimensional model data and / or the above-mentioned decompression method for three-dimensional model data.
[0151] According to another aspect of the present application, a storage medium is further provided. Program instructions are stored on the storage medium, and when the program instructions are run, they are used to execute the above-mentioned compression method for three-dimensional model data and / or the above-mentioned decompression method for three-dimensional model data.
[0152] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present invention thereto. Those of ordinary skill in the art can make various changes and modifications therein without departing from the scope and spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as claimed in the appended claims.
[0153] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0154] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0155] In the specification provided herein, a large number of specific details are set forth. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies have not been shown in detail so as not to obscure the understanding of this specification.
[0156] Similarly, it should be understood that, in order to streamline the present invention and assist in understanding one or more of the various inventive aspects, in the description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present invention should not be construed as reflecting the intention that the claimed present invention requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, the inventive point lies in being able to solve the corresponding technical problem with fewer features than all the features of a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into the detailed description, where each claim itself serves as a separate embodiment of the present invention.
[0157] Those skilled in the art will appreciate that, except where features are mutually exclusive, any combination can be employed of all the features disclosed in this specification (including the accompanying claims, abstract and drawings), and of all the processes or units of any method or apparatus so disclosed. Each feature disclosed in this specification (including the accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
[0158] In addition, those skilled in the art will understand that, although some embodiments described herein include certain features included in other embodiments but not others, the combination of features of different embodiments is meant to be within the scope of the present invention and forms different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.
[0159] Each component embodiment of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some of the modules in the compression device and decompression device for three-dimensional model data according to the embodiments of the present invention. The present invention can also be implemented as a device program (e.g., a computer program and a computer program product) for performing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.
[0160] It should be noted that the above embodiments illustrate rather than limit the present invention, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims listing several devices, several of these devices may be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words may be interpreted as names.
[0161] As described above, it is only the specific implementation manner of the present invention or the description of the specific implementation manner. The protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should be covered within the protection scope of the present invention. The protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for compressing three-dimensional model data, characterized in that, it includes: dividing the three-dimensional model data to be compressed into multiple divided blocks; for each divided block, based on the voxel values of the voxels within the divided block and the number of consecutive occurrences of each voxel value, determining data pairs corresponding to each voxel value respectively, and based on the data pairs, determining the compressed three-dimensional model data.
2. The method for compressing three-dimensional model data according to claim 1, characterized in that, the determining of the data pairs corresponding to each voxel value respectively based on the voxel values of the voxels within the divided block and the number of consecutive occurrences of each voxel value includes: traversing the voxel values of all voxels within the divided block, when the current voxel value is the same as the next adjacent voxel value, incrementing the number of consecutive occurrences of the current voxel value until the current voxel value is different from the next adjacent voxel value, so as to obtain the number of consecutive occurrences of the current voxel value, and determining the number of consecutive occurrences and the current voxel value as the data pair corresponding to the current voxel value.
3. The method for compressing three-dimensional model data according to claim 2, characterized in that, the determining of the compressed three-dimensional model data based on the data pairs includes: counting the number of the determined data pairs; storing the number of the data pairs and all the data pairs as the compressed three-dimensional model data.
4. The method for compressing three-dimensional model data according to claim 1, characterized in that, the dividing of the three-dimensional model data to be compressed into multiple divided blocks includes: uniformly dividing the three-dimensional model data to be compressed into multiple divided blocks.
5. The method for compressing three-dimensional model data according to claim 4, characterized in that, before dividing the three-dimensional model data to be compressed into multiple divided blocks, the compression method further includes: obtaining the target three-dimensional model data; according to the size of the target three-dimensional model data in three dimensions and the preset size of the divided block, determining the padding sizes in three dimensions respectively, wherein the padding sizes are used to pad the target three-dimensional model data into the three-dimensional model data to be compressed, and the sizes of the three-dimensional model data to be compressed in three dimensions are respectively integer multiples of the preset sizes of the divided block in three dimensions; padding the target three-dimensional model data according to the determined padding sizes in three dimensions to generate the three-dimensional model data to be compressed.
6. The method for compressing three-dimensional model data according to claim 5, characterized in that, the determining of the padding sizes in three dimensions respectively according to the size of the target three-dimensional model data in three dimensions and the preset size of the divided block includes: in any dimension, taking the remainder of the size of the target three-dimensional model data in this dimension divided by the preset size of the divided block in this dimension; for the case where the remainder is 0, determining the padding size in this dimension as 0; for the case where the remainder is not 0, determining the padding size in this dimension as the difference between the preset size of the divided block in this dimension and the remainder.
7. The method for compressing three-dimensional model data according to any one of claims 1 to 6, characterized in that, The three-dimensional model data to be compressed is three-dimensional ultrasonic imaging data.
8. The compression method of the three-dimensional model data according to claim 7, wherein, the compression method further includes: responding to a cropping operation of a user, determining voxel values of the three-dimensional ultrasonic imaging data; wherein, the voxel values corresponding to each cropping operation are the same voxel value, and this same voxel value is different from the voxel values of the background part, and the voxel values corresponding to different cropping operations are different voxel values.
9. The compression method of the three-dimensional model data according to claim 7, wherein, the compression method further includes: performing target recognition on the three-dimensional ultrasonic imaging data, and determining voxel values of the three-dimensional ultrasonic imaging data based on the recognized targets; wherein, the voxel values of each recognized target are the same voxel value, and this same voxel value is different from the voxel values of the background part, and the voxel values of different recognized targets are different voxel values.
10. A decompression method of three-dimensional model data, wherein, the three-dimensional model data to be decompressed includes multiple data groups, each data group includes at least one data pair, each data pair includes information of the voxel value corresponding to this data pair and information of the number of consecutive occurrences of this voxel value, and each data group corresponds to a preset number of voxel values; the decompression method includes: for each data group in the three-dimensional model data to be decompressed, determining the decompressed block data of this data group based on the voxel value corresponding to each data pair in this data group and the number of consecutive occurrences of this voxel value; stitching the decompressed block data of each data group to obtain the decompressed three-dimensional model data.
11. The decompression method of the three-dimensional model data according to claim 10, wherein, each data group further includes information of the number of data pairs in this data group, and the determining the decompressed block data of this data group based on the voxel value corresponding to each data pair in this data group and the number of consecutive occurrences of this voxel value includes: based on the number of data pairs in this data group, traversing each data pair in this data group, and for each data pair, decompressing the voxel value with the corresponding number of consecutive occurrences into the decompressed block data of this data group.
12. The decompression method of the three-dimensional model data according to claim 10 or 11, wherein, the number of voxel values corresponding to all data groups is the same.
13. A compression device for three-dimensional model data, wherein, it includes: a splitting module, configured to split the three-dimensional model data to be compressed into multiple split blocks; a compression module, configured to, for each split block, determine data pairs respectively corresponding to each voxel value based on the voxel value of the voxels in this split block and the number of consecutive occurrences of each voxel value, and determine the compressed three-dimensional model data based on the data pairs.
14. A decompression device for three-dimensional model data, wherein, the three-dimensional model data to be decompressed includes multiple data groups, each data group includes at least one data pair, each data pair includes information of the voxel value corresponding to this data pair and information of the number of consecutive occurrences of this voxel value, and each data group corresponds to a preset number of voxel values; The decompression device includes: A decompression module, configured to, for each data group in the three-dimensional model data to be decompressed, determine the decompressed block data of the data group based on each data pair in the data group, the corresponding voxel value, and the number of consecutive occurrences of the voxel value; A splicing module, configured to splice the decompressed block data of each data group to obtain the decompressed three-dimensional model data.
15. An electronic device, including a processor and a memory, wherein, computer program instructions are stored in the memory, and when the computer program instructions are run by the processor, they are used to execute the compression method of the three-dimensional model data according to any one of claims 1 to 9 and / or the decompression method of the three-dimensional model data according to any one of claims 10 to 12.
16. A storage medium, on which program instructions are stored, wherein, the program instructions are used to execute the compression method of the three-dimensional model data according to any one of claims 1 to 9 and / or the decompression method of the three-dimensional model data according to any one of claims 10 to 12 when running.