当前位置: 代码网 > it编程>编程语言>Java > python实现快速欧式聚类FEC:fast-euclidean-clustering

python实现快速欧式聚类FEC:fast-euclidean-clustering

2024年08月01日 Java 我要评论
欧式聚类因重复计算导致效率较低,快速欧式聚类FEC有效提高效率。


前言

欧式聚类因重复计算导致效率较低,快速欧式聚类有效提高效率。
参考论文:cao y, wang y, xue y, et al. fec: fast euclidean clustering for point cloud segmentation[j]. drones, 2022, 6(11): 325.


快速欧式聚类

import time
import numpy
import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.simplefilter(action='ignore', category=futurewarning)


class pointindex_numbertag(object):
    def __init__(self):
        self.npointindex = 0.0
        self.nnumbertag = 0.0

    class struct(object):
        def __init__(self, npointindex, nnumbertag):
            self.npointindex = npointindex
            self.nnumbertag = nnumbertag

def main():
    # 通过pcl.load加载pcd文件
    min_component_size = 100
    tolorance = 0.5
    max_n = 50

    start = time.perf_counter()
    cloud = o3d.io.read_point_cloud("../data/street.ply")
    cloud_tree = o3d.geometry.kdtreeflann(cloud)
    point = numpy.asarray(cloud.points)
    size = len(point)
    marked_indices = [0] * size

    if size < min_component_size:
        raise("could not find any cluster")
    else
(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com