chaiNNer-org / chaiNNer

A node-based image processing GUI aimed at making chaining image processing tasks easy and customizable. Born as an AI upscaling application, chaiNNer has grown into an extremely flexible and powerful programmatic image processing application.
https://chaiNNer.app
GNU General Public License v3.0
4.44k stars 278 forks source link

Homography-based image alignment #2791

Open Splendide-Imaginarius opened 4 months ago

Splendide-Imaginarius commented 4 months ago

Continuing from @pifroggi's comment at https://github.com/chaiNNer-org/chaiNNer/pull/2714#discussion_r1562065046

My thinking with mentioning Rife in the name was in case in the future different kinds of alignment methods are added. For example it may make sense to add a traditional affine alignment method at some point, which would be better with images that are off by a lot, which could then be refined by this method. But maybe it makes more sense to think about that if it happens. What do you think?

I have an implementation of OpenCV-based image alignment (based on a homography matrix) here: https://github.com/Splendide-Imaginarius/subimage-stitcher

It works pretty well; would there be interest in a PR that adds a chaiNNer node with that implementation (subject to whatever code quality cleanup is needed to meet chaiNNer standards)? As @pifroggi observed, it might complement the RIFE implementation.

joeyballentine commented 4 months ago

Yes, that would be nice if you wouldn't mind. I still would like it to not be a separate node but rather have a "rife" and a "homography" mode on the one node.

Splendide-Imaginarius commented 4 months ago

Yes, that would be nice if you wouldn't mind. I still would like it to not be a separate node but rather have a "rife" and a "homography" mode on the one node.

@joeyballentine I see why that's desirable in the general case, but isn't there some precedent in chaiNNer for using separate nodes for PyTorch-based stuff versus non-NN stuff (I guess so that dependency checking works properly)?

joeyballentine commented 4 months ago

Oooooh, right. Yes, leave it separate then. My bad