kornia/kornia

[Feature]: [Enhancement] Support registration of images with different spatial sizes in ImageRegistrator

Closed

#3,593 创建于 2026年2月26日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)Python (8,677 star) (892 fork)batch import
help wantedtriage

描述

🚀 Feature Description

Currently, ImageRegistrator requires source and destination images to have identical shapes.

Inside get_single_level_loss, there is a TODO comment:

# ToDo: Make possible registration of images of different shape

### 📂 Feature Category

VLM/VLA Models (Vision Language Models/Agents) - Priority

### 💡 Motivation

# 💡 Motivation

```markdown
In practical applications, image registration often involves:

- Images captured at different resolutions
- Images that were cropped differently
- Multi-scale or pyramid-based processing across unequal spatial sizes

Supporting different spatial shapes would improve flexibility and usability of the module.

### 💭 Proposed Solution

Possible approaches could include:

1. Automatic resizing of one image to match the other before warping.
2. Padding the smaller image to match the larger one.
3. Warping both images into a shared reference frame.
4. Allowing shape mismatch and internally handling it at the pyramid level.

This could potentially be implemented within `get_single_level_loss` or at the pyramid construction stage.

### 🔄 Alternatives Considered

Users can manually resize images before passing them to `ImageRegistrator`. However, handling this internally would provide a cleaner and more user-friendly API.

### 🎯 Use Cases

- Registering satellite images of different resolutions
- Aligning medical images with different acquisition sizes
- Matching frames from multi-camera systems
- Feature-based alignment across cropped or scaled inputs

### 📝 Additional Context

The existing TODO comment suggests this functionality was previously considered. This proposal aims to align implementation with that intended direction.

Happy to work on a PR after maintainer feedback and assignment.

### 🤝 Contribution Intent

- [x] I plan to submit a PR to implement this feature
- [ ] I'm requesting this feature but not planning to implement it

贡献者指南