# weighted ICP

**URL:** https://discourse.vtk.org/t/weighted-icp/14878
**Category:** Support
**Tags:** python
**Created:** [November 14, 2024, 2:18pm UTC](https://discourse.vtk.org/t/weighted-icp/14878 "2024-11-14T14:18:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![maedeh\_kafiyan\_safar](https://discourse.vtk.org/user_avatar/discourse.vtk.org/maedeh_kafiyan_safar/32/9265_2.png) [@maedeh\_kafiyan\_safar](https://discourse.vtk.org/u/maedeh_kafiyan_safar)
#### Post date: [November 14, 2024, 2:18pm UTC](https://discourse.vtk.org/t/weighted-icp/14878/1 "2024-11-14T14:18:14Z")

</div>

Hello, everyone. I use the VTK ICP module to do point-to-surface registration. I want to give some points less weight in ICP as I need them to affect but less than other points. I searched a lot through the ICP module, and I couldn’t find how to do this. I use the python lib of VTK and want to know how I can do this weighting.

---

<div class="post-metadata">

### Author: ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)
#### Post date: [November 14, 2024, 3:26pm UTC](https://discourse.vtk.org/t/weighted-icp/14878/2 "2024-11-14T15:26:40Z")

</div>

ICP does distance comparison between points. You could introduce a scale factor (or scale array) for the distances that acts as an inverse weight i.e. a scale of 1 would maintain true distance but a scale \< 1 would increase the distance computed for that point. Of course, this is based on what I understand from your description and would require you to modify vtk code.

---

<div class="post-metadata">

### Author: ![maedeh\_kafiyan\_safar](https://discourse.vtk.org/user_avatar/discourse.vtk.org/maedeh_kafiyan_safar/32/9265_2.png) [@maedeh\_kafiyan\_safar](https://discourse.vtk.org/u/maedeh_kafiyan_safar)
#### Post date: [November 14, 2024, 4:30pm UTC](https://discourse.vtk.org/t/weighted-icp/14878/3 "2024-11-14T16:30:41Z")

</div>

It sounds logical but the problem is I don’t want to go through changing the C++ code of  
VTK. I want to see if I can handle it with Python or not.

---

<div class="post-metadata">

### Author: ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)
#### Post date: [November 15, 2024, 2:40am UTC](https://discourse.vtk.org/t/weighted-icp/14878/4 "2024-11-15T02:40:37Z")

</div>

I don’t think you can handle it directly in Python without modifying the underlying VTK logic. Depending on your requirement, Kitware can help with consulting service.
