WO2019214193A1 - Point cloud sampling method, image processing device, and device having storage function - Google Patents

Point cloud sampling method, image processing device, and device having storage function Download PDF

Info

Publication number
WO2019214193A1
WO2019214193A1 PCT/CN2018/114433 CN2018114433W WO2019214193A1 WO 2019214193 A1 WO2019214193 A1 WO 2019214193A1 CN 2018114433 W CN2018114433 W CN 2018114433W WO 2019214193 A1 WO2019214193 A1 WO 2019214193A1
Authority
WO
WIPO (PCT)
Prior art keywords
point
data
data point
curvature
sampling
Prior art date
Application number
PCT/CN2018/114433
Other languages
French (fr)
Chinese (zh)
Inventor
张智胜
祁春超
黄雄伟
向志华
Original Assignee
深圳市华讯方舟太赫兹科技有限公司
华讯方舟科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市华讯方舟太赫兹科技有限公司, 华讯方舟科技有限公司 filed Critical 深圳市华讯方舟太赫兹科技有限公司
Publication of WO2019214193A1 publication Critical patent/WO2019214193A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to a point cloud sampling method, an image processing device, and a device having a storage function.
  • the 3D point cloud data model has become an emerging digital media, which has been widely used in industrial manufacturing, architectural design, product display, medicine, and e-commerce. Since the accuracy of the existing three-dimensional scanning device is greatly improved, the scanned point cloud data has extremely high precision and contains a large amount of redundant data, which leads to complicated and slow data processing.
  • the present application mainly provides a point cloud sampling method, an image processing device, and a device having a storage function, which can simplify point cloud data.
  • a technical solution adopted by the present application is to provide a point cloud sampling method, including: acquiring point cloud data of a three-dimensional image; calculating a curvature of each data point in the point cloud data; setting each data point Corresponding sampling radius, wherein the sampling radius corresponding to the data point with larger curvature is not larger than the sampling radius corresponding to the data point with smaller curvature, and the sampling radius corresponding to at least part of the data point with larger curvature is smaller than the data point corresponding to the smaller curvature The sampling radius; the point cloud data is sampled by the sampling radius, so that the data density of the region with larger curvature is larger than the region with smaller curvature.
  • an image processing apparatus including: a communication circuit and a processor connected to each other; a communication circuit for acquiring point cloud data of a three-dimensional image; Calculating the curvature of each data point in the point cloud data; setting a sampling radius corresponding to each data point, wherein the sampling radius corresponding to the data point having a larger curvature is not larger than the sampling radius corresponding to the data point having a smaller curvature, and at least part of the curvature is compared The sampling radius corresponding to the large data point is smaller than the sampling radius corresponding to the data point with the smaller curvature; the point cloud data is sampled based on the set sampling radius, so that the data density of the region with larger curvature is larger than the region with smaller curvature.
  • another technical solution adopted by the present application is to provide a device having a storage function, which stores an instruction, and when executed, implements a point cloud sampling method as described above.
  • the beneficial effects of the present application are: different from the prior art, in some embodiments of the present application, calculating the curvature of each data point in the point cloud data by acquiring the point cloud data of the three-dimensional image, and setting each data point correspondingly The sampling radius, wherein the sampling radius corresponding to the data point with larger curvature is not larger than the sampling radius corresponding to the data point with smaller curvature, and the sampling radius corresponding to at least part of the data point with larger curvature is smaller than the sampling corresponding to the data point with smaller curvature Radius, the point cloud data is sampled by the sampling radius, so that the data density of the region with larger curvature is larger than the region with smaller curvature, so that more data points are reserved in the region with larger curvature and remain in the region with less curvature.
  • Less data points, in addition to deleting redundant data retain feature data, which is beneficial to improve the speed of subsequent data processing, while reducing storage space and saving costs.
  • FIG. 1 is a schematic flow chart of a first embodiment of a point cloud sampling method according to the present application
  • FIG. 2 is a schematic flow chart of a second embodiment of a point cloud sampling method according to the present application.
  • FIG. 3 is a schematic diagram showing the spatial position of a first data point and a second data point
  • FIG. 4 is a schematic flow chart of a third embodiment of a point cloud sampling method according to the present application.
  • FIG. 5 is a schematic diagram of a specific process of each step in Figure 4.
  • FIG. 6 is a schematic flowchart of a fourth embodiment of a point cloud sampling method according to the present application.
  • FIG. 7 is a schematic diagram of raw point cloud data of a three-dimensional image that is not sampled
  • FIG. 8 is a schematic diagram of three-dimensional image point cloud data processed by the point cloud sampling method of the present application.
  • FIG. 9 is a schematic flowchart of a fifth embodiment of a point cloud sampling method according to the present application.
  • FIG. 10 is a schematic structural diagram of an embodiment of an image processing apparatus of the present application.
  • FIG. 11 is a schematic structural diagram of an embodiment of an apparatus having a storage function according to the present application.
  • the first embodiment of the point cloud sampling method of the present application includes:
  • S10 Acquire point cloud data of a three-dimensional image.
  • a point cloud is a large number of data points that express the surface of an object. Each data point can be represented by three-dimensional coordinates.
  • the point cloud data includes at least a position coordinate of a plurality of data points that express the contour of the three-dimensional image, and the third-dimensional point cloud data of the target may be directly scanned by using the three-dimensional scanning device, or may be pre-stored from a storage device or other device.
  • the point cloud data of the three-dimensional image is not specifically limited herein.
  • the data points in the point cloud usually do not have an explicit geometric topological relationship.
  • the plane fitting method is used to obtain the curvature of the fitted plane as the curvature of the data points.
  • the method of plane fitting can adopt the eigenvalue method or the least square method.
  • the curvature of each data point can indicate the degree of curvature of the data point.
  • the local area with a large degree of curvature contains more characteristic data points that can reflect the spatial characteristics of the three-dimensional image.
  • the sampling radius defines a circular sampling area centered on the data point and having a radius corresponding to the sampling radius, and the amount of sampled data is the same in each sampling area.
  • the sampling radius corresponding to the data point when the sampling radius corresponding to the data point is set, the sampling radius corresponding to the data point with larger curvature is not larger than the sampling radius corresponding to the data point with smaller curvature, and the sampling radius corresponding to the data point with at least partial curvature is larger.
  • the sampling radius corresponding to the data point smaller than the curvature.
  • a range of sampling radii such as [a,b], where a is the minimum sampling radius and b is the maximum sampling radius.
  • the sampling radius corresponding to the data point with the largest curvature can be set to a
  • the sampling radius corresponding to the data point with the smallest curvature is set to b
  • the number N of the data points can be obtained at the same time.
  • Set the sampling radius to the arithmetic progression column that is, set the sampling radius difference corresponding to each two data points to (ba)/N, and set the corresponding sampling radius according to the order of the data points from small to large, wherein the corresponding sampling radius is from Big to small changes.
  • sampling radius corresponding to multiple data points in a certain curvature range may be set to the same value, which is not specifically limited herein.
  • the data points may be selected in a preset order for sampling, wherein the preset order may be an increasing or decreasing order of curvature, or may be other preset sequences. , or randomly select data points for sampling, which is not specifically limited herein.
  • the data points with the smallest curvature are first selected for sampling.
  • the data points in the sampling region centered on the data point with the smallest curvature can be deleted.
  • the number and location of the reserved data points can be set according to actual needs, such as only retaining the central data point, or only retaining the central data point and the data point closest to the central data point.
  • the next undeleted data point is selected in the order of increasing curvature, and the sampling process is the same as the above process until all the samples of the undeleted data points are completed.
  • the data points retained by each sampling radius are the same, but the sampling radius of the data points with larger curvature is not larger than the sampling radius of the data points with smaller curvature, and the sampling radius of the data points with at least partial curvature is The sampling radius of the data point smaller than the curvature is smaller. Therefore, the area of the area with larger curvature has more data points per unit area than the area with smaller curvature, that is, the data density of the area with larger curvature is larger than the area with smaller curvature. Data density.
  • the area with a large degree of curvature can retain more data points, that is, retaining more feature points as much as possible, which is beneficial to improve the speed of subsequent data processing, and can also reduce storage. Space, saving costs.
  • step S13 includes:
  • the first data point is a center point of a sampling area that is randomly or in a preset order.
  • the position coordinates of the first data point are three-dimensional coordinates, which can be represented by three-dimensional coordinates of the European space, such as (x 1 , y 1 , z 1 ).
  • S132 Calculate the distance between the first data point and the second data point.
  • the second data point is at least part of the data point except the first data point.
  • the second data point may be other data points than the first data point, or may be part of the data points except the first data point, for example, when the data point is divided into multiple parts and simultaneously sampled, the second data point It is the other data points in the sampled data points except the first data point.
  • S133 Determine whether the distance is smaller than a sampling radius corresponding to the first data point.
  • step S134 is performed, otherwise step S135 is performed.
  • S136 Select another data point that is not deleted as the first data point according to the preset sampling order, and repeat the above steps until the traversal completes all the undeleted data points.
  • the preset sampling sequence is a preset sequence, which may be a sequence of curvature changes, a sequence of spatial positions, or a random storage order, and is not specifically limited herein.
  • the second data point is a data point other than the first data point, and when sampling, the position coordinates of the first data point and the second data point need to be acquired first, for example, FIG. 3 Point A (x 1 , y 1 , z 1 ) and point B (x 2 , y 2 , z 2 ), and then calculate the distance between the first data point and the second data point, such as calculating the first data Euclidean distance between point A and second data point B After the distance d is obtained, the distance d is compared with the sampling radius R1 corresponding to the first data point A. If the distance d is smaller than the sampling radius R1, it indicates that the second data point B is located at the first data point A.
  • the second data point B is deleted.
  • the second data point is not located in a circular area centered on the first data point A and having a radius of the sampling radius R1, as shown by the point C (x 3 , y 3 , z 3 ) in FIG. 3,
  • the distance between C and point A is greater than the sampling radius R1, at which time the second data point C is retained.
  • another data point that has not been deleted may be continuously selected as the first data point according to a preset sampling sequence, and the above sampling step is repeatedly performed until the traversal completes all the undeleted data points, that is, all the undeleted data points are taken as The first data point performs the above sampling step, and the sampling process is completed.
  • the sampling area formed by the corresponding sampling radius retains only itself, and other data points in the sampling area are deleted, thereby deleting redundant data.
  • the streamlined point cloud also reduces the storage space, which is beneficial to improve the speed of subsequent data processing and improve efficiency.
  • the point cloud data may be divided into a plurality of sub-point clouds and the sampling radius is set for sampling.
  • step S12 includes:
  • S121 The data points are arranged in a preset curvature order and then divided into a plurality of sub-point clouds.
  • the preset curvature order may be an increasing or decreasing order of curvature, or may be a decreasing order after the curvature is incremented, or may be an increasing order after the decreasing of the curvature, which is determined according to actual needs, and is not specifically limited herein.
  • the number of sub-point clouds divided is at least two, and the specific number can be set according to actual needs, for example, five sub-point clouds.
  • the number of data points in each sub-point cloud may be the same or different, and is not specifically limited herein.
  • a curvature range may be set for each sub-point cloud, and data points falling within the corresponding curvature range are divided into corresponding sub-point clouds, and then arranged.
  • step S121 includes:
  • S1211 Arrange the data points in the order of increasing/decrementing the curvature.
  • S1212 The ranked data points are equally divided into a plurality of sub-point clouds.
  • the data points may be arranged in the order of increasing/decreasing curvature, for example, 1000 data are arranged in increasing order of curvature, wherein the data points having the same curvature They can be arranged in the original storage order or randomly.
  • the arranged data points may be equally divided into N sub-point clouds in order, for example, 1000 arranged data points are equally divided into 5 sub-point clouds, and each sub-point cloud includes 200 data points.
  • S122 Set a sampling radius for each sub-point cloud, wherein a sampling radius of the sub-point cloud with a larger curvature of the data point is smaller than a sampling radius of the sub-point cloud with a smaller curvature of the data point.
  • the specific value of the sampling radius may be determined according to the actual situation of the spatial range of the three-dimensional image, and is not specifically limited herein.
  • the curvature of a data point in a sub-point cloud is [0.01, 0.03), and the curvature of a data point in another sub-point cloud is (0.03, 0.04), and the data point in the previous sub-point cloud.
  • the curvature of the data point is smaller than the curvature of the data point in the next sub-point cloud.
  • the sampling radius of the previous sub-point cloud should be larger than the sampling radius of the latter sub-point cloud, for example, the previous sub-point.
  • the sampling radius of the cloud is set to 0.5, and the sampling radius of the latter sub-point cloud is set to 0.4.
  • step S122 includes:
  • sampling radius of the sub-point cloud is sequentially set to a decreasing arithmetic sequence with the first radius as an initial value in the order of increasing curvature; or the sampling radius of the sub-point cloud is sequentially set to the first in the order of decreasing curvature
  • the second radius is an incremental progression of the initial value.
  • the first radius is a preset maximum sampling radius
  • the second radius is a preset minimum sampling radius, and the specific value may be determined according to actual needs, and is not specifically limited herein.
  • the curvature of the data points in the first sub-point cloud is the smallest, and the sampling of the first sub-point cloud can be performed at this time.
  • the radius is set to the first radius b, and the sampling radius of the other sub-point clouds can be set according to the decreasing arithmetic progression column, that is, according to the following formula (1):
  • R is the sampling radius of the sub-point cloud
  • b is the first radius
  • a is the second radius
  • m is the number of sub-point clouds
  • I is the sequence number of the sub-point cloud.
  • the sequence number of the first sub-point cloud is 0, the sequence number of the second sub-point cloud is 2, and so on, and the sequence number of the m-th sub-point cloud is m-1.
  • the curvature of the data points in the first sub-point cloud is the largest, and the sampling radius of the first sub-point cloud can be set to the second radius a.
  • the sampling radius of other sub-point clouds can be set according to the incremental difference series, that is, according to the following formula (2):
  • R is the sampling radius of the sub-point cloud
  • b is the first radius
  • a is the second radius
  • m is the number of sub-point clouds
  • I is the sequence number of the sub-point cloud.
  • the sequence number of the first sub-point cloud is 0, the sequence number of the second sub-point cloud is 2, and so on, and the sequence number of the m-th sub-point cloud is m-1.
  • This embodiment can also be combined with the second embodiment of the point cloud sampling method of the present application.
  • each sub-point cloud may be sampled and then the sampled data points are combined, and finally the sampled point cloud may be obtained.
  • the fourth embodiment of the point cloud sampling method of the present application is based on the second embodiment of the point cloud sampling method of the present application, and further defines that the preset sampling order is an increasing or decreasing order of curvature, and The various sub-steps of step S13 are further defined.
  • step S131 includes:
  • S1311 Select a curvature minimum/maximum data point in the first sub-point cloud as an initial first data point, and obtain a position coordinate of the first data point.
  • the first sub-point cloud is a sub-point cloud currently being sampled, and when sampling, the data points may be selected in the order of increasing/decreasing curvature.
  • the data point with the largest/minimum curvature in the first sub-point cloud may be selected as the initial first data point, and the position coordinates thereof may be obtained, and the position coordinates may be three-dimensional European space coordinates.
  • step S132 includes:
  • S1321 Calculate a first distance between the other data points in the first sub-point cloud and the first data point.
  • the other data points in the first sub-point cloud are other data points in the first sub-point cloud except the current first data point.
  • the position coordinates of the first data point and other data points may be obtained, and the Euclidean distance between the two data points is calculated by using a formula, that is, the first distance.
  • step S133 includes:
  • S1331 Determine whether the first distance is smaller than a sampling radius corresponding to the first sub-point cloud.
  • each sub-point cloud has set a corresponding sampling radius, and after calculating the first distance between the first data point and the other data points, the first distance and the sampling radius corresponding to the first sub-point cloud may be For comparison, if the first distance is smaller than the sampling radius corresponding to the first sub-point cloud, if the determination result is time, step S1341 is performed.
  • S1341 Determine that the distance between the first data point and the second data point is smaller than a sampling radius corresponding to the first data point.
  • step S134 may be continued to delete the second data point.
  • step S1331 If the result of the determination in step S1331 is negative, it is determined that the distance between the first data point and the second data point is greater than or equal to the sampling radius corresponding to the first data point, and the step S135 may be continued to retain the second data. point.
  • step S136 includes:
  • S1361 Select another data point that is not deleted in the first sub-point cloud as the first data point in the order of increasing/decreasing the curvature, and return to performing the step of acquiring the position coordinates of the first data point until the traversing completes the first sub-point cloud. Undeleted data points.
  • the determination result is yes, it may be determined that the distance between the first data point and the second data point is smaller than the corresponding one of the first data points.
  • the sampling radius can be continued at step S1342, that is, the second data point is deleted. Otherwise, step S1351 is performed, that is, the second data point is reserved. Then, another data point that is not deleted in the first sub-point cloud may be selected as the first data point in the order of increasing or decreasing the curvature, and steps S131-S135 are repeatedly performed until the traversal is completed without deleting the first sub-point cloud.
  • the data points that is, the data points that are not deleted in the first sub-point cloud, have been sampled as the first data points.
  • the next data point is selected in the order of increasing curvature, and if the first selected data point is the data point with the largest curvature, the order of decreasing curvature is performed. Select the next data point.
  • step S1361 the method further includes:
  • S1371 Select another sub-point cloud that is not sampled, and return to perform the step of acquiring the position coordinates of the first data point until the traversal completes all the sub-point clouds.
  • each sub-point cloud may be sampled according to the step of the first sub-point cloud described above, until the sampling of all the sub-point clouds is completed, and the sampling process of the three-dimensional image point cloud data is completed.
  • each sub-point cloud after the sampling is completed may be combined to obtain the sampled point cloud data, and the point cloud data may be output or displayed, and the sampled three-dimensional image may be obtained.
  • the original point cloud data of the unsampled three-dimensional image is as shown in FIG. 7
  • the spatial distribution of the original point cloud data is relatively uniform, the data is dense, the amount of data is large, and the subsequent data processing process is cumbersome and consumes.
  • the duration of the three-dimensional image point cloud data processed by the point cloud sampling method of the present application is as shown in FIG. 8 , and the data density of the region where the curvature of the sampled point cloud data is small is small, the data points are sparse, and the curvature is large. Regional data density is large and data points are dense. It can be seen from the comparison between FIG. 7 and FIG. 8 that the point cloud sampling method of the present application can delete redundant data and streamline the point cloud while retaining feature points as much as possible, which is beneficial to improve the rate and efficiency of subsequent data processing.
  • This embodiment can also be combined with the third embodiment of the point cloud sampling method of the present application.
  • the curvature of the data point when calculating the curvature of the data point, can be calculated by using the eigenvalue method after fitting the neighborhood point plane.
  • step S11 includes:
  • S111 Acquire a neighborhood point where the first data point is within a preset distance.
  • the preset distance may be a preset range of the neighborhood, and the specific value may be determined according to actual requirements, and is not specifically limited herein.
  • a binary tree such as a KD-tree (KD-number) may be used to acquire all points within a preset distance R from the first data point, that is, neighbor points.
  • KD-number KD-number
  • an octree or other method may also be used to obtain the neighborhood point of the first data point.
  • Distance, d ⁇ 0.
  • the distance from any one of the neighborhood points (x i , y i , z i ) to the plane is
  • the unit normal vectors a, b, and c of the best fit plane can be obtained.
  • the eigenvalues of the real symmetric matrix A can be calculated by the following formula (11).
  • I is the identity matrix. Since A is a real symmetric matrix of 3*3, matrix A has at most three real eigenvalues, respectively ⁇ 0 , ⁇ 1 , ⁇ 2 , where ⁇ 0 is the minimum eigenvalue, and the curvature ⁇ of the first data point can be Calculated using the following formula (12)
  • the curvature ⁇ of the first data point is the ratio of the minimum eigenvalue of the feature matrix of the best fit plane to the sum of all the feature values.
  • the curvature of other data points can also be calculated by the above method, and will not be repeated here.
  • the curvature of each data point is calculated by using the eigenvalue method.
  • the curvature of the data point may be calculated by other methods such as least squares method, which is not specifically limited herein.
  • This embodiment can also be combined with any of the second to fourth embodiments of the point cloud sampling method of the present application or a combination thereof that does not conflict.
  • an embodiment of the image processing apparatus 20 of the present application includes: a communication circuit 201 and a processor 202 that are connected to each other.
  • the communication circuit 201 is configured to transmit and receive data, and is an interface that the image processing device 20 communicates with other devices. Specifically, the communication circuit 201 is configured to acquire point cloud data of a three-dimensional image.
  • the processor 202 controls the operation of the communication device, and the processor 202 may also be referred to as a CPU (Central Processing Unit).
  • Processor 202 may be an integrated circuit chip with signal processing capabilities.
  • the processor 202 can also be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the processor 202 is operative to execute a program to implement a method as provided by any one of the first to fifth embodiments of the point cloud sampling method of the present application or a non-conflicting combination thereof.
  • the image processing device 20 may further include other components such as a memory (not shown), which are not specifically limited herein.
  • the image processing device in this embodiment may be a mobile terminal, a fixed terminal, a server, or the like, or may be an integrated independent component such as an image processing chip.
  • the processor calculates the curvature of each data point in the point cloud data, and sets a sampling radius corresponding to each data point, wherein the curvature is larger.
  • the sampling radius corresponding to the data point is not larger than the sampling radius corresponding to the data point with the smaller curvature, and the sampling radius corresponding to the data point with at least part of the curvature is smaller than the sampling radius corresponding to the data point with the smaller curvature, and the sampling radius is used for the point cloud.
  • the data is sampled so that the data density of the region with larger curvature is larger than the region with smaller curvature, so that more data points are reserved in the region with larger curvature, and fewer data points are reserved in the region with less curvature, and then deleted.
  • retaining feature data is beneficial to improve the speed of subsequent data processing, while reducing storage space and saving costs.
  • the device 30 having a storage function internally stores an instruction 301.
  • the instruction 301 is executed, the first to fifth applications of the point cloud sampling method of the present application are implemented.
  • a sampling method provided by an embodiment or a combination thereof that does not conflict.
  • the device 30 having a storage function may be a portable storage medium such as a USB flash drive or an optical disk, or may be a terminal, a server, or an integrated independent component such as an image processing chip or the like.
  • the curvature of each data point in the point cloud data is calculated by acquiring the point cloud data of the three-dimensional image, and the sampling radius corresponding to each data point is set.
  • the sampling radius corresponding to the data point with larger curvature is not larger than the sampling radius corresponding to the data point with smaller curvature, and the sampling radius corresponding to at least part of the data point with larger curvature is smaller than the sampling radius corresponding to the data point with smaller curvature,
  • the sampling radius samples the point cloud data so that the data density of the region with larger curvature is larger than the region with smaller curvature, so that more data points are reserved in the region with larger curvature, and less data is retained in the region with smaller curvature.
  • Points, in addition to deleting redundant data retain feature data, which is beneficial to improve the speed of subsequent data processing, while reducing storage space and saving costs.

Abstract

A point cloud sampling method, an image processing device, and a device having a storage function. The point cloud sampling method comprises: acquiring point cloud data of a three-dimensional image (S10); calculating the curvatures of data points in the point cloud data (S11); configuring a sampling radius corresponding to the data points (S12); sampling the point cloud data on the basis of the sampling radius configured, thus allowing the data density of an area of a greater curvature to be greater than an area of a smaller curvature (S13). The method allows redundant data to be deleted while retaining an increased amount of feature data.

Description

点云采样方法、图像处理设备及具有存储功能的装置Point cloud sampling method, image processing device, and device having storage function 【技术领域】[Technical Field]
本申请涉及图像处理技术领域,特别是涉及一种点云采样方法、图像处理设备及具有存储功能的装置。The present application relates to the field of image processing technologies, and in particular, to a point cloud sampling method, an image processing device, and a device having a storage function.
【背景技术】【Background technique】
随着三维扫描技术的发展,使三维点云数据模型成为一种新兴数字媒体,在工业制造、建筑设计、产品展示、医学、电子商务等方面有着广泛的应用。由于现有三维扫描设备精度得到极大提高,扫描得到的点云数据具有极高精度的同时,包含了大量冗余数据,导致后续的数据处理过程复杂、速度慢。With the development of 3D scanning technology, the 3D point cloud data model has become an emerging digital media, which has been widely used in industrial manufacturing, architectural design, product display, medicine, and e-commerce. Since the accuracy of the existing three-dimensional scanning device is greatly improved, the scanned point cloud data has extremely high precision and contains a large amount of redundant data, which leads to complicated and slow data processing.
【发明内容】[Summary of the Invention]
本申请主要提供一种点云采样方法、图像处理设备及具有存储功能的装置,能够简化点云数据。The present application mainly provides a point cloud sampling method, an image processing device, and a device having a storage function, which can simplify point cloud data.
为解决上述技术问题,本申请采用的一个技术方案是:提供一种点云采样方法,包括:获取三维图像的点云数据;计算点云数据中每个数据点的曲率;设置每个数据点对应的采样半径,其中曲率较大的数据点对应的采样半径不大于曲率较小的数据点对应的采样半径,至少部分曲率较大的数据点对应的采样半径小于曲率较小的数据点对应的采样半径;以该采样半径对点云数据进行采样,以使得曲率较大的区域数据密度大于曲率较小的区域。To solve the above technical problem, a technical solution adopted by the present application is to provide a point cloud sampling method, including: acquiring point cloud data of a three-dimensional image; calculating a curvature of each data point in the point cloud data; setting each data point Corresponding sampling radius, wherein the sampling radius corresponding to the data point with larger curvature is not larger than the sampling radius corresponding to the data point with smaller curvature, and the sampling radius corresponding to at least part of the data point with larger curvature is smaller than the data point corresponding to the smaller curvature The sampling radius; the point cloud data is sampled by the sampling radius, so that the data density of the region with larger curvature is larger than the region with smaller curvature.
为解决上述技术问题,本申请采用的另一个技术方案是:提供一种图像处理设备,包括:相互连接的通信电路和处理器;通信电路用于获取三维图像的点云数据;该处理器用于计算点云数据中每个数据点的曲率;设置每个数据点对应的采样半径,其中曲率较大的数据点对应的采样半径不大于曲率较小的数据点对应的采样半径,至少部分曲率较大的数据点对应的采样半径小于曲率较小的数据点对应的采样半径;基于设置的采样半径对点云数据进行采样,以使得曲率较大的区域数据密度大于曲率较小的区域。In order to solve the above technical problem, another technical solution adopted by the present application is to provide an image processing apparatus including: a communication circuit and a processor connected to each other; a communication circuit for acquiring point cloud data of a three-dimensional image; Calculating the curvature of each data point in the point cloud data; setting a sampling radius corresponding to each data point, wherein the sampling radius corresponding to the data point having a larger curvature is not larger than the sampling radius corresponding to the data point having a smaller curvature, and at least part of the curvature is compared The sampling radius corresponding to the large data point is smaller than the sampling radius corresponding to the data point with the smaller curvature; the point cloud data is sampled based on the set sampling radius, so that the data density of the region with larger curvature is larger than the region with smaller curvature.
为解决上述技术问题,本申请采用的又一个技术方案是:提供一种具有存储功能的装置,存储有指令,该指令被执行时实现如上所述的点云采样方法。In order to solve the above technical problem, another technical solution adopted by the present application is to provide a device having a storage function, which stores an instruction, and when executed, implements a point cloud sampling method as described above.
本申请的有益效果是:区别于现有技术的情况,本申请的部分实施例中, 通过获取三维图像的点云数据,计算点云数据中每个数据点的曲率,设置每个数据点对应的采样半径,其中曲率较大的数据点对应的采样半径不大于曲率较小的数据点对应的采样半径,至少部分曲率较大的数据点对应的采样半径小于曲率较小的数据点对应的采样半径,以该采样半径对点云数据进行采样,以使得曲率较大的区域数据密度大于曲率较小的区域,从而在曲率较大的区域保留更多的数据点,在曲率较小的区域保留较少的数据点,进而在删除冗余数据的同时,保留特征数据,有利于提高后续数据处理的速度,同时减少存储空间,节约成本。The beneficial effects of the present application are: different from the prior art, in some embodiments of the present application, calculating the curvature of each data point in the point cloud data by acquiring the point cloud data of the three-dimensional image, and setting each data point correspondingly The sampling radius, wherein the sampling radius corresponding to the data point with larger curvature is not larger than the sampling radius corresponding to the data point with smaller curvature, and the sampling radius corresponding to at least part of the data point with larger curvature is smaller than the sampling corresponding to the data point with smaller curvature Radius, the point cloud data is sampled by the sampling radius, so that the data density of the region with larger curvature is larger than the region with smaller curvature, so that more data points are reserved in the region with larger curvature and remain in the region with less curvature. Less data points, in addition to deleting redundant data, retain feature data, which is beneficial to improve the speed of subsequent data processing, while reducing storage space and saving costs.
【附图说明】[Description of the Drawings]
图1是本申请点云采样方法第一实施例的流程示意图;1 is a schematic flow chart of a first embodiment of a point cloud sampling method according to the present application;
图2是本申请点云采样方法第二实施例的流程示意图;2 is a schematic flow chart of a second embodiment of a point cloud sampling method according to the present application;
图3是第一数据点和第二数据点的空间位置示意图;3 is a schematic diagram showing the spatial position of a first data point and a second data point;
图4是本申请点云采样方法第三实施例的流程示意图;4 is a schematic flow chart of a third embodiment of a point cloud sampling method according to the present application;
图5是图4中各步骤的具体流程示意图;Figure 5 is a schematic diagram of a specific process of each step in Figure 4;
图6是本申请点云采样方法第四实施例的流程示意图;6 is a schematic flowchart of a fourth embodiment of a point cloud sampling method according to the present application;
图7是未进行采样的三维图像原始点云数据示意图;7 is a schematic diagram of raw point cloud data of a three-dimensional image that is not sampled;
图8是利用本申请点云采样方法处理后的三维图像点云数据示意图;8 is a schematic diagram of three-dimensional image point cloud data processed by the point cloud sampling method of the present application;
图9是本申请点云采样方法第五实施例的流程示意图;9 is a schematic flowchart of a fifth embodiment of a point cloud sampling method according to the present application;
图10是本申请图像处理设备一实施例的结构示意图;10 is a schematic structural diagram of an embodiment of an image processing apparatus of the present application;
图11是本申请具有存储功能的装置一实施例的结构示意图。FIG. 11 is a schematic structural diagram of an embodiment of an apparatus having a storage function according to the present application.
【具体实施方式】【detailed description】
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
如图1所示,本申请点云采样方法第一实施例包括:As shown in FIG. 1 , the first embodiment of the point cloud sampling method of the present application includes:
S10:获取三维图像的点云数据。S10: Acquire point cloud data of a three-dimensional image.
点云是表达物体表面的大量数据点,每个数据点均可以用三维坐标表示。其中,该点云数据至少包括表达该三维图像轮廓的多个数据点的位置坐标,可 以直接利用三维扫描设备扫描得到目标的三维点云数据,也可以是从存储设备或其他设备中获取预先存储的三维图像的点云数据,此处不做具体限定。A point cloud is a large number of data points that express the surface of an object. Each data point can be represented by three-dimensional coordinates. The point cloud data includes at least a position coordinate of a plurality of data points that express the contour of the three-dimensional image, and the third-dimensional point cloud data of the target may be directly scanned by using the three-dimensional scanning device, or may be pre-stored from a storage device or other device. The point cloud data of the three-dimensional image is not specifically limited herein.
S11:计算点云数据中每个数据点的曲率。S11: Calculate the curvature of each data point in the point cloud data.
点云中的数据点通常没有显式的几何拓扑关系,通常采用平面拟合的方法获取拟合平面的曲率,以此作为数据点的曲率。其中,平面拟合的方法可以采用特征值法或最小二乘法等。The data points in the point cloud usually do not have an explicit geometric topological relationship. Usually, the plane fitting method is used to obtain the curvature of the fitted plane as the curvature of the data points. Among them, the method of plane fitting can adopt the eigenvalue method or the least square method.
S12:设置每个数据点对应的采样半径。S12: Set the sampling radius corresponding to each data point.
每个数据点的曲率可以表示该数据点的弯曲程度,曲率较大的数据点所处的局部区域弯曲程度较大,曲率较小的数据点所处的局部区域弯曲程度较小,比较平坦。其中,弯曲程度较大的局部区域包含更多能体现三维图像空间特征的特征数据点。The curvature of each data point can indicate the degree of curvature of the data point. The local area where the data point with larger curvature is more curved, and the local area where the data point with smaller curvature is less curved and relatively flat. Among them, the local area with a large degree of curvature contains more characteristic data points that can reflect the spatial characteristics of the three-dimensional image.
采样半径定义了以数据点为中心,以对应的采样半径为半径的一个圆形采样区域,每个采样区域内采样数据量相同。本实施例中,设置数据点对应的采样半径时,曲率较大的数据点对应的采样半径不大于曲率较小的数据点对应的采样半径,且至少部分曲率较大的数据点对应的采样半径小于曲率较小的数据点对应的采样半径。The sampling radius defines a circular sampling area centered on the data point and having a radius corresponding to the sampling radius, and the amount of sampled data is the same in each sampling area. In this embodiment, when the sampling radius corresponding to the data point is set, the sampling radius corresponding to the data point with larger curvature is not larger than the sampling radius corresponding to the data point with smaller curvature, and the sampling radius corresponding to the data point with at least partial curvature is larger. The sampling radius corresponding to the data point smaller than the curvature.
例如,设置一个采样半径范围,如[a,b],其中a为最小采样半径,b为最大采样半径。在设置每个数据点对应的采样半径时,可以将曲率最大的数据点对应的采样半径设置为a,曲率最小的数据点对应的采样半径设置为b,同时获取数据点的个数N,可以设置采样半径为等差数列,即设置每两个数据点对应的采样半径差值为(b-a)/N,将数据点按照从小到大的顺序设置对应的采样半径,其中对应的采样半径是从大到小变化。For example, set a range of sampling radii, such as [a,b], where a is the minimum sampling radius and b is the maximum sampling radius. When setting the sampling radius corresponding to each data point, the sampling radius corresponding to the data point with the largest curvature can be set to a, the sampling radius corresponding to the data point with the smallest curvature is set to b, and the number N of the data points can be obtained at the same time. Set the sampling radius to the arithmetic progression column, that is, set the sampling radius difference corresponding to each two data points to (ba)/N, and set the corresponding sampling radius according to the order of the data points from small to large, wherein the corresponding sampling radius is from Big to small changes.
当然,在其他应用例中,也可以设置某个曲率范围内的多个数据点对应的采样半径为同一个值,此处不做具体限定。Of course, in other applications, the sampling radius corresponding to multiple data points in a certain curvature range may be set to the same value, which is not specifically limited herein.
S13:基于设置的采样半径对点云数据进行采样,以使得曲率较大的区域数据密度大于曲率较小的区域。S13: The point cloud data is sampled based on the set sampling radius, so that the data density of the region with larger curvature is larger than the region with smaller curvature.
具体地,基于设置的采样半径对点云数据进行采样时,可以按照预设的顺序选择数据点进行采样,其中该预设的顺序可以是曲率递增/递减顺序,也可以是其他预先设置的顺序,或者随机选择数据点进行采样,此处不做具体限定。Specifically, when the point cloud data is sampled based on the set sampling radius, the data points may be selected in a preset order for sampling, wherein the preset order may be an increasing or decreasing order of curvature, or may be other preset sequences. , or randomly select data points for sampling, which is not specifically limited herein.
在一个应用例中,首先选择曲率最小的数据点进行采样,采样时,可以删除部分位于以该曲率最小的数据点为中心的采样区域内的数据点。其中,保留 的数据点的个数和位置可以根据实际需求设置,如只保留中心数据点,或者只保留中心数据点和离该中心数据点最近的数据点等。然后,按照曲率递增的顺序选择下一个未删除的数据点进行采样,采样过程与上述过程相同,直到完成所有未删除数据点的采样。采样完成后,由于每个采样半径保留的数据点相同,但是曲率较大的数据点的采样半径不大于曲率较小的数据点的采样半径,且至少部分曲率较大的数据点的采样半径是小于曲率较小的数据点的采样半径,因此,曲率较大的区域单位面积的数据点个数要多于曲率较小的区域,即曲率较大的区域的数据密度要大于曲率较小的区域的数据密度。由此,在精简点云中数据点的同时,弯曲程度较大的区域能够保留较多的数据点,即尽量保留较多的特征点,有利于提高后续数据处理的速度,同时还可以减少存储空间,节约成本。In one application, the data points with the smallest curvature are first selected for sampling. When sampling, the data points in the sampling region centered on the data point with the smallest curvature can be deleted. The number and location of the reserved data points can be set according to actual needs, such as only retaining the central data point, or only retaining the central data point and the data point closest to the central data point. Then, the next undeleted data point is selected in the order of increasing curvature, and the sampling process is the same as the above process until all the samples of the undeleted data points are completed. After the sampling is completed, the data points retained by each sampling radius are the same, but the sampling radius of the data points with larger curvature is not larger than the sampling radius of the data points with smaller curvature, and the sampling radius of the data points with at least partial curvature is The sampling radius of the data point smaller than the curvature is smaller. Therefore, the area of the area with larger curvature has more data points per unit area than the area with smaller curvature, that is, the data density of the area with larger curvature is larger than the area with smaller curvature. Data density. Therefore, while streamlining the data points in the point cloud, the area with a large degree of curvature can retain more data points, that is, retaining more feature points as much as possible, which is beneficial to improve the speed of subsequent data processing, and can also reduce storage. Space, saving costs.
其他实施例中,在基于采样半径进行采样时,为了最大限度的删除冗余数据,可以仅保留中心数据点。In other embodiments, in order to maximize the deletion of redundant data when sampling based on the sampling radius, only the central data points may be retained.
具体如图2所示,本申请点云采样方法第二实施例是在本申请点云采样方法第一实施例的基础上,进一步限定步骤S13包括:As shown in FIG. 2, the second embodiment of the point cloud sampling method of the present application is based on the first embodiment of the point cloud sampling method of the present application, and further defining step S13 includes:
S131:获取第一数据点的位置坐标。S131: Acquire a position coordinate of the first data point.
其中,该第一数据点是随机或按预设的顺序选择的采样区域的中心点。该第一数据点的位置坐标是三维坐标,可以采用欧式空间的三维坐标表示,如(x 1,y 1,z 1)。 The first data point is a center point of a sampling area that is randomly or in a preset order. The position coordinates of the first data point are three-dimensional coordinates, which can be represented by three-dimensional coordinates of the European space, such as (x 1 , y 1 , z 1 ).
S132:计算第一数据点和第二数据点的距离。S132: Calculate the distance between the first data point and the second data point.
其中,该第二数据点是除第一数据点以外的至少部分数据点。该第二数据点可以是除第一数据点外的其他数据点,也可以是除第一数据点外的部分数据点,例如将数据点分成多个部分同时进行采样时,该第二数据点则是采样部分数据点中除第一数据点外的其他数据点。Wherein the second data point is at least part of the data point except the first data point. The second data point may be other data points than the first data point, or may be part of the data points except the first data point, for example, when the data point is divided into multiple parts and simultaneously sampled, the second data point It is the other data points in the sampled data points except the first data point.
S133:判断该距离是否小于第一数据点对应的采样半径。S133: Determine whether the distance is smaller than a sampling radius corresponding to the first data point.
若判断结果为是,则执行步骤S134,否则执行步骤S135。If the result of the determination is yes, then step S134 is performed, otherwise step S135 is performed.
S134:删除该第二数据点。S134: Delete the second data point.
S135:保留该第二数据点。S135: The second data point is reserved.
S136:按照预设采样顺序选择未删除的另一个数据点作为第一数据点,重复执行上述步骤,直至遍历完成所有未删除的数据点。S136: Select another data point that is not deleted as the first data point according to the preset sampling order, and repeat the above steps until the traversal completes all the undeleted data points.
其中,该预设采样顺序是预先设置的顺序,可以是曲率变化顺序,也可以是空间位置顺序,有或者随机存储顺序等,此处不做具体限定。The preset sampling sequence is a preset sequence, which may be a sequence of curvature changes, a sequence of spatial positions, or a random storage order, and is not specifically limited herein.
具体地,在一个应用例中,该第二数据点是除第一数据点以外的其他数据点,进行采样时,需要先获取第一数据点和第二数据点的位置坐标,例如图3所示的点A(x 1,y 1,z 1)和点B(x 2,y 2,z 2),然后计算该第一数据点和第二数据点之间的距离,如计算第一数据点A和第二数据点B之间的欧式距离
Figure PCTCN2018114433-appb-000001
得到该距离d后,将该距离d与该第一数据点A对应的采样半径R1进行比较,若该距离d小于该采样半径R1,则表明该第二数据点B位于以第一数据点A为中心,以采样半径R1为半径的圆形区域内,此时,则删除该第二数据点B。而当该第二数据点不位于以第一数据点A为中心,以采样半径R1为半径的圆形区域内时,如图3中的点C(x 3,y 3,z 3),点C与点A之间的距离大于该采样半径R1,此时,保留该第二数据点C。然后,可以按照预设采样顺序继续选择未删除的另一个数据点作为该第一数据点,重复执行上述采样步骤,直至遍历完成所有未删除的数据点,即所有未删除的数据点均以作为第一数据点执行过上述采样步骤,则采样过程完成。经过上述采样过程后,每个数据点作为第一数据点之后,其对应的采样半径形成的采样区域内,仅保留其自身,采样区域内的其他数据点均被删除,从而删除了冗余数据,精简了点云,也减少了存储空间,有利于提高后续数据处理的速度,提升效率。
Specifically, in an application example, the second data point is a data point other than the first data point, and when sampling, the position coordinates of the first data point and the second data point need to be acquired first, for example, FIG. 3 Point A (x 1 , y 1 , z 1 ) and point B (x 2 , y 2 , z 2 ), and then calculate the distance between the first data point and the second data point, such as calculating the first data Euclidean distance between point A and second data point B
Figure PCTCN2018114433-appb-000001
After the distance d is obtained, the distance d is compared with the sampling radius R1 corresponding to the first data point A. If the distance d is smaller than the sampling radius R1, it indicates that the second data point B is located at the first data point A. For the center, in the circular area with the radius of the sampling radius R1 as the radius, at this time, the second data point B is deleted. When the second data point is not located in a circular area centered on the first data point A and having a radius of the sampling radius R1, as shown by the point C (x 3 , y 3 , z 3 ) in FIG. 3, The distance between C and point A is greater than the sampling radius R1, at which time the second data point C is retained. Then, another data point that has not been deleted may be continuously selected as the first data point according to a preset sampling sequence, and the above sampling step is repeatedly performed until the traversal completes all the undeleted data points, that is, all the undeleted data points are taken as The first data point performs the above sampling step, and the sampling process is completed. After the above sampling process, after each data point is used as the first data point, the sampling area formed by the corresponding sampling radius retains only itself, and other data points in the sampling area are deleted, thereby deleting redundant data. The streamlined point cloud also reduces the storage space, which is beneficial to improve the speed of subsequent data processing and improve efficiency.
在其他实施例中,可以将点云数据划分成多个子点云后设置采样半径进行采样。In other embodiments, the point cloud data may be divided into a plurality of sub-point clouds and the sampling radius is set for sampling.
具体如图4所示,本申请点云采样方法第三实施例是在本申请点云采样方法第一实施例的基础上,进一步限定步骤S12包括:As shown in FIG. 4, the third embodiment of the point cloud sampling method of the present application is based on the first embodiment of the point cloud sampling method of the present application, and further defining step S12 includes:
S121:将数据点按预设曲率顺序排列后划分为多个子点云。S121: The data points are arranged in a preset curvature order and then divided into a plurality of sub-point clouds.
其中,该预设曲率顺序可以是曲率递增/递减顺序,也可以是曲率递增之后递减顺序,还可以是曲率递减之后递增顺序,具体视实际需求而定,此处不做具体限定。The preset curvature order may be an increasing or decreasing order of curvature, or may be a decreasing order after the curvature is incremented, or may be an increasing order after the decreasing of the curvature, which is determined according to actual needs, and is not specifically limited herein.
划分的子点云的数量至少为两个,具体数量可以根据实际需求设置,例如5个子点云。其中每个子点云中数据点的数量可以相同,也可以不同,此处不做具体限定。The number of sub-point clouds divided is at least two, and the specific number can be set according to actual needs, for example, five sub-point clouds. The number of data points in each sub-point cloud may be the same or different, and is not specifically limited herein.
当然,在其他实施例中,划分子点云时,可以为每个子点云设置一个曲率 范围,将落入对应曲率范围内的数据点划分到对应的子点云中,然后再进行排列。Of course, in other embodiments, when dividing the sub-point cloud, a curvature range may be set for each sub-point cloud, and data points falling within the corresponding curvature range are divided into corresponding sub-point clouds, and then arranged.
可选地,如图5所示,步骤S121包括:Optionally, as shown in FIG. 5, step S121 includes:
S1211:将数据点按曲率递增/递减的顺序排列。S1211: Arrange the data points in the order of increasing/decrementing the curvature.
S1212:将排列后的数据点依次平均划分为多个子点云。S1212: The ranked data points are equally divided into a plurality of sub-point clouds.
具体地,在一个应用例中,计算得到每个数据点的曲率后,可以将数据点按照曲率递增/递减的顺序进行排列,例如1000个数据按照曲率递增的顺序排列,其中曲率相同的数据点可以按照原始存储顺序排列,或者随机排列。划分子点云时,可以将排列后的数据点依次平均划分为N个子点云,例如将1000个排列后的数据点依次平均划分为5个子点云,每个子点云包括200个数据点。Specifically, in an application example, after calculating the curvature of each data point, the data points may be arranged in the order of increasing/decreasing curvature, for example, 1000 data are arranged in increasing order of curvature, wherein the data points having the same curvature They can be arranged in the original storage order or randomly. When dividing the sub-point cloud, the arranged data points may be equally divided into N sub-point clouds in order, for example, 1000 arranged data points are equally divided into 5 sub-point clouds, and each sub-point cloud includes 200 data points.
S122:为每个子点云设置一个采样半径,其中数据点曲率较大的子点云的采样半径小于数据点曲率较小的子点云的采样半径。S122: Set a sampling radius for each sub-point cloud, wherein a sampling radius of the sub-point cloud with a larger curvature of the data point is smaller than a sampling radius of the sub-point cloud with a smaller curvature of the data point.
其中,采样半径的具体数值可以根据三维图像的空间范围等实际情况决定,此处不做具体限定。The specific value of the sampling radius may be determined according to the actual situation of the spatial range of the three-dimensional image, and is not specifically limited herein.
在一个应用例中,一个子点云中数据点的曲率范围为[0.01,0.03),另一个子点云中数据点的曲率范围为(0.03,0.04],则前一个子点云中数据点的曲率小于后一个子点云中数据点的曲率,此时,为子点云设置采样半径时,前一个子点云的采样半径应大于后一个子点云的采样半径,例如前一个子点云的采样半径设置为0.5,后一个子点云的采样半径设置为0.4。In one application, the curvature of a data point in a sub-point cloud is [0.01, 0.03), and the curvature of a data point in another sub-point cloud is (0.03, 0.04), and the data point in the previous sub-point cloud. The curvature of the data point is smaller than the curvature of the data point in the next sub-point cloud. At this time, when the sampling radius is set for the sub-point cloud, the sampling radius of the previous sub-point cloud should be larger than the sampling radius of the latter sub-point cloud, for example, the previous sub-point. The sampling radius of the cloud is set to 0.5, and the sampling radius of the latter sub-point cloud is set to 0.4.
可选地,继续参阅图5,步骤S122包括:Optionally, referring to FIG. 5, step S122 includes:
S1221:按曲率递增的顺序,将子点云的采样半径依次设置为以第一半径为初始值的递减等差数列;或者按曲率递减的顺序,将子点云的采样半径依次设置为以第二半径为初始值的递增等差数列。S1221: The sampling radius of the sub-point cloud is sequentially set to a decreasing arithmetic sequence with the first radius as an initial value in the order of increasing curvature; or the sampling radius of the sub-point cloud is sequentially set to the first in the order of decreasing curvature The second radius is an incremental progression of the initial value.
其中,第一半径是预先设置的最大的采样半径,第二半径是预先设置的最小采样半径,其具体取值可以根据实际需求而定,此处不做具体限定。The first radius is a preset maximum sampling radius, and the second radius is a preset minimum sampling radius, and the specific value may be determined according to actual needs, and is not specifically limited herein.
具体地,在一个应用例中,当按照曲率递增的顺序将数据点依次划分为m个子点云时,第1个子点云中数据点的曲率最小,此时可以将第1个子点云的采样半径设置为第一半径b,其他子点云的采样半径可以根据递减等差数列进行设置,即按照如下公式(1)进行设置:Specifically, in an application example, when data points are sequentially divided into m sub-point clouds in order of increasing curvature, the curvature of the data points in the first sub-point cloud is the smallest, and the sampling of the first sub-point cloud can be performed at this time. The radius is set to the first radius b, and the sampling radius of the other sub-point clouds can be set according to the decreasing arithmetic progression column, that is, according to the following formula (1):
Figure PCTCN2018114433-appb-000002
Figure PCTCN2018114433-appb-000002
其中,R是子点云的采样半径,b是第一半径,a是第二半径,m是子点云的个数,I是子点云的序号。第1个子点云的序号为0,第2个子点云的序号为2,以此类推,第m个子点云的序号为m-1。其中,a>0,b>0,a<b。Where R is the sampling radius of the sub-point cloud, b is the first radius, a is the second radius, m is the number of sub-point clouds, and I is the sequence number of the sub-point cloud. The sequence number of the first sub-point cloud is 0, the sequence number of the second sub-point cloud is 2, and so on, and the sequence number of the m-th sub-point cloud is m-1. Where a>0, b>0, a<b.
而当按照曲率递减的顺序将数据点依次划分为m个子点云时,第1个子点云中数据点的曲率最大,此时可以将第1个子点云的采样半径设置为第二半径a,其他子点云的采样半径可以根据递增等差数列进行设置,即按照如下公式(2)进行设置:When the data points are sequentially divided into m sub-point clouds in the order of decreasing curvature, the curvature of the data points in the first sub-point cloud is the largest, and the sampling radius of the first sub-point cloud can be set to the second radius a. The sampling radius of other sub-point clouds can be set according to the incremental difference series, that is, according to the following formula (2):
Figure PCTCN2018114433-appb-000003
Figure PCTCN2018114433-appb-000003
其中,R是子点云的采样半径,b是第一半径,a是第二半径,m是子点云的个数,I是子点云的序号。第1个子点云的序号为0,第2个子点云的序号为2,以此类推,第m个子点云的序号为m-1。其中,a>0,b>0,a<b。Where R is the sampling radius of the sub-point cloud, b is the first radius, a is the second radius, m is the number of sub-point clouds, and I is the sequence number of the sub-point cloud. The sequence number of the first sub-point cloud is 0, the sequence number of the second sub-point cloud is 2, and so on, and the sequence number of the m-th sub-point cloud is m-1. Where a>0, b>0, a<b.
本实施例还可以与本申请点云采样方法第二实施例相结合。This embodiment can also be combined with the second embodiment of the point cloud sampling method of the present application.
其他实施例中,划分多个子点云后,可以对每个子点云进行采样后再将采样后的数据点进行合并,最终可以得到采样后的点云。In other embodiments, after dividing a plurality of sub-point clouds, each sub-point cloud may be sampled and then the sampled data points are combined, and finally the sampled point cloud may be obtained.
具体地,如图6所示,本申请点云采样方法第四实施例是在本申请点云采样方法第二实施例的基础上,进一步限定该预设采样顺序是曲率递增/递减顺序,并进一步限定步骤S13的各个子步骤。Specifically, as shown in FIG. 6 , the fourth embodiment of the point cloud sampling method of the present application is based on the second embodiment of the point cloud sampling method of the present application, and further defines that the preset sampling order is an increasing or decreasing order of curvature, and The various sub-steps of step S13 are further defined.
其中,步骤S131包括:Wherein, step S131 includes:
S1311:选择第一子点云中曲率最小/最大数据点作为初始的第一数据点,并获取该第一数据点的位置坐标。S1311: Select a curvature minimum/maximum data point in the first sub-point cloud as an initial first data point, and obtain a position coordinate of the first data point.
其中,该第一子点云是当前进行采样的子点云,进行采样时,可以按照曲率递增/递减的顺序选择数据点。首先可以选择该第一子点云中曲率最大/最小的数据点作为初始的第一数据点,获取其位置坐标,该位置坐标可以是三维欧式空间坐标。The first sub-point cloud is a sub-point cloud currently being sampled, and when sampling, the data points may be selected in the order of increasing/decreasing curvature. First, the data point with the largest/minimum curvature in the first sub-point cloud may be selected as the initial first data point, and the position coordinates thereof may be obtained, and the position coordinates may be three-dimensional European space coordinates.
如图6所示,第二数据点是该第一子点云中除第一数据点外的其他数据点,则步骤S132包括:As shown in FIG. 6, the second data point is other data points in the first sub-point cloud except the first data point, and step S132 includes:
S1321:计算第一子点云中其他数据点与该第一数据点的第一距离。S1321: Calculate a first distance between the other data points in the first sub-point cloud and the first data point.
其中,第一子点云中其他数据点是该第一子点云中除当前第一数据点外的其他数据点。计算其他数据点与该第一数据点之间的第一距离时,可以获取该第一数据点和其他数据点的位置坐标,利用公式计算两个数据点之间的欧式距 离,即该第一距离。The other data points in the first sub-point cloud are other data points in the first sub-point cloud except the current first data point. When calculating the first distance between the other data points and the first data point, the position coordinates of the first data point and other data points may be obtained, and the Euclidean distance between the two data points is calculated by using a formula, that is, the first distance.
如图6所示,步骤S133包括:As shown in FIG. 6, step S133 includes:
S1331:判断第一距离是否小于第一子点云对应的采样半径。S1331: Determine whether the first distance is smaller than a sampling radius corresponding to the first sub-point cloud.
具体地,每个子点云均已经设置对应的采样半径,计算得到第一数据点和其他数据点之间的第一距离后,可以将该第一距离和该第一子点云对应的采样半径进行比较,若该第一距离小于第一子点云对应的采样半径,则判断结果为时,执行步骤S1341。Specifically, each sub-point cloud has set a corresponding sampling radius, and after calculating the first distance between the first data point and the other data points, the first distance and the sampling radius corresponding to the first sub-point cloud may be For comparison, if the first distance is smaller than the sampling radius corresponding to the first sub-point cloud, if the determination result is time, step S1341 is performed.
S1341:判定第一数据点和第二数据点之间的距离小于第一数据点对应的采样半径。S1341: Determine that the distance between the first data point and the second data point is smaller than a sampling radius corresponding to the first data point.
判定该第一数据点和第二数据点之间的距离小于第一数据点对应的采样半径后,可以继续执行步骤S134,删除该第二数据点。After determining that the distance between the first data point and the second data point is smaller than the sampling radius corresponding to the first data point, step S134 may be continued to delete the second data point.
若步骤S1331的判断结果为否,则判定该第一数据点和第二数据点之间的距离大于或等于第一数据点对应的采样半径,此时可以继续执行步骤S135,保留该第二数据点。If the result of the determination in step S1331 is negative, it is determined that the distance between the first data point and the second data point is greater than or equal to the sampling radius corresponding to the first data point, and the step S135 may be continued to retain the second data. point.
继续参阅图6,步骤S136包括:With continued reference to Figure 6, step S136 includes:
S1361:按照曲率递增/递减的顺序选择第一子点云中未删除的另一数据点作为第一数据点,返回执行获取第一数据点的位置坐标的步骤,直至遍历完成第一子点云未删除的数据点。S1361: Select another data point that is not deleted in the first sub-point cloud as the first data point in the order of increasing/decreasing the curvature, and return to performing the step of acquiring the position coordinates of the first data point until the traversing completes the first sub-point cloud. Undeleted data points.
具体地,若该第一距离小于第一子点云对应的采样半径,则判断结果为是时,则可以判定该第一数据点和第二数据点之间的距离小于第一数据点对应的采样半径,此时可以继续执行步骤S1342,即删除该第二数据点。否则,执行步骤S1351,即保留该第二数据点。然后,可以继续按照曲率递增/递减的顺序选择第一子点云中未删除的另一个数据点作为第一数据点,重复执行步骤S131~S135,直至遍历完成第一子点云中未删除的数据点,即第一子点云中未删除的数据点均已经作为第一数据点进行采样。其中,若初始选择的第一数据点是曲率最小的数据点,则按照曲率递增的顺序选择下一个数据点,若初始选择的第一数据点是曲率最大的数据点,则按照曲率递减的顺序选择下一个数据点。Specifically, if the first distance is smaller than the sampling radius corresponding to the first sub-point cloud, if the determination result is yes, it may be determined that the distance between the first data point and the second data point is smaller than the corresponding one of the first data points. The sampling radius can be continued at step S1342, that is, the second data point is deleted. Otherwise, step S1351 is performed, that is, the second data point is reserved. Then, another data point that is not deleted in the first sub-point cloud may be selected as the first data point in the order of increasing or decreasing the curvature, and steps S131-S135 are repeatedly performed until the traversal is completed without deleting the first sub-point cloud. The data points, that is, the data points that are not deleted in the first sub-point cloud, have been sampled as the first data points. Wherein, if the initially selected first data point is the data point with the smallest curvature, the next data point is selected in the order of increasing curvature, and if the first selected data point is the data point with the largest curvature, the order of decreasing curvature is performed. Select the next data point.
可选地,步骤S1361之后,进一步包括:Optionally, after step S1361, the method further includes:
S1371:选择未采样的另一个子点云,返回执行获取第一数据点的位置坐标的步骤,直至遍历完成所有子点云。S1371: Select another sub-point cloud that is not sampled, and return to perform the step of acquiring the position coordinates of the first data point until the traversal completes all the sub-point clouds.
具体地,每个子点云均可以按照上述第一子点云的步骤进行采样,直至完 成所有子点云的采样,则该三维图像点云数据的采样过程即全部完成。此时,还可以将采样完成后的各个子点云进行合并后,得到采样完成的点云数据,输出或显示该点云数据,则可以得到采样后的三维图像。Specifically, each sub-point cloud may be sampled according to the step of the first sub-point cloud described above, until the sampling of all the sub-point clouds is completed, and the sampling process of the three-dimensional image point cloud data is completed. At this time, each sub-point cloud after the sampling is completed may be combined to obtain the sampled point cloud data, and the point cloud data may be output or displayed, and the sampled three-dimensional image may be obtained.
例如图7和图8所示,未进行采样的三维图像原始点云数据如图7所示,该原始点云数据空间分布比较均匀,数据密集,数据量较大,后续数据处理过程繁琐,耗时长,经过本申请点云采样方法处理后的三维图像点云数据如图8所示,该采样后的点云数据曲率较小的区域数据密度较小,数据点较为稀疏,而曲率较大的区域数据密度较大,数据点较为密集。由图7和图8的对比可以看出,利用本申请的点云采样方法可以在删除冗余数据,精简点云的同时,尽量保留特征点,有利于提高后续数据处理的速率和效率。For example, as shown in FIG. 7 and FIG. 8 , the original point cloud data of the unsampled three-dimensional image is as shown in FIG. 7 , and the spatial distribution of the original point cloud data is relatively uniform, the data is dense, the amount of data is large, and the subsequent data processing process is cumbersome and consumes. The duration of the three-dimensional image point cloud data processed by the point cloud sampling method of the present application is as shown in FIG. 8 , and the data density of the region where the curvature of the sampled point cloud data is small is small, the data points are sparse, and the curvature is large. Regional data density is large and data points are dense. It can be seen from the comparison between FIG. 7 and FIG. 8 that the point cloud sampling method of the present application can delete redundant data and streamline the point cloud while retaining feature points as much as possible, which is beneficial to improve the rate and efficiency of subsequent data processing.
本实施例还可以与本申请点云采样方法第三实施例相结合。This embodiment can also be combined with the third embodiment of the point cloud sampling method of the present application.
本申请的点云采样方法中,计算数据点的曲率时,可以利用邻域点平面拟合后,采用特征值方法计算数据点的曲率。In the point cloud sampling method of the present application, when calculating the curvature of the data point, the curvature of the data point can be calculated by using the eigenvalue method after fitting the neighborhood point plane.
具体如图9所示,本申请点云采样方法第五实施例是在本申请点云采样方法第一实施例的基础上,进一步限定步骤S11包括:As shown in FIG. 9 , the fifth embodiment of the point cloud sampling method of the present application is based on the first embodiment of the point cloud sampling method of the present application, and further defining step S11 includes:
S111:获取第一数据点在预设距离内的邻域点。S111: Acquire a neighborhood point where the first data point is within a preset distance.
其中,该预设距离可以是预先设置的邻域范围,具体取值可以根据实际需求而定,此处不做具体限定。The preset distance may be a preset range of the neighborhood, and the specific value may be determined according to actual requirements, and is not specifically limited herein.
具体地,在一个应用例中,可以利用二叉树,例如KD-tree(K-dimensional tree,KD数)获取与第一数据点距离在预设距离R内的所有点,即邻域点。当然,在其他实施例中,也可以采用八叉树或其他方法获取第一数据点的邻域点。Specifically, in an application example, a binary tree, such as a KD-tree (KD-number), may be used to acquire all points within a preset distance R from the first data point, that is, neighbor points. Of course, in other embodiments, an octree or other method may also be used to obtain the neighborhood point of the first data point.
S112:利用特征值法将邻域点拟合平面方程,以得到最佳拟合平面的特征矩阵。S112: Using a eigenvalue method to fit a neighborhood point to a plane equation to obtain a feature matrix of a best fit plane.
具体地,首先设定空间平面方程为ax+by+cz=d,其中,a、b、c为平面的单位法向量,即a 2+b 2+c 2=1,d为坐标原点至平面的距离,d≥0。任意一个邻域点(x i,y i,z i)至该平面的距离为 Specifically, first, the spatial plane equation is set to ax+by+cz=d, where a, b, and c are unit normal vectors of the plane, that is, a 2 +b 2 +c 2 =1, and d is the coordinate origin to the plane. Distance, d ≥ 0. The distance from any one of the neighborhood points (x i , y i , z i ) to the plane is
d i=|ax i+by i+cz i-d|;     (3) d i =|ax i +by i +cz i -d|; (3)
为了获得最佳拟合平面,则应在条件a 2+b 2+c 2=1下满足: In order to obtain the best fit plane, it should be satisfied under the condition a 2 + b 2 + c 2 =1:
Figure PCTCN2018114433-appb-000004
Figure PCTCN2018114433-appb-000004
利用拉格朗日乘数法求该函数极值,可得到如下函数:Using the Lagrangian multiplier method to find the extremum of the function, you can get the following function:
Figure PCTCN2018114433-appb-000005
Figure PCTCN2018114433-appb-000005
将上述公式(5)对d求导,并令导数为零可以计算得到Deriving the above formula (5) for d and making the derivative zero can be calculated.
Figure PCTCN2018114433-appb-000006
Figure PCTCN2018114433-appb-000006
其中:
Figure PCTCN2018114433-appb-000007
among them:
Figure PCTCN2018114433-appb-000007
将上述公式(5)对a求导,并令导数为零可以得到Let the above formula (5) be derived for a, and let the derivative be zero.
Figure PCTCN2018114433-appb-000008
Figure PCTCN2018114433-appb-000008
其中:
Figure PCTCN2018114433-appb-000009
同理,将公式(5)分别对b、c求导,并令导数为零可以得到
among them:
Figure PCTCN2018114433-appb-000009
Similarly, formula (5) is derived for b and c, respectively, and the derivative is zero.
Figure PCTCN2018114433-appb-000010
Figure PCTCN2018114433-appb-000010
Figure PCTCN2018114433-appb-000011
Figure PCTCN2018114433-appb-000011
则公式(7-9)可以构成如下特征值方程Then the formula (7-9) can constitute the following eigenvalue equation
Figure PCTCN2018114433-appb-000012
Figure PCTCN2018114433-appb-000012
有上述公式(10)可以得到该最佳拟合平面的特征矩阵为3*3的实对称矩阵With the above formula (10), a real symmetric matrix with a feature matrix of 3*3 of the best fit plane can be obtained.
Figure PCTCN2018114433-appb-000013
Figure PCTCN2018114433-appb-000013
S113:计算该特征矩阵的特征值。S113: Calculate a feature value of the feature matrix.
S114:以该特征值中最小特征值占所有特征值之和的比例作为第一数据点的曲率。S114: Taking the ratio of the smallest feature value of the feature values to the sum of all the feature values as the curvature of the first data point.
具体地,求解上述特征矩阵A的特征值和特征向量,则可以得到该最佳拟合平面的单位法向量a、b、c。Specifically, by solving the feature values and feature vectors of the feature matrix A, the unit normal vectors a, b, and c of the best fit plane can be obtained.
实对称矩阵A的特征值可以利用如下公式(11)计算得到The eigenvalues of the real symmetric matrix A can be calculated by the following formula (11).
|A-λI|=0;     (11)|A-λI|=0; (11)
其中,I是单位矩阵。由于A为3*3的实对称矩阵,因此矩阵A最多只有3个实数特征值,分别为λ 0、λ 1、λ 2,其中λ 0为最小特征值,则第一数据点的曲率σ可以利用如下公式(12)计算得到 Where I is the identity matrix. Since A is a real symmetric matrix of 3*3, matrix A has at most three real eigenvalues, respectively λ 0 , λ 1 , λ 2 , where λ 0 is the minimum eigenvalue, and the curvature σ of the first data point can be Calculated using the following formula (12)
Figure PCTCN2018114433-appb-000014
Figure PCTCN2018114433-appb-000014
即第一数据点的曲率σ是最佳拟合平面的特征矩阵的最小特征值占所有特征值之和的比例。其他数据点的曲率也可以采用上述方法进行计算,此处不再重复。That is, the curvature σ of the first data point is the ratio of the minimum eigenvalue of the feature matrix of the best fit plane to the sum of all the feature values. The curvature of other data points can also be calculated by the above method, and will not be repeated here.
本实施例中是采用特征值法计算每个数据点的曲率,当然在其他实施例中,数据点的曲率也可以采用最小二乘法等其他方法进行计算,此处不做具体限定。In this embodiment, the curvature of each data point is calculated by using the eigenvalue method. Of course, in other embodiments, the curvature of the data point may be calculated by other methods such as least squares method, which is not specifically limited herein.
本实施例还可以与本申请点云采样方法第二至第四任一实施例或其不冲突的组合相结合。This embodiment can also be combined with any of the second to fourth embodiments of the point cloud sampling method of the present application or a combination thereof that does not conflict.
如图10所示,本申请图像处理设备20一实施例包括:相互连接的通信电路201和处理器202。As shown in FIG. 10, an embodiment of the image processing apparatus 20 of the present application includes: a communication circuit 201 and a processor 202 that are connected to each other.
其中,该通信电路201用于发送和接收数据,是图像处理设备20与其他设备进行通信的接口。具体地,该通信电路201用于获取三维图像的点云数据。The communication circuit 201 is configured to transmit and receive data, and is an interface that the image processing device 20 communicates with other devices. Specifically, the communication circuit 201 is configured to acquire point cloud data of a three-dimensional image.
处理器202控制通信设备的操作,处理器202还可以称为CPU(Central Processing Unit,中央处理单元)。处理器202可能是一种集成电路芯片,具有信号的处理能力。处理器202还可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 202 controls the operation of the communication device, and the processor 202 may also be referred to as a CPU (Central Processing Unit). Processor 202 may be an integrated circuit chip with signal processing capabilities. The processor 202 can also be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. . The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
具体地,该处理器202用于执行程序以实现如本申请点云采样方法第一至第五任一实施例或其不冲突的组合所提供的方法。In particular, the processor 202 is operative to execute a program to implement a method as provided by any one of the first to fifth embodiments of the point cloud sampling method of the present application or a non-conflicting combination thereof.
当然,在其他实施例中,该图像处理设备20还可以包括存储器(图未示)等其他部件,此处不做具体限定。Of course, in other embodiments, the image processing device 20 may further include other components such as a memory (not shown), which are not specifically limited herein.
本实施例中的图像处理设备可以是移动终端、固定终端、服务器等,也可以是集成的独立部件,例如图像处理芯片。The image processing device in this embodiment may be a mobile terminal, a fixed terminal, a server, or the like, or may be an integrated independent component such as an image processing chip.
本实施例的图像处理设备中,处理器通过通信电路获取三维图像的点云数据后,计算点云数据中每个数据点的曲率,设置每个数据点对应的采样半径, 其中曲率较大的数据点对应的采样半径不大于曲率较小的数据点对应的采样半径,至少部分曲率较大的数据点对应的采样半径小于曲率较小的数据点对应的采样半径,以该采样半径对点云数据进行采样,以使得曲率较大的区域数据密度大于曲率较小的区域,从而在曲率较大的区域保留更多的数据点,在曲率较小的区域保留较少的数据点,进而在删除冗余数据的同时,保留特征数据,有利于提高后续数据处理的速度,同时减少存储空间,节约成本。In the image processing device of this embodiment, after acquiring the point cloud data of the three-dimensional image through the communication circuit, the processor calculates the curvature of each data point in the point cloud data, and sets a sampling radius corresponding to each data point, wherein the curvature is larger. The sampling radius corresponding to the data point is not larger than the sampling radius corresponding to the data point with the smaller curvature, and the sampling radius corresponding to the data point with at least part of the curvature is smaller than the sampling radius corresponding to the data point with the smaller curvature, and the sampling radius is used for the point cloud. The data is sampled so that the data density of the region with larger curvature is larger than the region with smaller curvature, so that more data points are reserved in the region with larger curvature, and fewer data points are reserved in the region with less curvature, and then deleted. At the same time of redundant data, retaining feature data is beneficial to improve the speed of subsequent data processing, while reducing storage space and saving costs.
如图11所示,本申请具有存储功能的装置一实施例中,具有存储功能的装置30内部存储有指令301,该指令301被执行时实现如本申请点云采样方法第一至第五任一实施例或其不冲突的组合所提供的采样方法。As shown in FIG. 11 , in an embodiment of the present application having a storage function, the device 30 having a storage function internally stores an instruction 301. When the instruction 301 is executed, the first to fifth applications of the point cloud sampling method of the present application are implemented. A sampling method provided by an embodiment or a combination thereof that does not conflict.
其中,具有存储功能的设备30可以是便携式存储介质如U盘、光盘,也可以是终端、服务器或集成的独立部件,例如图像处理芯片等。The device 30 having a storage function may be a portable storage medium such as a USB flash drive or an optical disk, or may be a terminal, a server, or an integrated independent component such as an image processing chip or the like.
本实施例中,该具有存储功能的设备内部存储的指令被执行时,通过获取三维图像的点云数据,计算点云数据中每个数据点的曲率,设置每个数据点对应的采样半径,其中曲率较大的数据点对应的采样半径不大于曲率较小的数据点对应的采样半径,至少部分曲率较大的数据点对应的采样半径小于曲率较小的数据点对应的采样半径,以该采样半径对点云数据进行采样,以使得曲率较大的区域数据密度大于曲率较小的区域,从而在曲率较大的区域保留更多的数据点,在曲率较小的区域保留较少的数据点,进而在删除冗余数据的同时,保留特征数据,有利于提高后续数据处理的速度,同时减少存储空间,节约成本。In this embodiment, when the instruction stored in the device with the storage function is executed, the curvature of each data point in the point cloud data is calculated by acquiring the point cloud data of the three-dimensional image, and the sampling radius corresponding to each data point is set. The sampling radius corresponding to the data point with larger curvature is not larger than the sampling radius corresponding to the data point with smaller curvature, and the sampling radius corresponding to at least part of the data point with larger curvature is smaller than the sampling radius corresponding to the data point with smaller curvature, The sampling radius samples the point cloud data so that the data density of the region with larger curvature is larger than the region with smaller curvature, so that more data points are reserved in the region with larger curvature, and less data is retained in the region with smaller curvature. Points, in addition to deleting redundant data, retain feature data, which is beneficial to improve the speed of subsequent data processing, while reducing storage space and saving costs.
以上所述仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above description is only the embodiment of the present application, and thus does not limit the scope of the patent application, and the equivalent structure or equivalent process transformation of the specification and the drawings of the present application, or directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of this application.

Claims (17)

  1. 一种点云采样方法,其中,包括:A point cloud sampling method, which includes:
    获取三维图像的点云数据;Obtain point cloud data of a three-dimensional image;
    计算所述点云数据中每个数据点的曲率;Calculating a curvature of each data point in the point cloud data;
    设置每个数据点对应的采样半径,其中曲率较大的数据点对应的采样半径不大于曲率较小的数据点对应的采样半径,至少部分曲率较大的数据点对应的采样半径小于曲率较小的数据点对应的采样半径;Setting a sampling radius corresponding to each data point, wherein a sampling radius corresponding to a data point having a larger curvature is not larger than a sampling radius corresponding to a data point having a smaller curvature, and a sampling radius corresponding to at least a portion of the data point having a larger curvature is smaller than a smaller curvature The sampling radius corresponding to the data point;
    基于设置的所述采样半径对所述点云数据进行采样,以使得曲率较大的区域数据密度大于曲率较小的区域。The point cloud data is sampled based on the set sampling radius such that a region having a larger curvature has a data density greater than a region having a smaller curvature.
  2. 根据权利要求1所述的方法,其中,所述基于设置的所述采样半径对所述点云数据进行采样包括:The method of claim 1, wherein the sampling the point cloud data based on the set sampling radius comprises:
    获取第一数据点的位置坐标;Obtaining the position coordinates of the first data point;
    计算所述第一数据点和第二数据点的距离,所述第二数据点是除所述第一数据点以外的至少部分数据点;Calculating a distance between the first data point and a second data point, the second data point being at least part of a data point other than the first data point;
    判断所述距离是否小于所述第一数据点对应的采样半径;Determining whether the distance is smaller than a sampling radius corresponding to the first data point;
    若判断结果为是,则删除所述第二数据点;If the judgment result is yes, deleting the second data point;
    否则,保留所述第二数据点,按照预设采样顺序选择未删除的另一个数据点作为所述第一数据点,重复执行上述步骤,直至遍历完成所有未删除的数据点。Otherwise, the second data point is reserved, another data point that is not deleted is selected as the first data point according to a preset sampling order, and the above steps are repeatedly performed until the traversal completes all the undeleted data points.
  3. 根据权利要求2所述的方法,其中,所述设置每个数据点对应的采样半径包括:The method of claim 2 wherein said setting a sampling radius corresponding to each data point comprises:
    将所述数据点按预设曲率顺序排列后划分为多个子点云;The data points are arranged in a preset curvature order and then divided into a plurality of sub-point clouds;
    为每个所述子点云设置一个采样半径,其中所述数据点曲率较大的所述子点云的采样半径小于所述数据点曲率较小的所述子点云的采样半径。A sampling radius is set for each of the sub-point clouds, wherein a sampling radius of the sub-point cloud having a larger curvature of the data point is smaller than a sampling radius of the sub-point cloud having a smaller curvature of the data point.
  4. 根据权利要求3所述的方法,其中,所述将所述数据点按曲率预设顺序 排列后划分为多个子点云包括:The method according to claim 3, wherein the dividing the data points into a plurality of sub-point clouds after being arranged in a preset order of curvature comprises:
    将所述数据点按曲率递增/递减的顺序排列;Arranging the data points in increasing or decreasing order of curvature;
    将排列后的所述数据点依次平均划分为多个所述子点云。The aligned data points are equally divided into a plurality of the sub-point clouds.
  5. 根据权利要求3所述的方法,其中,所述为每个所述子点云设置一个采样半径包括:The method of claim 3 wherein said setting a sampling radius for each of said sub-point clouds comprises:
    按曲率递增的顺序,将所述子点云的采样半径依次设置为以第一半径为初始值的递减等差数列;或者The sampling radii of the sub-point cloud are sequentially set to a decreasing arithmetic progression with the first radius as an initial value in an order of increasing curvature; or
    按曲率递减的顺序,将所述子点云的采样半径依次设置为以第二半径为初始值的递增等差数列。The sampling radii of the sub-point cloud are sequentially set to an increasing number of arithmetic progressions with the second radius being the initial value in the order of decreasing curvature.
  6. 根据权利要求3所述的方法,其中,所述预设采样顺序是曲率递增/递减顺序;The method of claim 3, wherein the predetermined sampling order is an increasing or decreasing order of curvature;
    所述获取第一数据点的位置坐标包括:The obtaining location coordinates of the first data point includes:
    选择第一子点云中曲率最小/最大数据点作为初始的所述第一数据点,并获取所述第一数据点的位置坐标;Selecting a curvature minimum/maximum data point in the first sub-point cloud as the initial first data point, and acquiring position coordinates of the first data point;
    所述计算所述第一数据点和第二数据点的距离包括:The calculating the distance between the first data point and the second data point includes:
    计算所述第一子点云中其他数据点与所述第一数据点的第一距离;Calculating a first distance between the other data points in the first sub-point cloud and the first data point;
    所述判断所述距离是否小于所述第一数据点对应的采样半径包括:The determining whether the distance is smaller than a sampling radius corresponding to the first data point includes:
    判断所述第一距离是否小于所述第一子点云对应的采样半径;Determining whether the first distance is smaller than a sampling radius corresponding to the first sub-point cloud;
    若判断结果为是,则判定所述距离小于所述第一数据点对应的采样半径;If the determination result is yes, determining that the distance is smaller than a sampling radius corresponding to the first data point;
    所述按照预设采样顺序选择未删除的另一个数据点作为所述第一数据点,重复执行上述步骤,直至遍历所有未删除的数据点包括:The selecting, according to the preset sampling order, another data point that is not deleted as the first data point, and repeatedly performing the foregoing steps until traversing all the undeleted data points includes:
    按照曲率递增/递减的顺序选择所述第一子点云中未删除的另一数据点作为所述第一数据点,返回执行所述获取所述第一数据点的位置坐标的步骤,直至遍历完成所述第一子点云未删除的数据点。And selecting another data point that is not deleted in the first sub-point cloud as the first data point according to an order of increasing/decreasing curvature, and returning to performing the step of acquiring position coordinates of the first data point until traversing The data points that are not deleted by the first sub-point cloud are completed.
  7. 根据权利要求6所述的方法,其中,所述遍历完成所述第一子点云未删除的数据点之后,进一步包括:The method of claim 6, wherein after the traversing the data points that are not deleted by the first sub-point cloud, the method further comprises:
    选择未采样的另一个子点云,返回执行所述获取第一数据点的位置坐标的步骤,直至遍历完成所有子点云。Select another sub-point cloud that is not sampled, and return to perform the step of acquiring the position coordinates of the first data point until the traversal completes all the sub-point clouds.
  8. 根据权利要求1所述的方法,其中,所述计算所述点云数据中每个数据点的曲率包括:The method of claim 1 wherein said calculating a curvature of each of said point cloud data comprises:
    获取第一数据点在预设距离内的邻域点;Obtaining a neighborhood point of the first data point within a preset distance;
    利用特征值法将所述邻域点拟合平面方程,以得到最佳拟合平面的特征矩阵;The eigenvalue method is used to fit the neighborhood point to the plane equation to obtain a feature matrix of the best fit plane;
    计算所述特征矩阵的特征值;Calculating a feature value of the feature matrix;
    以所述特征值中最小特征值占所有特征值之和的比例作为所述第一数据点的曲率。The ratio of the smallest feature value among the feature values to the sum of all the feature values is taken as the curvature of the first data point.
  9. 一种图像处理设备,其中,包括:相互连接的通信电路和处理器;An image processing device, comprising: a communication circuit and a processor connected to each other;
    所述通信电路用于获取三维图像的点云数据;The communication circuit is configured to acquire point cloud data of a three-dimensional image;
    所述处理器用于计算所述点云数据中每个数据点的曲率;设置每个数据点对应的采样半径,其中曲率较大的数据点对应的采样半径不大于曲率较小的数据点对应的采样半径,至少部分曲率较大的数据点对应的采样半径小于曲率较小的数据点对应的采样半径;基于设置的所述采样半径对所述点云数据进行采样,以使得曲率较大的区域数据密度大于曲率较小的区域。The processor is configured to calculate a curvature of each data point in the point cloud data; set a sampling radius corresponding to each data point, wherein a data radius corresponding to the data point corresponding to the curvature is not greater than a data point corresponding to the smaller curvature point a sampling radius, a sampling radius corresponding to at least a portion of the data point having a larger curvature is smaller than a sampling radius corresponding to the data point having a smaller curvature; and sampling the point cloud data based on the set sampling radius to make the region with a larger curvature The data density is larger than the area with less curvature.
  10. 根据权利要求9所述的图像处理设备,其中,所述处理器用于:The image processing device according to claim 9, wherein said processor is configured to:
    获取第一数据点的位置坐标;计算所述第一数据点和第二数据点的距离,所述第二数据点是除所述第一数据点以外的至少部分数据点;判断所述距离是否小于所述第一数据点对应的采样半径;并在所述判断结果为是时,删除所述第二数据点;否则,保留所述第二数据点,按照预设采样顺序选择未删除的另一个数据点作为所述第一数据点,重复执行上述步骤,直至遍历完成所有未删除的数据点。Obtaining a position coordinate of the first data point; calculating a distance between the first data point and the second data point, the second data point being at least part of the data point except the first data point; determining whether the distance is And less than the sampling radius corresponding to the first data point; and when the determining result is yes, deleting the second data point; otherwise, retaining the second data point, selecting another undeleted according to a preset sampling order A data point is used as the first data point, and the above steps are repeated until the traversal completes all the undeleted data points.
  11. 根据权利要求10所述的图像处理设备,其中,所述处理器还用于:The image processing device according to claim 10, wherein the processor is further configured to:
    将所述数据点按预设曲率顺序排列后划分为多个子点云;为每个所述子点 云设置一个采样半径,其中所述数据点曲率较大的所述子点云的采样半径小于所述数据点曲率较小的所述子点云的采样半径。Arranging the data points in a preset curvature order and dividing into a plurality of sub-point clouds; setting a sampling radius for each of the sub-point clouds, wherein a sampling radius of the sub-point cloud having a larger curvature of the data points is smaller than The sampling radius of the sub-point cloud having a small curvature of the data point.
  12. 根据权利要求11所述的图像处理设备,其中,所述处理器还用于:The image processing device according to claim 11, wherein the processor is further configured to:
    将所述数据点按曲率递增/递减的顺序排列;将排列后的所述数据点依次平均划分为多个所述子点云。The data points are arranged in an order of increasing/decreasing curvature; and the arranged data points are equally divided into a plurality of the sub-point clouds.
  13. 根据权利要求11所述的图像处理设备,其中,所述处理器还用于:The image processing device according to claim 11, wherein the processor is further configured to:
    按曲率递增的顺序,将所述子点云的采样半径依次设置为以第一半径为初始值的递减等差数列;或者按曲率递减的顺序,将所述子点云的采样半径依次设置为以第二半径为初始值的递增等差数列。The sampling radii of the sub-point cloud are sequentially set to a decreasing arithmetic sequence with the first radius as an initial value in an order of increasing curvature; or the sampling radii of the sub-point cloud are sequentially set to an order of decreasing curvature The incremental difference sequence is the initial value of the second radius.
  14. 根据权利要求11所述的图像处理设备,其中,所述预设采样顺序是曲率递增/递减顺序;所述处理器还用于:The image processing device according to claim 11, wherein said predetermined sampling order is a curvature increasing/decreasing order; said processor is further configured to:
    选择第一子点云中曲率最小/最大数据点作为初始的所述第一数据点,并获取所述第一数据点的位置坐标;计算所述第一子点云中其他数据点与所述第一数据点的第一距离;判断所述第一距离是否小于所述第一子点云对应的采样半径;并在所述判断结果为是时,判定所述距离小于所述第一数据点对应的采样半径;按照曲率递增/递减的顺序选择所述第一子点云中未删除的另一数据点作为所述第一数据点,返回执行所述获取所述第一数据点的位置坐标的步骤,直至遍历完成所述第一子点云未删除的数据点。Selecting a curvature minimum/maximum data point in the first sub-point cloud as the initial first data point, and acquiring position coordinates of the first data point; calculating other data points in the first sub-point cloud and the a first distance of the first data point; determining whether the first distance is smaller than a sampling radius corresponding to the first sub-point cloud; and determining that the distance is smaller than the first data point when the determining result is yes Corresponding sampling radius; selecting another data point that is not deleted in the first sub-point cloud as the first data point in the order of increasing/decreasing curvature, and returning to perform performing the acquiring position coordinate of the first data point The step of traversing until the data point of the first sub-point cloud is not deleted.
  15. 根据权利要求14所述的图像处理设备,其中,所述处理器进一步用于:The image processing device according to claim 14, wherein said processor is further configured to:
    选择未采样的另一个子点云,返回执行所述获取第一数据点的位置坐标的步骤,直至遍历完成所有子点云。Select another sub-point cloud that is not sampled, and return to perform the step of acquiring the position coordinates of the first data point until the traversal completes all the sub-point clouds.
  16. 根据权利要求9所述的图像处理设备,其中,所述处理器用于:The image processing device according to claim 9, wherein said processor is configured to:
    获取第一数据点在预设距离内的邻域点;利用特征值法将所述邻域点拟合平面方程,以得到最佳拟合平面的特征矩阵;计算所述特征矩阵的特征值;以所述特征值中最小特征值占所有特征值之和的比例作为所述第一数据点的曲率。Obtaining a neighborhood point of the first data point within a preset distance; fitting the neighborhood point to a plane equation by using an eigenvalue method to obtain a feature matrix of the best fit plane; calculating a feature value of the feature matrix; The ratio of the smallest feature value among the feature values to the sum of all the feature values is taken as the curvature of the first data point.
  17. 一种具有存储功能的装置,存储有指令,其中,所述指令被执行时实 现如权利要求1-8任一项所述的点云采样方法。A device having a storage function storing instructions, wherein the instructions are executed to implement the point cloud sampling method of any one of claims 1-8.
PCT/CN2018/114433 2018-05-09 2018-11-07 Point cloud sampling method, image processing device, and device having storage function WO2019214193A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810439741.8A CN108597019A (en) 2018-05-09 2018-05-09 Points Sample method, image processing equipment and the device with store function
CN201810439741.8 2018-05-09

Publications (1)

Publication Number Publication Date
WO2019214193A1 true WO2019214193A1 (en) 2019-11-14

Family

ID=63636177

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/114433 WO2019214193A1 (en) 2018-05-09 2018-11-07 Point cloud sampling method, image processing device, and device having storage function

Country Status (2)

Country Link
CN (1) CN108597019A (en)
WO (1) WO2019214193A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108597019A (en) * 2018-05-09 2018-09-28 深圳市华讯方舟太赫兹科技有限公司 Points Sample method, image processing equipment and the device with store function
CN109544689B (en) * 2018-09-30 2023-10-31 先临三维科技股份有限公司 Method and device for determining three-dimensional model
CN109189290B (en) * 2018-10-18 2021-01-26 广州酷狗计算机科技有限公司 Click area identification method and device and computer readable storage medium
CN109740628A (en) * 2018-12-03 2019-05-10 深圳市华讯方舟太赫兹科技有限公司 Point cloud clustering method, image processing equipment and the device with store function
CN114281004A (en) * 2021-12-31 2022-04-05 北京航天自动控制研究所 Graded sampling method based on peak detection
CN114866685B (en) * 2022-03-16 2023-05-26 金钱猫科技股份有限公司 Posture correction method and system of laser camera device
CN116202874B (en) * 2023-05-05 2023-07-14 青岛宇通管业有限公司 Drainage pipe flexibility testing method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650838A (en) * 2009-09-04 2010-02-17 浙江工业大学 Point cloud simplification processing method based on resampling method and affine clustering algorithm
CN103310481A (en) * 2013-05-20 2013-09-18 东南大学 Point cloud reduction method based on fuzzy entropy iteration
CN105631929A (en) * 2014-11-28 2016-06-01 富泰华工业(深圳)有限公司 Point cloud simplification method and system
CN108597019A (en) * 2018-05-09 2018-09-28 深圳市华讯方舟太赫兹科技有限公司 Points Sample method, image processing equipment and the device with store function

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853526A (en) * 2010-06-04 2010-10-06 浙江工业大学 Density self-adapting non-uniform point cloud simplifying treatment method
EP2674913B1 (en) * 2012-06-14 2014-07-23 Softkinetic Software Three-dimensional object modelling fitting & tracking.
CN103530899A (en) * 2013-10-10 2014-01-22 浙江万里学院 Geometric featuer-based point cloud simplification method
CN105069845A (en) * 2015-07-29 2015-11-18 南京信息工程大学 Point cloud simplification method based on curved surface change

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650838A (en) * 2009-09-04 2010-02-17 浙江工业大学 Point cloud simplification processing method based on resampling method and affine clustering algorithm
CN103310481A (en) * 2013-05-20 2013-09-18 东南大学 Point cloud reduction method based on fuzzy entropy iteration
CN105631929A (en) * 2014-11-28 2016-06-01 富泰华工业(深圳)有限公司 Point cloud simplification method and system
CN108597019A (en) * 2018-05-09 2018-09-28 深圳市华讯方舟太赫兹科技有限公司 Points Sample method, image processing equipment and the device with store function

Also Published As

Publication number Publication date
CN108597019A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
WO2019214193A1 (en) Point cloud sampling method, image processing device, and device having storage function
Svärm et al. City-scale localization for cameras with known vertical direction
WO2020114320A1 (en) Point cloud clustering method, image processing device and apparatus having storage function
Mérigot et al. Voronoi-based curvature and feature estimation from point clouds
CN100559398C (en) Automatic deepness image registration method
WO2020168685A1 (en) Three-dimensional scanning viewpoint planning method, device, and computer readable storage medium
Li et al. A stable direct solution of perspective-three-point problem
CN110322464A (en) A kind of small curvature thin-walled parts boundary extraction method based on three-dimensional point cloud
CN110111430B (en) Method for extracting quadric surface from three-dimensional point cloud
CN109903319B (en) Multi-resolution-based fast iteration closest point registration algorithm
US20100021068A1 (en) System and method for extracting boundary elements of an object
CN110599506B (en) Point cloud segmentation method for three-dimensional measurement of complex special-shaped curved surface robot
WO2021052283A1 (en) Method for processing three-dimensional point cloud data and computing device
CN105654483A (en) Three-dimensional point cloud full-automatic registration method
El‐Sayed et al. Plane detection in 3D point cloud using octree‐balanced density down‐sampling and iterative adaptive plane extraction
TWI748409B (en) Data processing method, processor, electronic device and computer readable medium
CN112381862B (en) Full-automatic registration method and device for CAD (computer-aided design) model and triangular mesh
CN113838005B (en) Intelligent identification and three-dimensional reconstruction method and system for rock mass fracture based on dimension conversion
WO2021082380A1 (en) Laser radar-based pallet recognition method and system, and electronic device
WO2022110451A1 (en) Method and apparatus for positioning robot, computer-readable storage medium, and robot
WO2020134819A1 (en) Method for searching face, and related device
CN111476894A (en) Three-dimensional semantic map construction method and device, storage medium and electronic equipment
CN114783068A (en) Gesture recognition method, gesture recognition device, electronic device and storage medium
CN113409332B (en) Building plane segmentation method based on three-dimensional point cloud
CN109658453B (en) Circle center determining method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18917615

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18917615

Country of ref document: EP

Kind code of ref document: A1