# Possible use ThinPlateSplineTransformer with 3D points?

**URL:** <https://forum.opencv.org/t/possible-use-thinplatesplinetransformer-with-3d-points/11425>\
**Category:** Python\
**Tags:** thinplatespline\
**Created:** [December 26, 2022, 3:12pm UTC](https://forum.opencv.org/t/possible-use-thinplatesplinetransformer-with-3d-points/11425 "2022-12-26T15:12:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oren](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/oren/32/6836_2.png) [@oren](https://forum.opencv.org/u/oren)\
**Post date:** [December 26, 2022, 3:12pm UTC](https://forum.opencv.org/t/possible-use-thinplatesplinetransformer-with-3d-points/11425/1 "2022-12-26T15:12:11Z")

</div>

Wanted to verify that `cv2.createThinPlateSplineShapeTransformer` does not work with 3D points correct?  
Is there a way (or a different function) to extend it to 3D points?

e.g. `tshape` and `sshape` need to be 2Dxnumber\_points

```python
tps = cv2.createThinPlateSplineShapeTransformer()
...
tps.estimateTransformation (tshape, sshape, matches)

```

Thanks

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [December 27, 2022, 10:15am UTC](https://forum.opencv.org/t/possible-use-thinplatesplinetransformer-with-3d-points/11425/2 "2022-12-27T10:15:10Z")

</div>

> [@oren](#):
>
> `cv2.createThinPlateSplineShapeTransformer` does not work with 3D points

yes, that’s correct  
(it is part of a 2d shape matching algorithm, and probably not meant to be used “standalone”)

just curious, – which problem are you trying to solve here ?

---

<div class="post-metadata">

**Author:** ![oren](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/oren/32/6836_2.png) [@oren](https://forum.opencv.org/u/oren)\
**Post date:** [January 6, 2023, 4:03pm UTC](https://forum.opencv.org/t/possible-use-thinplatesplinetransformer-with-3d-points/11425/3 "2023-01-06T16:03:27Z")

</div>

BTW,  
Here is an example with simpleITK:

> **[3D registration by landmarks (script/python) tps?](https://forum.image.sc/t/3d-registration-by-landmarks-script-python-tps/75294/5)**
>
> Hi @bogovicj , @oren , Here is a draft Python example for applying a thin plate spline transform: Your review is appreciated! 🙏 This could be modified to use a different kernel transformation model: This is also the option to use a b spline...

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [January 6, 2023, 5:16pm UTC](https://forum.opencv.org/t/possible-use-thinplatesplinetransformer-with-3d-points/11425/4 "2023-01-06T17:16:39Z")

</div>

btw,

there’s also a (not so simple, and well hidden) 3d tps here:

> <https://github.com/opencv/opencv/blob/9208dcb07c015e1fda44e40bb07b43c700b4bf46/samples/dnn/virtual_try_on.py#L134>

---

<div class="post-metadata">

**Author:** ![oren](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/oren/32/6836_2.png) [@oren](https://forum.opencv.org/u/oren)\
**Post date:** [January 6, 2023, 7:17pm UTC](https://forum.opencv.org/t/possible-use-thinplatesplinetransformer-with-3d-points/11425/5 "2023-01-06T19:17:15Z")

</div>

> just curious, – which problem are you trying to solve here ?

Sorry I missed that, I need to register one stack to another stacks, I use Deep Learning to get landmarks.
