Giter Club home page Giter Club logo

Comments (6)

neka-nat avatar neka-nat commented on May 22, 2024 2

It's KdTree.

from scipy.spatial import KDTree
target_tree = KDTree(target, leafsize=10)
rmse = math_utils.compute_rmse(source, target_tree)

from probreg.

neka-nat avatar neka-nat commented on May 22, 2024

Hi @sandwich25 ,

Thank you for the question.
The RMSE function is math_utils.compute_rmse.

from probreg.

sandwich25 avatar sandwich25 commented on May 22, 2024

what does the target_tree represents?

from probreg.

sandwich25 avatar sandwich25 commented on May 22, 2024

Thanks!

from probreg.

SabraHashemi avatar SabraHashemi commented on May 22, 2024

hi i cant use rmse , it say expected 2 but got 0 m I want to get accuracy or a method to calculate similarity: this is my code:

import copy
import numpy as np
import open3d as o3d
import transforms3d as t3d
from numpy.linalg import norm
from probreg import cpd, filterreg

# load source and target point cloud
source = o3d.io.read_point_cloud("./C.ply")
target = o3d.io.read_point_cloud("./E_cut.ply")
# transform target point cloud
th = np.deg2rad(30.0)
target.transform(np.array([[np.cos(th), -np.sin(th), 0.0, 0.0],
                           [np.sin(th), np.cos(th), 0.0, 0.0],
                           [0.0, 0.0, 1.0, 0.0],
                           [0.0, 0.0, 0.0, 1.0]]))
source = source.voxel_down_sample(14)
target = target.voxel_down_sample(7)

threshold = 0.02
trans_init = np.asarray([[0.862, 0.011, -0.507, 0.5],
                         [-0.139, 0.967, -0.215, 0.7],
                         [0.487, 0.255, 0.835, -1.4], [0.0, 0.0, 0.0, 1.0]])





import time
# compute cpd registration
start_time = time.time()
tf_param, _, _ = cpd.registration_cpd(source, target)
result = copy.deepcopy(source)
result.points = tf_param.transform(result.points)
print("--- %s seconds ---" % (time.time() - start_time))



# draw result
source.paint_uniform_color([1, 0, 0])
target.paint_uniform_color([0, 1, 0])
result.paint_uniform_color([0, 0, 1])
#o3d.visualization.draw_geometries( [result,target])




#resultglobaltran = tf_param
#gfit=o3d.pipelines.registration.evaluate_registration(source,target,threshold,tf_param.rot)

#fitness=gfit.fitness
#rmse=gfit.inlier_rmse
#cdots=len(gfit.correspondence_set)

print("result: ", np.rad2deg(t3d.euler.mat2euler(tf_param.rot)),
      tf_param.scale, tf_param.t)

from scipy.spatial import KDTree
target_tree = KDTree(target, leafsize=10)
rmse = math_utils.compute_rmse(source, target_tree)

print("Error (m): ")
print(norm(np.rad2deg(t3d.euler.mat2euler(tf_param.rot) - tf_param.t)))


from probreg.

SabraHashemi avatar SabraHashemi commented on May 22, 2024

@neka-nat @jwindhager @sandwich25

from probreg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.