WO2021142995A1 - Image processing-based k-nearest neighbor point cloud filtering method, apparatus, and storage medium - Google Patents

Image processing-based k-nearest neighbor point cloud filtering method, apparatus, and storage medium Download PDF

Info

Publication number
WO2021142995A1
WO2021142995A1 PCT/CN2020/091749 CN2020091749W WO2021142995A1 WO 2021142995 A1 WO2021142995 A1 WO 2021142995A1 CN 2020091749 W CN2020091749 W CN 2020091749W WO 2021142995 A1 WO2021142995 A1 WO 2021142995A1
Authority
WO
WIPO (PCT)
Prior art keywords
point
neighboring
dimensional
points
point cloud
Prior art date
Application number
PCT/CN2020/091749
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 WO2021142995A1 publication Critical patent/WO2021142995A1/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/04Indexing scheme for image data processing or generation, in general involving 3D image data

Definitions

  • the invention relates to the technical field of three-dimensional shape measurement, in particular to a k-nearest neighbor point cloud filtering method, device and storage medium based on image processing.
  • the purpose of the present invention is to provide a K-nearest neighbor point cloud filtering method, device and storage medium based on image processing, which can remove long and narrow noise point clouds and improve the application range of the K-nearest neighbor point cloud filtering method. .
  • the present invention provides a K-nearest neighbor point cloud filtering method based on image processing, which includes the following steps:
  • Obtain a preset K neighboring filter template perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the Euclidean distance between the center point of the K neighboring filter template and all K neighboring points , If the Euclidean distance is less than the preset distance threshold, the K neighboring point is set as the first K neighboring point, and if the Euclidean distance is greater than the preset distance threshold, the K neighboring point is set Is the second K neighboring point;
  • Obtain a preset ratio threshold and number threshold if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the second K neighboring points The ratio of the number of neighboring points is less than the ratio threshold and the sum of the numbers of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
  • the three-dimensional point cloud is obtained by reconstructing the absolute phase map and internal and external parameters of an image acquisition device, and the image acquisition device includes a camera and a projector.
  • the performing convolution calculation on the two-dimensional image according to the K neighboring filter template specifically includes the following steps:
  • Euclidean distance is calculated according to the coordinates of the first point and the coordinates of the second point.
  • the shape of the K neighboring filter template includes but is not limited to a rectangle and a circle, and the K neighboring filter template includes at least a center point and several K neighboring points.
  • the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold and the sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold , Also includes: setting the center point as an outlier noise point.
  • the center point after setting the center point as a noise point, it further includes: moving the K neighboring filter template to an unfiltered area in the two-dimensional image, and repeating the filtering operation until the traversal of the two-dimensional image is completed .
  • the present invention provides a device for performing a K-nearest neighbor point cloud filtering method based on image processing, including a CPU unit configured to perform the following steps:
  • Obtain a preset K neighboring filter template perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the Euclidean distance between the center point of the K neighboring filter template and all K neighboring points , If the Euclidean distance is less than the preset distance threshold, the K neighboring point is set as the first K neighboring point, and if the Euclidean distance is greater than the preset distance threshold, the K neighboring point is set Is the second K neighboring point;
  • Obtain a preset ratio threshold and number threshold if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the second K neighboring points The ratio of the number of neighboring points is less than the ratio threshold and the sum of the numbers of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
  • CPU unit is also used to perform the following steps:
  • Euclidean distance is calculated according to the coordinates of the first point and the coordinates of the second point.
  • CPU unit is also used to perform the following steps:
  • the K neighboring filter template is moved to an unfiltered area in the two-dimensional image, and the filtering operation is repeated until the traversal of the two-dimensional image is completed.
  • the present invention provides a device for performing a K-nearest neighbor point cloud filtering method based on image processing, including at least one control processor and a memory for communicating with the at least one control processor; the memory stores the The instruction executed by the at least one control processor is executed by the at least one control processor, so that the at least one control processor can execute the K-nearest neighbor point cloud filtering method based on image processing as described above.
  • the present invention provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make the computer execute the K-nearest neighbor point cloud filtering based on image processing as described above method.
  • the present invention also provides a computer program product, the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer , Let the computer execute the K-nearest neighbor point cloud filtering method based on image processing as described above.
  • the present invention constructs a two-dimensional image after acquiring a three-dimensional point cloud, and selects several points in the two-dimensional image through the K neighbor filter template, Calculate the Euclidean distance between the center point and K neighboring points, and determine whether the center point is a noise point based on the Euclidean distance and the preset distance threshold and ratio threshold. For the center point that meets the distance threshold and the ratio threshold, the number threshold is compared The number of K neighboring points in the template is counted, and the center point of the template whose number is less than the number threshold is set as outlier noise points. By setting the number threshold, the space level limitation is realized, and outliers, scattered and narrow noise points are effectively removed Cloud, improve the accuracy and scope of filtering.
  • Fig. 1 is a flowchart of a K-nearest neighbor point cloud filtering method based on image processing provided by an embodiment of the present invention
  • FIG. 2 is a flowchart of performing convolution calculation on the two-dimensional image according to the K neighbor filter template in a K neighbor point cloud filtering method based on image processing according to an embodiment of the present invention
  • Fig. 3 is a complete flow chart of a K-nearest neighbor point cloud filtering method based on image processing provided by an embodiment of the present invention
  • Fig. 4 is a schematic diagram of an apparatus for performing a K-nearest neighbor point cloud filtering method based on image processing according to another embodiment of the present invention.
  • the first embodiment of the present invention provides a K-nearest neighbor point cloud filtering method based on image processing, including the following steps:
  • Step S100 acquiring a three-dimensional point cloud, and constructing a two-dimensional image, where the two-dimensional points in the two-dimensional image uniquely correspond to the three-dimensional points in the three-dimensional point cloud;
  • Step S200 Obtain a preset K neighboring filter template, and perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the distance between the center point of the K neighboring filter template and all K neighboring points If the Euclidean distance is less than the preset distance threshold, set the K neighboring point as the first K neighboring point; if the Euclidean distance is greater than the preset distance threshold, set the K The neighboring point is set as the second K neighboring point;
  • Step S300 Obtain a preset ratio threshold and number threshold. If the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the number The number ratio of the second K neighboring points is less than the ratio threshold and the sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
  • the three-dimensional points in this embodiment are reconstructed according to each point of the absolute phase map in the image plane, so each point of the absolute phase map in the image plane is the same as the reconstructed three-dimensional point.
  • the points have a one-to-one correspondence, that is, the constructed two-dimensional image contains not only the position information of the absolute phase map but also the three-dimensional point information, which is beneficial to the filtering calculation.
  • the reconstruction method can use any three-dimensional to two-dimensional graphics reconstruction method in the prior art, and the present invention does not involve the improvement of specific reconstruction methods, and will not be repeated here.
  • this embodiment preferably uses the K neighbor filter template to define a certain spatial range from the two-dimensional image. Therefore, the number of K neighbor points is limited. If the number is too small, the representative area is outlying or scattered noise. Area, so as to increase the spatial information to filter the noise of the point cloud. It can be understood that the Euclidean distance can better reflect the spatial distance between two points, which is the preferred embodiment of this embodiment, and other types of parameters can also be used to achieve similar effects. Those skilled in the art can understand that, due to different filtering accuracy requirements, the distance threshold, the ratio threshold, and the quantity threshold can be adjusted according to actual needs, and this embodiment is not limited due to specific numerical values.
  • step S300 if the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold, it means that the distance between the center point and the three-dimensional point corresponding to the neighboring points is relatively short. Therefore, the center point is based on image processing. The level of is not a noise point, but if there are fewer points in the K neighboring filter template, the corresponding is a large area of outlier noise. In this case, this embodiment preferably judges by the number threshold. If the first K neighboring point If the sum of the number of neighboring points with the second K is less than the number threshold, the center point is set as outlier noise, so as to remove the long and narrow patchy noise.
  • the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, it means that the center point is far away from other neighboring points, which is probably a noise point in the point cloud. Set the center point directly to For noise points, there is no need to judge the number threshold, which can simplify the calculation process.
  • the three-dimensional point cloud is obtained by reconstructing the absolute phase map and internal and external parameters of an image acquisition device, and the image acquisition device includes a camera and a projector.
  • the three-dimensional point cloud can be acquired by any device in the prior art.
  • a camera and a projector are preferably used.
  • the specific three-dimensional point cloud acquisition method is not an improvement of the present invention. Go into details again.
  • the performing convolution calculation on the two-dimensional image according to the K neighboring filter template specifically includes the following steps:
  • Step S210 acquiring the first point coordinates corresponding to the center point and the second point coordinates corresponding to the K neighboring points in the three-dimensional point cloud;
  • Step S220 Calculate the Euclidean distance according to the coordinates of the first point and the coordinates of the second point.
  • this embodiment preferably compares the center point with other K neighboring points one by one, and repeating step S210 and step S220 until all the K neighboring points are completed. Point calculation.
  • the shape of the K neighboring filter template includes but is not limited to a rectangle and a circle, and the K neighboring filter template includes at least a center point and several K neighboring points.
  • the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold and the sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold , Also includes: setting the center point as an outlier noise point.
  • the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold and the sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold is set as outlier noise points
  • the preferred embodiment of this embodiment can also only be set as noise points.
  • outlier noise points can be distinguished from ordinary noise points, which is convenient for subsequent processing.
  • the method further includes: moving the K neighboring filter template to an unfiltered area in the two-dimensional image, and repeating the filtering operation until the traversal of the two-dimensional image is completed .
  • another embodiment of the present invention also provides a K-nearest neighbor point cloud filtering method based on image processing, including the following steps:
  • Step S3100 Obtain the coordinates of the first point corresponding to the center point and the coordinates of the second point corresponding to the K neighboring points in the three-dimensional point cloud;
  • Step S3200 Obtain a preset K neighbor filter template, and acquire the first point coordinates corresponding to the center point of the K neighbor filter template and the second point coordinates corresponding to the K neighbor points in the three-dimensional point cloud;
  • Step S3300 it is judged whether the Euclidean distance is greater than the distance threshold, if yes, go to step S3310, otherwise go to step S3320;
  • Step S3310 the K neighboring point is set as the first K neighboring point, and step S3330 is executed;
  • Step S3320 the K neighboring point is set as the second K neighboring point, and step S3330 is executed;
  • Step S3330 Calculate the ratio of the number of the first K neighboring points to the second K neighboring points
  • Step S3400 it is judged whether the ratio obtained in step S3330 is greater than the ratio threshold value, if yes, go to step S3410, otherwise go to step S3420;
  • Step S3410 set the center point as a noise point, move the K-nearest neighbor filter template, if the two-bit image is not completely traversed, perform step S3100;
  • Step S3420 Calculate the sum of the numbers of the first K neighboring points and the second K neighboring points. Compared with the number threshold, if it is greater than the number threshold, perform step S3422, and if it is less than the number threshold, perform step S3423;
  • Step S3422 set the center point as an outlier noise point, move the K-nearest neighbor filter template, if the two-bit image is not completely traversed, perform step S3100;
  • step S3423 the center point is retained, and the K-nearest neighbor filter template is moved. If the two-bit image is not completely traversed, step S3100 is executed.
  • steps S3100 to S3330 of this embodiment implement point cloud filtering based on image processing
  • steps S3400 to S3423 increase the spatial information of k-nearest neighbors to implement a large and narrow noise point cloud.
  • the second embodiment of the present invention also provides a device for performing K-nearest neighbor point cloud filtering method based on image processing.
  • the device is a smart device, such as a smart phone, a computer, and a tablet. Take the computer as an example to illustrate.
  • the computer 4000 for performing the K-nearest neighbor point cloud filtering method based on image processing includes a CPU unit 4100, and the CPU unit 4100 is configured to perform the following steps:
  • Obtain a preset K neighboring filter template perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the Euclidean distance between the center point of the K neighboring filter template and all K neighboring points , If the Euclidean distance is less than the preset distance threshold, the K neighboring point is set as the first K neighboring point, and if the Euclidean distance is greater than the preset distance threshold, the K neighboring point is set Is the second K neighboring point;
  • Obtain a preset ratio threshold and number threshold if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the second K neighboring points The ratio of the number of neighboring points is less than the ratio threshold and the sum of the numbers of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
  • CPU unit is further configured to perform the following steps: further, in another embodiment of the present invention, the CPU unit 4100 is further configured to perform the following steps:
  • Euclidean distance is calculated according to the coordinates of the first point and the coordinates of the second point.
  • the CPU unit 4100 is further configured to perform the following steps:
  • the K neighboring filter template is moved to an unfiltered area in the two-dimensional image, and the filtering operation is repeated until the traversal of the two-dimensional image is completed.
  • the computer 4000 and the CPU unit 4100 can be connected by a bus or other means.
  • the computer 4000 also includes a memory.
  • the memory can be used to store non-transitory software programs and non-transitory Computer-executable programs and modules, such as program instructions/modules corresponding to the device for executing the K-nearest neighbor point cloud filtering method based on image processing in the embodiment of the present invention.
  • the computer 4000 runs the non-transitory software programs, instructions, and modules stored in the memory to control the CPU unit 4100 to execute various functional applications and data processing for executing the K-nearest point cloud filtering method based on image processing, that is, to achieve the above The K-nearest neighbor point cloud filtering method based on image processing of the method embodiment.
  • the memory may include a storage program area and a storage data area, where the storage program area may store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the CPU unit 4100 and the like.
  • the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices.
  • the memory may optionally include a memory remotely provided with respect to the CPU unit 4100, and these remote memories may be connected to the computer 4000 via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the one or more modules are stored in the memory, and when executed by the CPU unit 4100, the K-nearest neighbor point cloud filtering method based on image processing in the foregoing method embodiment is executed.
  • the embodiment of the present invention also provides a computer-readable storage medium that stores computer-executable instructions that are executed by the CPU unit 4100 to implement the above-mentioned K based on image processing. Neighbor point cloud filtering method.
  • the device embodiments described above are merely illustrative, and the devices described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network devices. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each implementation manner can be implemented by means of software plus a general hardware platform.
  • All or part of the processes in the methods of the foregoing embodiments can be implemented by computer programs instructing relevant hardware.
  • the programs can be stored in a computer-readable storage medium.
  • the storage medium may be a magnetic disk, an optical disc, a read-only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

Disclosed in the present invention are an image processing-based K-nearest neighbor point cloud filtering method, an apparatus, and a storage medium. Said method comprise: after acquiring a three-dimensional point cloud, constructing a two-dimensional image, selecting several points in the two-dimensional image by means of a K-nearest neighbor filtering template, calculating the Euclidean distance between the center point and each K-nearest neighbor point, determining whether the center point is a noise point on the basis of the Euclidean distance, a preset distance threshold and a preset ratio threshold, if the center point satisfies the distance threshold and the ratio threshold, counting the number of K-nearest neighbor points in the template on the basis of a number threshold, and if the number of K-nearest neighbor points is less than the number threshold, setting the center point of the template as an outlier noise point. By setting a number threshold, the present invention realizes space limitation, effectively removing outlier, scattered and elongated noise point clouds, and improving the accuracy and scope of application of filtering.

Description

基于图像处理的K近邻点云滤波方法、装置和存储介质K-nearest neighbor point cloud filtering method, device and storage medium based on image processing 技术领域Technical field
本发明涉及三维形貌测量技术领域,特别是一种基于图像处理的k近邻点云滤波方法、装置和存储介质。The invention relates to the technical field of three-dimensional shape measurement, in particular to a k-nearest neighbor point cloud filtering method, device and storage medium based on image processing.
背景技术Background technique
目前,随着三维扫描技术的发展,获取物体表面的三维点云数据越来越容易,推动了三维扫描技术广泛应用于城市建模、逆向工程、测量工程等领域。然而,由于三维扫描设备需要人为操作,加上相机和投影机等设备本身的结构和外界因素的影响,获取到的三维点云中存在噪声点云,现有的去噪方法主要是基于K近邻点的点云滤波方法,但是现有的方法仅针对单独的噪声点进行去除,无法去除狭长状的噪声点云,滤波效果不佳。At present, with the development of 3D scanning technology, it is becoming easier to obtain 3D point cloud data on the surface of an object, which promotes the wide application of 3D scanning technology in urban modeling, reverse engineering, survey engineering and other fields. However, due to the manual operation of 3D scanning equipment, coupled with the structure of the camera and projector and the influence of external factors, there are noisy point clouds in the acquired 3D point cloud. The existing denoising methods are mainly based on K nearest neighbors. Point cloud filtering method, but the existing method only removes individual noise points, and cannot remove the long and narrow noise point cloud, and the filtering effect is not good.
发明内容Summary of the invention
为了克服现有技术的不足,本发明的目的在于提供一种基于图像处理的K近邻点云滤波方法、装置和存储介质,能够去除狭长状的噪声点云,提高K近邻点滤波方法的适用范围。In order to overcome the deficiencies of the prior art, the purpose of the present invention is to provide a K-nearest neighbor point cloud filtering method, device and storage medium based on image processing, which can remove long and narrow noise point clouds and improve the application range of the K-nearest neighbor point cloud filtering method. .
本发明解决其问题所采用的技术方案是:第一方面,本发明提供了一种基于图像处理的K近邻点云滤波方法,包括以下步骤:The technical solution adopted by the present invention to solve its problem is: In the first aspect, the present invention provides a K-nearest neighbor point cloud filtering method based on image processing, which includes the following steps:
获取三维点云,构建出二维图像,所述二维图像中的二维点与所 述三维点云中的三维点唯一对应;Acquiring a three-dimensional point cloud, and constructing a two-dimensional image, where the two-dimensional points in the two-dimensional image uniquely correspond to the three-dimensional points in the three-dimensional point cloud;
获取预先设定的K邻近滤波模板,根据所述K邻近滤波模板对所述二维图像进行卷积计算,得出所述K邻近滤波模板的中心点与所有的K邻近点之间的欧式距离,若所述欧式距离小于预先设定的距离阈值,则将所述K邻近点设置为第一K邻近点,若所述欧式距离大于预先设定的距离阈值,则将所述K邻近点设置为第二K邻近点;Obtain a preset K neighboring filter template, perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the Euclidean distance between the center point of the K neighboring filter template and all K neighboring points , If the Euclidean distance is less than the preset distance threshold, the K neighboring point is set as the first K neighboring point, and if the Euclidean distance is greater than the preset distance threshold, the K neighboring point is set Is the second K neighboring point;
获取预先设定的比例阈值和数量阈值,若所述第一K邻近点与所述第二K邻近点的数量比值大于所述比例阈值,或者所述第一K邻近点与所述第二K邻近点的数量比值小于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,将所述中心点设置为噪声点。Obtain a preset ratio threshold and number threshold, if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the second K neighboring points The ratio of the number of neighboring points is less than the ratio threshold and the sum of the numbers of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
进一步,所述三维点云由绝对相位图和图像获取设备的内外参数进行重构得出,所述图像获取设备包括相机和投影机。Further, the three-dimensional point cloud is obtained by reconstructing the absolute phase map and internal and external parameters of an image acquisition device, and the image acquisition device includes a camera and a projector.
进一步,所述根据所述K邻近滤波模板对所述二维图像进行卷积计算具体包括以下步骤:Further, the performing convolution calculation on the two-dimensional image according to the K neighboring filter template specifically includes the following steps:
获取所述三维点云中与所述中心点所对应的第一点坐标和与所述K邻近点所对应的第二点坐标;Acquiring a first point coordinate corresponding to the center point and a second point coordinate corresponding to the K neighboring point in the three-dimensional point cloud;
根据所述第一点坐标和第二点坐标计算出欧式距离。Euclidean distance is calculated according to the coordinates of the first point and the coordinates of the second point.
进一步,所述K邻近滤波模板的形状包括但不限于矩形和圆形,所述K邻近滤波模板中至少包括中心点和若干个K邻近点。Further, the shape of the K neighboring filter template includes but is not limited to a rectangle and a circle, and the K neighboring filter template includes at least a center point and several K neighboring points.
进一步,若所述第一K邻近点与所述第二K邻近点的数量比值小 于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,还包括:将所述中心点设置为离群噪声点。Further, if the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold and the sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold , Also includes: setting the center point as an outlier noise point.
进一步,将所述中心点设置为噪声点后还包括:将所述K邻近滤波模板移动至所述二维图像中未被滤波的区域,重复执行滤波操作直至完成对所述二维图像的遍历。Further, after setting the center point as a noise point, it further includes: moving the K neighboring filter template to an unfiltered area in the two-dimensional image, and repeating the filtering operation until the traversal of the two-dimensional image is completed .
第二方面,本发明提供了一种用于执行基于图像处理的K近邻点云滤波方法的装置,包括CPU单元,所述CPU单元用于执行以下步骤:In a second aspect, the present invention provides a device for performing a K-nearest neighbor point cloud filtering method based on image processing, including a CPU unit configured to perform the following steps:
获取三维点云,构建出二维图像,所述二维图像中的二维点与所述三维点云中的三维点唯一对应;Acquiring a three-dimensional point cloud and constructing a two-dimensional image, where the two-dimensional points in the two-dimensional image uniquely correspond to the three-dimensional points in the three-dimensional point cloud;
获取预先设定的K邻近滤波模板,根据所述K邻近滤波模板对所述二维图像进行卷积计算,得出所述K邻近滤波模板的中心点与所有的K邻近点之间的欧式距离,若所述欧式距离小于预先设定的距离阈值,则将所述K邻近点设置为第一K邻近点,若所述欧式距离大于预先设定的距离阈值,则将所述K邻近点设置为第二K邻近点;Obtain a preset K neighboring filter template, perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the Euclidean distance between the center point of the K neighboring filter template and all K neighboring points , If the Euclidean distance is less than the preset distance threshold, the K neighboring point is set as the first K neighboring point, and if the Euclidean distance is greater than the preset distance threshold, the K neighboring point is set Is the second K neighboring point;
获取预先设定的比例阈值和数量阈值,若所述第一K邻近点与所述第二K邻近点的数量比值大于所述比例阈值,或者所述第一K邻近点与所述第二K邻近点的数量比值小于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,将所述中心点设置为噪声点。Obtain a preset ratio threshold and number threshold, if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the second K neighboring points The ratio of the number of neighboring points is less than the ratio threshold and the sum of the numbers of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
进一步,所述CPU单元还用于执行以下步骤:Further, the CPU unit is also used to perform the following steps:
获取所述三维点云中与所述中心点所对应的第一点坐标和与所 述K邻近点所对应的第二点坐标;Acquiring a first point coordinate corresponding to the center point and a second point coordinate corresponding to the K neighboring point in the three-dimensional point cloud;
根据所述第一点坐标和第二点坐标计算出欧式距离。Euclidean distance is calculated according to the coordinates of the first point and the coordinates of the second point.
进一步,所述CPU单元还用于执行以下步骤:Further, the CPU unit is also used to perform the following steps:
将所述K邻近滤波模板移动至所述二维图像中未被滤波的区域,重复执行滤波操作直至完成对所述二维图像的遍历。The K neighboring filter template is moved to an unfiltered area in the two-dimensional image, and the filtering operation is repeated until the traversal of the two-dimensional image is completed.
第三方面,本发明提供了一种用于执行基于图像处理的K近邻点云滤波方法的设备,包括至少一个控制处理器和用于与至少一个控制处理器通信连接的存储器;存储器存储有可被至少一个控制处理器执行的指令,指令被至少一个控制处理器执行,以使至少一个控制处理器能够执行如上所述的基于图像处理的K近邻点云滤波方法。In a third aspect, the present invention provides a device for performing a K-nearest neighbor point cloud filtering method based on image processing, including at least one control processor and a memory for communicating with the at least one control processor; the memory stores the The instruction executed by the at least one control processor is executed by the at least one control processor, so that the at least one control processor can execute the K-nearest neighbor point cloud filtering method based on image processing as described above.
第四方面,本发明提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机可执行指令,计算机可执行指令用于使计算机执行如上所述的基于图像处理的K近邻点云滤波方法。In a fourth aspect, the present invention provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make the computer execute the K-nearest neighbor point cloud filtering based on image processing as described above method.
第五方面,本发明还提供了一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使计算机执行如上所述的基于图像处理的K近邻点云滤波方法。In a fifth aspect, the present invention also provides a computer program product, the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer , Let the computer execute the K-nearest neighbor point cloud filtering method based on image processing as described above.
本发明实施例中提供的一个或多个技术方案,至少具有如下有益效果:本发明在获取三维点云后,构建出二维图像,通过K邻近滤波模板在二维图像中选中若干个点,计算出中心点与K邻近点之间的欧式距离,基于欧式距离和预先设定的距离阈值和比例阈值判断中心点 是否为噪声点,对于满足距离阈值和比例阈值的中心点,基于数量阈值对模板中的K邻近点数量进行统计,将数量小于数量阈值的模板的中心点设置为离群的噪声点,通过设置数量阈值实现了空间层面的限制,有效去除离群、散乱和狭长的噪声点云,提高滤波的准确性和适用范围。The one or more technical solutions provided in the embodiments of the present invention have at least the following beneficial effects: the present invention constructs a two-dimensional image after acquiring a three-dimensional point cloud, and selects several points in the two-dimensional image through the K neighbor filter template, Calculate the Euclidean distance between the center point and K neighboring points, and determine whether the center point is a noise point based on the Euclidean distance and the preset distance threshold and ratio threshold. For the center point that meets the distance threshold and the ratio threshold, the number threshold is compared The number of K neighboring points in the template is counted, and the center point of the template whose number is less than the number threshold is set as outlier noise points. By setting the number threshold, the space level limitation is realized, and outliers, scattered and narrow noise points are effectively removed Cloud, improve the accuracy and scope of filtering.
附图说明Description of the drawings
下面结合附图和实例对本发明作进一步说明。The present invention will be further explained below with reference to the drawings and examples.
图1是本发明实施例提供的一种基于图像处理的K近邻点云滤波方法的流程图;Fig. 1 is a flowchart of a K-nearest neighbor point cloud filtering method based on image processing provided by an embodiment of the present invention;
图2是本发明实施例提供的一种基于图像处理的K近邻点云滤波方法中根据所述K邻近滤波模板对所述二维图像进行卷积计算的流程图;2 is a flowchart of performing convolution calculation on the two-dimensional image according to the K neighbor filter template in a K neighbor point cloud filtering method based on image processing according to an embodiment of the present invention;
图3是本发明实施例提供的一种基于图像处理的K近邻点云滤波方法的完整流程图;Fig. 3 is a complete flow chart of a K-nearest neighbor point cloud filtering method based on image processing provided by an embodiment of the present invention;
图4是本发明另一实施例提供的一种用于执行基于图像处理的K近邻点云滤波方法的装置示意图。Fig. 4 is a schematic diagram of an apparatus for performing a K-nearest neighbor point cloud filtering method based on image processing according to another embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions, and advantages of the present invention clearer, the following further describes the present invention in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not used to limit the present invention.
需要说明的是,如果不冲突,本发明实施例中的各个特征可以相 互结合,均在本发明的保护范围之内。另外,虽然在装置示意图中进行了功能模块划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置中的模块划分,或流程图中的顺序执行所示出或描述的步骤。It should be noted that if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, and all fall within the protection scope of the present invention. In addition, although functional modules are divided in the schematic diagram of the device, and the logical sequence is shown in the flowchart, in some cases, the module division in the device may be different from the module division in the device, or the sequence shown in the flowchart may be executed. Or the steps described.
参考图1,本发明的第一实施例提供了一种基于图像处理的K近邻点云滤波方法,包括以下步骤:Referring to Fig. 1, the first embodiment of the present invention provides a K-nearest neighbor point cloud filtering method based on image processing, including the following steps:
步骤S100,获取三维点云,构建出二维图像,所述二维图像中的二维点与所述三维点云中的三维点唯一对应;Step S100, acquiring a three-dimensional point cloud, and constructing a two-dimensional image, where the two-dimensional points in the two-dimensional image uniquely correspond to the three-dimensional points in the three-dimensional point cloud;
步骤S200,获取预先设定的K邻近滤波模板,根据所述K邻近滤波模板对所述二维图像进行卷积计算,得出所述K邻近滤波模板的中心点与所有的K邻近点之间的欧式距离,若所述欧式距离小于预先设定的距离阈值,则将所述K邻近点设置为第一K邻近点,若所述欧式距离大于预先设定的距离阈值,则将所述K邻近点设置为第二K邻近点;Step S200: Obtain a preset K neighboring filter template, and perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the distance between the center point of the K neighboring filter template and all K neighboring points If the Euclidean distance is less than the preset distance threshold, set the K neighboring point as the first K neighboring point; if the Euclidean distance is greater than the preset distance threshold, set the K The neighboring point is set as the second K neighboring point;
步骤S300,获取预先设定的比例阈值和数量阈值,若所述第一K邻近点与所述第二K邻近点的数量比值大于所述比例阈值,或者所述第一K邻近点与所述第二K邻近点的数量比值小于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,将所述中心点设置为噪声点。Step S300: Obtain a preset ratio threshold and number threshold. If the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the number The number ratio of the second K neighboring points is less than the ratio threshold and the sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
其中,需要说明的是,本实施例的三维点是根据图像平面内的绝对相位图的每一点重构出来的,所以在图像平面内的绝对相位图的每 一个点都与重构出来的三维点有着一一对应的关系,即构建的二维图像既包含了绝对相位图的位置信息也包含了三维点的信息,有利于进行滤波计算。其中,需要说明的是,重构的方法可以采用现有技术中任意的三维到二维图形的重构方法,本发明并不涉及具体的重构方法改进,在此不再赘述。Among them, it should be noted that the three-dimensional points in this embodiment are reconstructed according to each point of the absolute phase map in the image plane, so each point of the absolute phase map in the image plane is the same as the reconstructed three-dimensional point. The points have a one-to-one correspondence, that is, the constructed two-dimensional image contains not only the position information of the absolute phase map but also the three-dimensional point information, which is beneficial to the filtering calculation. Among them, it should be noted that the reconstruction method can use any three-dimensional to two-dimensional graphics reconstruction method in the prior art, and the present invention does not involve the improvement of specific reconstruction methods, and will not be repeated here.
其中,需要说明的是,本实施例优选通过K邻近滤波模板从二维图像中限定一定的空间范围,因此K邻近点的数量有限,若数量过少,则代表区域为离群或散乱的噪声区域,从而实现增加空间信息对点云进行滤噪。可以理解的是,欧式距离能够较好地体现两点的空间距离,为本实施例的优选,也可以采用其他类型的参数,能够实现相似效果即可。本领域技术人员可以理解的是,出于对不同的滤波精度要求,距离阈值、比例阈值和数量阈值由实际需求调整即可,本实施例并不因为具体的数值造成限制。Among them, it should be noted that this embodiment preferably uses the K neighbor filter template to define a certain spatial range from the two-dimensional image. Therefore, the number of K neighbor points is limited. If the number is too small, the representative area is outlying or scattered noise. Area, so as to increase the spatial information to filter the noise of the point cloud. It can be understood that the Euclidean distance can better reflect the spatial distance between two points, which is the preferred embodiment of this embodiment, and other types of parameters can also be used to achieve similar effects. Those skilled in the art can understand that, due to different filtering accuracy requirements, the distance threshold, the ratio threshold, and the quantity threshold can be adjusted according to actual needs, and this embodiment is not limited due to specific numerical values.
其中,在步骤S300中,若第一K邻近点与第二K邻近点的数量比值小于比例阈值,则代表中心点到邻近点所对应的三维点的距离相对较近,因此中心点基于图像处理的层面并非噪声点,但若K邻近滤波模板中的点较少,对应的则是大片的离群噪声,在这种情况下,本实施例优选通过数量阈值进行判断,若第一K邻近点和第二K邻近点的数量和小于数量阈值,则将中心点设置为离群噪声,从而去除狭长状的片状噪声。另外,第一K邻近点与第二K邻近点的数量比值若大于比例阈值,则代表中心点离其他邻近点的距离较远,大概率为点云 中的噪声点,将中心点直接设置为噪声点,无需再进行数量阈值的判断,能够简化计算过程。Wherein, in step S300, if the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold, it means that the distance between the center point and the three-dimensional point corresponding to the neighboring points is relatively short. Therefore, the center point is based on image processing. The level of is not a noise point, but if there are fewer points in the K neighboring filter template, the corresponding is a large area of outlier noise. In this case, this embodiment preferably judges by the number threshold. If the first K neighboring point If the sum of the number of neighboring points with the second K is less than the number threshold, the center point is set as outlier noise, so as to remove the long and narrow patchy noise. In addition, if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, it means that the center point is far away from other neighboring points, which is probably a noise point in the point cloud. Set the center point directly to For noise points, there is no need to judge the number threshold, which can simplify the calculation process.
进一步,所述三维点云由绝对相位图和图像获取设备的内外参数进行重构得出,所述图像获取设备包括相机和投影机。Further, the three-dimensional point cloud is obtained by reconstructing the absolute phase map and internal and external parameters of an image acquisition device, and the image acquisition device includes a camera and a projector.
其中,需要说明的是,三维点云可以采用任何现有技术中的设备进行获取,本实施例优选通过相机和投影机,具体的三维点云获取方法并非本发明的改进之处,在此不再赘述。Among them, it should be noted that the three-dimensional point cloud can be acquired by any device in the prior art. In this embodiment, a camera and a projector are preferably used. The specific three-dimensional point cloud acquisition method is not an improvement of the present invention. Go into details again.
参考图2,进一步,所述根据所述K邻近滤波模板对所述二维图像进行卷积计算具体包括以下步骤:Referring to FIG. 2, further, the performing convolution calculation on the two-dimensional image according to the K neighboring filter template specifically includes the following steps:
步骤S210,获取所述三维点云中与所述中心点所对应的第一点坐标和与所述K邻近点所对应的第二点坐标;Step S210, acquiring the first point coordinates corresponding to the center point and the second point coordinates corresponding to the K neighboring points in the three-dimensional point cloud;
步骤S220,根据所述第一点坐标和第二点坐标计算出欧式距离。Step S220: Calculate the Euclidean distance according to the coordinates of the first point and the coordinates of the second point.
其中,需要说明的是,由于K邻近滤波模板中包括至少若干个K邻近点,因此本实施例优选将中心点与其他K邻近点逐个进行对比,重复执行步骤S210和步骤S220,直至完成对所有点的计算。Among them, it should be noted that since the K neighboring filter template includes at least several K neighboring points, this embodiment preferably compares the center point with other K neighboring points one by one, and repeating step S210 and step S220 until all the K neighboring points are completed. Point calculation.
进一步,所述K邻近滤波模板的形状包括但不限于矩形和圆形,所述K邻近滤波模板中至少包括中心点和若干个K邻近点。Further, the shape of the K neighboring filter template includes but is not limited to a rectangle and a circle, and the K neighboring filter template includes at least a center point and several K neighboring points.
其中,需要说明的是,K邻近滤波模板的具体形状可以根据实际需求确定,这并不会对本市实施例造成限制,圆形和矩形仅为本实施例的优选。可以理解的是,例如K邻近滤波模板的为M×N大小矩形,则K=M×N-1,避免对中心点重复计算。Among them, it should be noted that the specific shape of the K neighboring filter template can be determined according to actual needs, which does not limit the embodiment in this city, and the circle and rectangle are only preferred in this embodiment. It can be understood that, for example, if the K neighboring filter template is a rectangle with a size of M×N, then K=M×N-1, avoiding repeated calculation of the center point.
进一步,若所述第一K邻近点与所述第二K邻近点的数量比值小于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,还包括:将所述中心点设置为离群噪声点。Further, if the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold and the sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold , Also includes: setting the center point as an outlier noise point.
其中,需要说明的是,将满足第一K邻近点与第二K邻近点的数量比值小于比例阈值且第一K邻近点和第二K邻近点的数量和小于数量阈值设置为离群噪声点为本实施例的优选,也可以仅设置为噪声点,本实施例设置成离群噪声点能够与普通的噪声点进行区分,便于后续处理。Among them, it should be noted that the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold and the sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold is set as outlier noise points The preferred embodiment of this embodiment can also only be set as noise points. In this embodiment, outlier noise points can be distinguished from ordinary noise points, which is convenient for subsequent processing.
进一步,将所述中心点设置为噪声点后还包括:将所述K邻近滤波模板移动至所述二维图像中未被滤波的区域,重复执行滤波操作直至完成对所述二维图像的遍历。Further, after setting the center point as a noise point, the method further includes: moving the K neighboring filter template to an unfiltered area in the two-dimensional image, and repeating the filtering operation until the traversal of the two-dimensional image is completed .
其中,需要说明的是,由于K邻近滤波模板小于二维图像,即并未包括所有二维图像中的点,因此在执行完一次滤波后,移动K邻近滤波模板,使得K邻近滤波模板在二维图像中滑动,直至完成遍历,对所有点完成滤波,以确保滤波的完整和准确。Among them, it should be noted that since the K neighboring filter template is smaller than the two-dimensional image, that is, it does not include all points in the two-dimensional image, after performing one filtering, the K neighboring filter template is moved so that the K neighboring filter template is in two Slide in the two-dimensional image until the traversal is completed, and filter all points to ensure the integrity and accuracy of the filtering.
参考图3,另外,本发明的另一个实施例还提供了一种基于图像处理的K近邻点云滤波方法,包括以下步骤:Referring to FIG. 3, in addition, another embodiment of the present invention also provides a K-nearest neighbor point cloud filtering method based on image processing, including the following steps:
步骤S3100,获取三维点云中与中心点所对应的第一点坐标和与K邻近点所对应的第二点坐标;Step S3100: Obtain the coordinates of the first point corresponding to the center point and the coordinates of the second point corresponding to the K neighboring points in the three-dimensional point cloud;
步骤S3200,获取预先设定的K邻近滤波模板,获取三维点云中与K邻居滤波模板的中心点所对应的第一点坐标和 与K邻近点所对应的第二点坐标;Step S3200: Obtain a preset K neighbor filter template, and acquire the first point coordinates corresponding to the center point of the K neighbor filter template and the second point coordinates corresponding to the K neighbor points in the three-dimensional point cloud;
步骤S3300,判断欧式距离是否大于距离阈值,若是,执行步骤S3310,否则执行步骤S3320;Step S3300, it is judged whether the Euclidean distance is greater than the distance threshold, if yes, go to step S3310, otherwise go to step S3320;
步骤S3310,K邻近点设置为第一K邻近点,执行步骤S3330;Step S3310, the K neighboring point is set as the first K neighboring point, and step S3330 is executed;
步骤S3320,K邻近点设置为第二K邻近点,执行步骤S3330;Step S3320, the K neighboring point is set as the second K neighboring point, and step S3330 is executed;
步骤S3330,计算第一K邻近点与第二K邻近点的数量的比值;Step S3330: Calculate the ratio of the number of the first K neighboring points to the second K neighboring points;
步骤S3400,判断步骤S3330中得出的比值是否大于比例阈值,若是,执行步骤S3410,否则执行步骤S3420;Step S3400, it is judged whether the ratio obtained in step S3330 is greater than the ratio threshold value, if yes, go to step S3410, otherwise go to step S3420;
步骤S3410,将中心点设置为噪声点,移动K近邻滤波模板,若未完整遍历二位图像,执行步骤S3100;Step S3410, set the center point as a noise point, move the K-nearest neighbor filter template, if the two-bit image is not completely traversed, perform step S3100;
步骤S3420,计算第一K邻近点与第二K邻近点的数量之和,与数量阈值相比,若大于数量阈值,执行步骤S3422,若小于数量阈值,执行步骤S3423;Step S3420: Calculate the sum of the numbers of the first K neighboring points and the second K neighboring points. Compared with the number threshold, if it is greater than the number threshold, perform step S3422, and if it is less than the number threshold, perform step S3423;
步骤S3422,将中心点设置为离群的噪声点,移动K近邻滤波模板,若未完整遍历二位图像,执行步骤S3100;Step S3422, set the center point as an outlier noise point, move the K-nearest neighbor filter template, if the two-bit image is not completely traversed, perform step S3100;
步骤S3423,保留保留中心点,移动K近邻滤波模板,若未完整遍历二位图像,执行步骤S3100。In step S3423, the center point is retained, and the K-nearest neighbor filter template is moved. If the two-bit image is not completely traversed, step S3100 is executed.
需要说明的是,本实施例的步骤S3100至S3330基于图像处理实现了点云的滤波,步骤S3400至S3423增加了k近邻的空间信息,实现了大片狭长状的噪声点云。It should be noted that steps S3100 to S3330 of this embodiment implement point cloud filtering based on image processing, and steps S3400 to S3423 increase the spatial information of k-nearest neighbors to implement a large and narrow noise point cloud.
参照图4,本发明的第二实施例还提供了一种用于执行基于图像 处理的K近邻点云滤波方法的装置,该装置为智能设备,例如智能手机、计算机和平板电脑等,本实施例以计算机为例加以说明。4, the second embodiment of the present invention also provides a device for performing K-nearest neighbor point cloud filtering method based on image processing. The device is a smart device, such as a smart phone, a computer, and a tablet. Take the computer as an example to illustrate.
在该用于执行基于图像处理的K近邻点云滤波方法的计算机4000中,包括CPU单元4100,所述CPU单元4100用于执行以下步骤:The computer 4000 for performing the K-nearest neighbor point cloud filtering method based on image processing includes a CPU unit 4100, and the CPU unit 4100 is configured to perform the following steps:
获取三维点云,构建出二维图像,所述二维图像中的二维点与所述三维点云中的三维点唯一对应;Acquiring a three-dimensional point cloud and constructing a two-dimensional image, where the two-dimensional points in the two-dimensional image uniquely correspond to the three-dimensional points in the three-dimensional point cloud;
获取预先设定的K邻近滤波模板,根据所述K邻近滤波模板对所述二维图像进行卷积计算,得出所述K邻近滤波模板的中心点与所有的K邻近点之间的欧式距离,若所述欧式距离小于预先设定的距离阈值,则将所述K邻近点设置为第一K邻近点,若所述欧式距离大于预先设定的距离阈值,则将所述K邻近点设置为第二K邻近点;Obtain a preset K neighboring filter template, perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the Euclidean distance between the center point of the K neighboring filter template and all K neighboring points , If the Euclidean distance is less than the preset distance threshold, the K neighboring point is set as the first K neighboring point, and if the Euclidean distance is greater than the preset distance threshold, the K neighboring point is set Is the second K neighboring point;
获取预先设定的比例阈值和数量阈值,若所述第一K邻近点与所述第二K邻近点的数量比值大于所述比例阈值,或者所述第一K邻近点与所述第二K邻近点的数量比值小于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,将所述中心点设置为噪声点。Obtain a preset ratio threshold and number threshold, if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the second K neighboring points The ratio of the number of neighboring points is less than the ratio threshold and the sum of the numbers of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
进一步,所述CPU单元还用于执行以下步骤:进一步,本发明的另一个实施例中,所述CPU单元4100还用于执行以下步骤:Further, the CPU unit is further configured to perform the following steps: further, in another embodiment of the present invention, the CPU unit 4100 is further configured to perform the following steps:
获取所述三维点云中与所述中心点所对应的第一点坐标和与所述K邻近点所对应的第二点坐标;Acquiring a first point coordinate corresponding to the center point and a second point coordinate corresponding to the K neighboring point in the three-dimensional point cloud;
根据所述第一点坐标和第二点坐标计算出欧式距离。Euclidean distance is calculated according to the coordinates of the first point and the coordinates of the second point.
进一步,本发明的另一个实施例中,所述CPU单元4100还用于执行以下步骤:Further, in another embodiment of the present invention, the CPU unit 4100 is further configured to perform the following steps:
将所述K邻近滤波模板移动至所述二维图像中未被滤波的区域,重复执行滤波操作直至完成对所述二维图像的遍历。The K neighboring filter template is moved to an unfiltered area in the two-dimensional image, and the filtering operation is repeated until the traversal of the two-dimensional image is completed.
计算机4000和CPU单元4100之间可以通过总线或者其他方式连接,计算机4000中还包括存储器,所述存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态性计算机可执行程序以及模块,如本发明实施例中的用于执行基于图像处理的K近邻点云滤波方法的设备对应的程序指令/模块。计算机4000通过运行存储在存储器中的非暂态软件程序、指令以及模块,从而控制CPU单元4100执行用于执行基于图像处理的K近邻点云滤波方法的各种功能应用以及数据处理,即实现上述方法实施例的基于图像处理的K近邻点云滤波方法。The computer 4000 and the CPU unit 4100 can be connected by a bus or other means. The computer 4000 also includes a memory. As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory Computer-executable programs and modules, such as program instructions/modules corresponding to the device for executing the K-nearest neighbor point cloud filtering method based on image processing in the embodiment of the present invention. The computer 4000 runs the non-transitory software programs, instructions, and modules stored in the memory to control the CPU unit 4100 to execute various functional applications and data processing for executing the K-nearest point cloud filtering method based on image processing, that is, to achieve the above The K-nearest neighbor point cloud filtering method based on image processing of the method embodiment.
存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据CPU单元4100的使用所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器可选包括相对于CPU单元4100远程设置的存储器,这些远程存储器可以通过网络连接至该计算机4000。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory may include a storage program area and a storage data area, where the storage program area may store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the CPU unit 4100 and the like. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely provided with respect to the CPU unit 4100, and these remote memories may be connected to the computer 4000 via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
所述一个或者多个模块存储在所述存储器中,当被所述CPU单元4100执行时,执行上述方法实施例中的基于图像处理的K近邻点云滤波方法。The one or more modules are stored in the memory, and when executed by the CPU unit 4100, the K-nearest neighbor point cloud filtering method based on image processing in the foregoing method embodiment is executed.
本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令被CPU单元4100执行,实现上述所述的基于图像处理的K近邻点云滤波方法。The embodiment of the present invention also provides a computer-readable storage medium that stores computer-executable instructions that are executed by the CPU unit 4100 to implement the above-mentioned K based on image processing. Neighbor point cloud filtering method.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的装置可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络装置上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The device embodiments described above are merely illustrative, and the devices described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network devices. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
需要说明的是,由于本实施例中的用于执行基于图像处理的K近邻点云滤波方法的装置与上述的基于图像处理的K近邻点云滤波方法基于相同的发明构思,因此,方法实施例中的相应内容同样适用于本装置实施例,此处不再详述。It should be noted that, since the apparatus for performing the K-nearest neighbor point cloud filtering method based on image processing in this embodiment is based on the same inventive concept as the above-mentioned K-nearest neighbor point cloud filtering method based on image processing, the method embodiment The corresponding content in is also applicable to this device embodiment, and will not be described in detail here.
通过以上的实施方式的描述,本领域技术人员可以清楚地了解到各实施方式可借助软件加通用硬件平台的方式来实现。本领域技术人员可以理解实现上述实施例方法中的全部或部分流程是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(ReadOnly Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Through the description of the above implementation manners, those skilled in the art can clearly understand that each implementation manner can be implemented by means of software plus a general hardware platform. Those skilled in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by computer programs instructing relevant hardware. The programs can be stored in a computer-readable storage medium. When the program is executed, , May include the flow of the embodiment of the above-mentioned method. Wherein, the storage medium may be a magnetic disk, an optical disc, a read-only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.
以上是对本发明的较佳实施进行了具体说明,但本发明并不局限于上述实施方式,熟悉本领域的技术人员在不违背本发明精神的前提下还可作出种种的等同变形或替换,这些等同的变形或替换均包含在本申请权利要求所限定的范围内。The above is a detailed description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. Equivalent modifications or replacements are all included in the scope defined by the claims of this application.

Claims (10)

  1. 一种基于图像处理的K近邻点云滤波方法,其特征在于,包括以下步骤:A K-nearest neighbor point cloud filtering method based on image processing is characterized in that it comprises the following steps:
    获取三维点云,构建出二维图像,所述二维图像中的二维点与所述三维点云中的三维点唯一对应;Acquiring a three-dimensional point cloud and constructing a two-dimensional image, where the two-dimensional points in the two-dimensional image uniquely correspond to the three-dimensional points in the three-dimensional point cloud;
    获取预先设定的K邻近滤波模板,根据所述K邻近滤波模板对所述二维图像进行卷积计算,得出所述K邻近滤波模板的中心点与所有的K邻近点之间的欧式距离,若所述欧式距离小于预先设定的距离阈值,则将所述K邻近点设置为第一K邻近点,若所述欧式距离大于预先设定的距离阈值,则将所述K邻近点设置为第二K邻近点;Obtain a preset K neighboring filter template, perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the Euclidean distance between the center point of the K neighboring filter template and all K neighboring points , If the Euclidean distance is less than the preset distance threshold, the K neighboring point is set as the first K neighboring point, and if the Euclidean distance is greater than the preset distance threshold, the K neighboring point is set Is the second K neighboring point;
    获取预先设定的比例阈值和数量阈值,若所述第一K邻近点与所述第二K邻近点的数量比值大于所述比例阈值,或者所述第一K邻近点与所述第二K邻近点的数量比值小于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,将所述中心点设置为噪声点。Obtain a preset ratio threshold and number threshold, if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the second K neighboring points The ratio of the number of neighboring points is less than the ratio threshold and the sum of the numbers of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
  2. 根据权利要求1所述的一种基于图像处理的K近邻点云滤波方法,其特征在于:所述三维点云由绝对相位图和图像获取设备的内外参数进行重构得出,所述图像获取设备包括相机和投影机。The K-nearest neighbor point cloud filtering method based on image processing according to claim 1, wherein the three-dimensional point cloud is reconstructed from the absolute phase map and the internal and external parameters of the image acquisition device, and the image acquisition The equipment includes a camera and a projector.
  3. 根据权利要求1所述的一种基于图像处理的K近邻点云滤波方法,其特征在于,所述根据所述K邻近滤波模板对所述二维图像进行卷积计算具体包括以下步骤:The K-nearest neighbor point cloud filtering method based on image processing according to claim 1, wherein the performing convolution calculation on the two-dimensional image according to the K-nearest filter template specifically comprises the following steps:
    获取所述三维点云中与所述中心点所对应的第一点坐标和与所述K邻近点所对应的第二点坐标;Acquiring a first point coordinate corresponding to the center point and a second point coordinate corresponding to the K neighboring point in the three-dimensional point cloud;
    根据所述第一点坐标和第二点坐标计算出欧式距离。Euclidean distance is calculated according to the coordinates of the first point and the coordinates of the second point.
  4. 根据权利要求1所述的一种基于图像处理的K近邻点云滤波方法,其特征在于:所述K邻近滤波模板的形状包括但不限于矩形和圆形,所述K邻近滤波模板中至少包括中心点和若干个K邻近点。The K-nearest neighbor point cloud filtering method based on image processing according to claim 1, wherein the shape of the K-nearest filter template includes but is not limited to a rectangle and a circle, and the K-nearest filter template includes at least The central point and several K neighboring points.
  5. 根据权利要求1所述的一种基于图像处理的K近邻点云滤波方法,其特征在于,若所述第一K邻近点与所述第二K邻近点的数量比值小于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,还包括:将所述中心点设置为离群噪声点。The K-nearest neighbor point cloud filtering method based on image processing according to claim 1, wherein if the ratio of the number of the first K neighboring points to the second K neighboring points is less than the ratio threshold and the ratio The sum of the number of the first K neighboring points and the second K neighboring points is less than the number threshold, and the method further includes: setting the center point as an outlier noise point.
  6. 根据权利要求1所述的一种基于图像处理的K近邻点云滤波方法,其特征在于,将所述中心点设置为噪声点后还包括:将所述K邻近滤波模板移动至所述二维图像中未被滤波的区域,重复执行滤波操作直至完成对所述二维图像的遍历。The K-nearest neighbor point cloud filtering method based on image processing according to claim 1, wherein after setting the center point as a noise point, the method further comprises: moving the K-nearest filter template to the two-dimensional For the unfiltered area in the image, the filtering operation is repeated until the traversal of the two-dimensional image is completed.
  7. 一种用于执行基于图像处理的K近邻点云滤波方法的装置,其特征在于,包括CPU单元,所述CPU单元用于执行以下步骤:A device for performing the K-nearest neighbor point cloud filtering method based on image processing, characterized in that it comprises a CPU unit, and the CPU unit is configured to perform the following steps:
    获取三维点云,构建出二维图像,所述二维图像中的二维点与所述三维点云中的三维点唯一对应;Acquiring a three-dimensional point cloud and constructing a two-dimensional image, where the two-dimensional points in the two-dimensional image uniquely correspond to the three-dimensional points in the three-dimensional point cloud;
    获取预先设定的K邻近滤波模板,根据所述K邻近滤波模板对所述二维图像进行卷积计算,得出所述K邻近滤波模板的中心点与所有的K邻近点之间的欧式距离,若所述欧式距离小于预先设定的距离阈值, 则将所述K邻近点设置为第一K邻近点,若所述欧式距离大于预先设定的距离阈值,则将所述K邻近点设置为第二K邻近点;Obtain a preset K neighboring filter template, perform convolution calculation on the two-dimensional image according to the K neighboring filter template, and obtain the Euclidean distance between the center point of the K neighboring filter template and all K neighboring points If the Euclidean distance is less than the preset distance threshold, then the K neighboring point is set as the first K neighboring point, and if the Euclidean distance is greater than the preset distance threshold, then the K neighboring point is set Is the second K neighboring point;
    获取预先设定的比例阈值和数量阈值,若所述第一K邻近点与所述第二K邻近点的数量比值大于所述比例阈值,或者所述第一K邻近点与所述第二K邻近点的数量比值小于所述比例阈值且所述第一K邻近点和所述第二K邻近点的数量和小于所述数量阈值,将所述中心点设置为噪声点。Obtain a preset ratio threshold and number threshold, if the ratio of the number of the first K neighboring points to the second K neighboring points is greater than the ratio threshold, or the first K neighboring points and the second K neighboring points The ratio of the number of neighboring points is less than the ratio threshold and the sum of the numbers of the first K neighboring points and the second K neighboring points is less than the number threshold, and the center point is set as a noise point.
  8. 根据权利要求7所述的一种用于执行基于图像处理的K近邻点云滤波方法的装置,其特征在于,所述CPU单元还用于执行以下步骤:获取所述三维点云中与所述中心点所对应的第一点坐标和与所述K邻近点所对应的第二点坐标;The apparatus for performing K-nearest neighbor point cloud filtering method based on image processing according to claim 7, wherein the CPU unit is further configured to perform the following steps: acquiring the three-dimensional point cloud and the The coordinates of the first point corresponding to the center point and the coordinates of the second point corresponding to the K neighboring points;
    根据所述第一点坐标和第二点坐标计算出欧式距离。Euclidean distance is calculated according to the coordinates of the first point and the coordinates of the second point.
  9. 根据权利要求7所述的一种用于执行基于图像处理的K近邻点云滤波方法的装置,其特征在于,所述CPU单元还用于执行以下步骤:将所述K邻近滤波模板移动至所述二维图像中未被滤波的区域,重复执行滤波操作直至完成对所述二维图像的遍历。The apparatus for performing the K-nearest neighbor point cloud filtering method based on image processing according to claim 7, wherein the CPU unit is further configured to perform the following step: move the K-nearest filter template to all For the unfiltered area in the two-dimensional image, the filtering operation is repeated until the traversal of the two-dimensional image is completed.
  10. 一种计算机可读存储介质,其特征在于:所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行如权利要求1-6任一项所述的一种基于图像处理的K近邻点云滤波方法。A computer-readable storage medium, characterized in that: the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make a computer execute any one of claims 1-6. A K-nearest neighbor point cloud filtering method based on image processing.
PCT/CN2020/091749 2020-01-17 2020-05-22 Image processing-based k-nearest neighbor point cloud filtering method, apparatus, and storage medium WO2021142995A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010051013.7 2020-01-17
CN202010051013.7A CN111275810B (en) 2020-01-17 2020-01-17 K nearest neighbor point cloud filtering method and device based on image processing and storage medium

Publications (1)

Publication Number Publication Date
WO2021142995A1 true WO2021142995A1 (en) 2021-07-22

Family

ID=71001739

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/091749 WO2021142995A1 (en) 2020-01-17 2020-05-22 Image processing-based k-nearest neighbor point cloud filtering method, apparatus, and storage medium

Country Status (2)

Country Link
CN (1) CN111275810B (en)
WO (1) WO2021142995A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111862351B (en) * 2020-08-03 2024-01-19 字节跳动有限公司 Positioning model optimization method, positioning method and positioning equipment
CN113340266A (en) * 2021-06-02 2021-09-03 江苏豪杰测绘科技有限公司 Indoor space surveying and mapping system and method
CN114612598A (en) * 2022-02-16 2022-06-10 苏州一径科技有限公司 Point cloud processing method and device and laser radar
CN116774688A (en) * 2022-03-10 2023-09-19 苏州科瓴精密机械科技有限公司 Map optimization method, device, equipment and storage medium
CN115436912B (en) * 2022-11-02 2023-03-17 苏州一径科技有限公司 Point cloud processing method and device and laser radar

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106548520A (en) * 2016-11-16 2017-03-29 湖南拓视觉信息技术有限公司 A kind of method and system of cloud data denoising
CN106918813A (en) * 2017-03-08 2017-07-04 浙江大学 A kind of three-dimensional sonar point cloud chart image intensifying method based on distance statistics
CN107392875A (en) * 2017-08-01 2017-11-24 长安大学 A kind of cloud data denoising method based on the division of k neighbours domain
CN110109142A (en) * 2019-04-04 2019-08-09 深圳市速腾聚创科技有限公司 Point cloud filtering method, device, computer equipment and storage medium
CN110136072A (en) * 2018-02-08 2019-08-16 北京大学 Minimizing technology, denoising system, computer equipment and the storage medium of point cloud noise

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7023432B2 (en) * 2001-09-24 2006-04-04 Geomagic, Inc. Methods, apparatus and computer program products that reconstruct surfaces from data point sets
CN103106688B (en) * 2013-02-20 2016-04-27 北京工业大学 Based on the indoor method for reconstructing three-dimensional scene of double-deck method for registering
CN106204705B (en) * 2016-07-05 2018-12-07 长安大学 A kind of 3D point cloud dividing method based on multi-line laser radar
CN107369161B (en) * 2017-07-19 2020-09-11 无锡信捷电气股份有限公司 Scattered workpiece point cloud segmentation method based on improved Euclidean clustering
CN109345620B (en) * 2018-08-13 2022-06-24 浙江大学 Improved object point cloud splicing method for ICP (inductively coupled plasma) to-be-measured object by fusing fast point feature histogram
CN110458772B (en) * 2019-07-30 2022-11-15 五邑大学 Point cloud filtering method and device based on image processing and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106548520A (en) * 2016-11-16 2017-03-29 湖南拓视觉信息技术有限公司 A kind of method and system of cloud data denoising
CN106918813A (en) * 2017-03-08 2017-07-04 浙江大学 A kind of three-dimensional sonar point cloud chart image intensifying method based on distance statistics
CN107392875A (en) * 2017-08-01 2017-11-24 长安大学 A kind of cloud data denoising method based on the division of k neighbours domain
CN110136072A (en) * 2018-02-08 2019-08-16 北京大学 Minimizing technology, denoising system, computer equipment and the storage medium of point cloud noise
CN110109142A (en) * 2019-04-04 2019-08-09 深圳市速腾聚创科技有限公司 Point cloud filtering method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111275810B (en) 2022-06-24
CN111275810A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
WO2021142995A1 (en) Image processing-based k-nearest neighbor point cloud filtering method, apparatus, and storage medium
CN111275633B (en) Point cloud denoising method, system, device and storage medium based on image segmentation
KR101855224B1 (en) Image processing method and apparatus
CN110458772B (en) Point cloud filtering method and device based on image processing and storage medium
US10872432B2 (en) Disparity estimation device, disparity estimation method, and program
WO2022021309A1 (en) Method and apparatus for establishing model, electronic device, and computer readable storage medium
US11263356B2 (en) Scalable and precise fitting of NURBS surfaces to large-size mesh representations
WO2022052582A1 (en) Image registration method and device, electronic apparatus, and storage medium
US10643372B2 (en) Method for reconstructing three-dimensional information of object and apparatus for the same
KR102516495B1 (en) Methods and apparatus for improved 3-d data reconstruction from stereo-temporal image sequences
CN111738265A (en) Semantic segmentation method, system, medium, and electronic device for RGB-D image
US20230081366A1 (en) System using image connectivity to reduce bundle size for bundle adjustment
US9563969B2 (en) Method of generating implicit terrain data by performing lossless compression and lossy compression and electronic apparatus for performing the method
CN117132737B (en) Three-dimensional building model construction method, system and equipment
JP2019120590A (en) Parallax value calculation device, parallax value calculation method and program
CN113781661B (en) Immersion scene-oriented multi-projection space layout evaluation method and system
CN110148086B (en) Depth filling method and device for sparse depth map and three-dimensional reconstruction method and device
Heimann et al. Joint Geometry and Attribute Upsampling of Point Clouds Using Frequency-Selective Models with Overlapped Support
CN117437288B (en) Photogrammetry method, device, equipment and storage medium
CN113191310B (en) Boundary recognition method, device and equipment for vector PDF drawing entity filling
CN112288791A (en) Disparity map obtaining method, and fish-eye camera-based three-dimensional model obtaining method and device
CN116976123A (en) Automatic correction method and device for river network elevation, computer equipment and medium
CN118067027A (en) Speckle binocular imaging method, device and equipment based on deep learning
CN116503479A (en) Method, device, equipment and medium for determining correlation image of sparse point cloud
CN117475100A (en) Three-dimensional modeling method and device for stratum

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: 20914183

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: 20914183

Country of ref document: EP

Kind code of ref document: A1