Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

InsightSoftwareConsortium/ITKFPFH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migrated to ITK main

The FPFH module has been ingested into the Insight Toolkit (ITK) main repository and is no longer maintained here.

Future development, bug fixes, and pull requests should target ITK main. This repository's history is preserved for git blame and archival reference.

Maintainer action: this repository is Archived (read-only). See the ITK ingestion strategy for context.


ITKFPFH

Overview

Module to calculate FPFH feature for a pointset. Sample Usage is shown below:

# normal_pointset is ITK Pointset which contains normal vector for each point
# pointset is ITK Pointset which contains the input points for which feature needs to be calculated

# normal_np is numpy array of shape [Nx3]
# fpfh_feature is numpy array of shape [33xN]
# 25 is the radius and 100 is the maximum number of neighbors

pointset = itk.PointSet[itk.F, 3].New()
normal_pointset = itk.PointSet[itk.F, 3].New()

normal_pointset.SetPoints(itk.vector_container_from_array(normal_np.flatten()))
fpfh = itk.Fpfh.PointFeature.MF3MF3.New()
fpfh.ComputeFPFHFeature(pointset, normal_pointset, 25, 100)
fpfh_feature = fpfh.GetFpfhFeature()
fpfh_feature = itk.array_from_vector_container(fpfh_feature)
fpfh_feature = np.reshape(fpfh_feature, [33, pointset.GetNumberOfPoints()])

One can obtain the normals using the following code:

def getnormals_pca(inputPoints):
    import vtk
    from vtk.util import numpy_support
    meshPoints = numpy_to_vtk_polydata(inputPoints)
    normals = vtk.vtkPCANormalEstimation()
    normals.SetSampleSize(30)
    normals.SetFlipNormals(True)
    #normals.SetNormalOrientationToPoint()
    normals.SetNormalOrientationToGraphTraversal()
    normals.SetInputData(meshPoints)
    normals.Update()
    as_numpy = numpy_support.vtk_to_numpy(normals.GetOutput().GetPointData().GetArray(0))
    return as_numpy

Packages

 
 
 

Contributors