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

本文介绍了快速欧式聚类(FEC)的概念,它针对传统欧式聚类的效率问题进行了优化,尤其适用于点云分割。引用了Cao等人2022年的论文,探讨了FEC如何提升聚类速度。
摘要由CSDN通过智能技术生成


前言

欧式聚类因重复计算导致效率较低,快速欧式聚类有效提高效率。
参考论文: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
  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值