# Registering a Projective Transformed Image

**URL:** https://discourse.itk.org/t/registering-a-projective-transformed-image/4695
**Category:** Beginner Questions
**Tags:** registration, simpleitk
**Created:** [December 23, 2021, 1:47pm UTC](https://discourse.itk.org/t/registering-a-projective-transformed-image/4695 "2021-12-23T13:47:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![WhaSukGo](https://discourse.itk.org/user_avatar/discourse.itk.org/whasukgo/32/2459_2.png) [@WhaSukGo](https://discourse.itk.org/u/WhaSukGo)
#### Post date: [December 23, 2021, 1:47pm UTC](https://discourse.itk.org/t/registering-a-projective-transformed-image/4695/1 "2021-12-23T13:47:43Z")

</div>

I’m trying to register a frame from camera to a template.

The most naive approach would be a feature based approach, finding a homography.

Unfortunately, for my case, images don’t have adequate features to use as feature (they consist of vertical and horizontal lines. Ex, tennis court). I tried all the features available in [OpenCV](https://docs.opencv.org/3.4/db/d27/tutorial_py_table_of_contents_feature2d.html).

Then I come across a registration using [Downhill simplex optimization](https://github.com/biomedia-mira/drop2) and find it promising.

One drawback is that it is limited to registering [affine transformed images](https://github.com/biomedia-mira/drop2/issues/10), not projective ones.

Is there any registration algorithm to tackle projective transformed images in SimpleITK?

* * *

Template:

 ![Template](https://discourse.itk.org/uploads/default/original/2X/f/faf1718e5aac2ed3e5dec5fc2d16918e33644e98.png)

Frame:

 ![Frame](https://discourse.itk.org/uploads/default/original/2X/7/70299bbd3ac4352cd366db223ffe83798db40940.jpeg)

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [December 23, 2021, 2:08pm UTC](https://discourse.itk.org/t/registering-a-projective-transformed-image/4695/2 "2021-12-23T14:08:25Z")

</div>

The closest transform ITK has to perspective is [Rigid3DPerspectiveTransform](https://itk.org/Doxygen/html/classitk_1_1Rigid3DPerspectiveTransform.html), which does not do exactly what you want. While deformable [transforms](https://itk.org/Doxygen318/html/group__Transforms.html) should be able to accomplish your task, they have many degrees of freedom (dozens, hundreds, or thousands) making them suboptimal. You could try [BSplineTransform](https://itk.org/Doxygen/html/classitk_1_1BSplineTransform.html), it might be enough. Easy way to experiment is by using [Slicer](https://www.slicer.org/) as it contains BRAINS (more classic ITK registration) and elastix (via an extension).

Alternatively, you could add `PerspectiveTransform` to ITK and then use that. You could start from [AffineTransform](https://itk.org/Doxygen/html/classitk_1_1AffineTransform.html).
