krupkat / xpano

Automated photo stiching tool. Lets you import a directory of images and then export the autodetected panoramas.
https://krupkat.github.io/xpano/
GNU General Public License v3.0
276 stars 17 forks source link

Masking #70

Open krupkat opened 1 year ago

krupkat commented 1 year ago

Based on a comment by @hqhoang in https://github.com/krupkat/xpano/issues/18#issuecomment-1500779980

Experiment with masking

hqhoang commented 1 year ago

See if these sets can be used as samples/tests, they're my typical handheld with people moving around between shots. https://drive.google.com/drive/folders/1XaXGKxIWp7a9hBz5uZd3h4Vx5l2YA2ts

flightmansam commented 3 months ago

This is a really really good idea! I'd love to help where I can.

krupkat commented 3 months ago

Cool!

This depends a lot on your level of expertise, some opportunities I see with ascending difficulty :)

1) gather example images, something that would be useful for this feature, e.g. that was hard to stitch properly in other software. Various combinations, a simple 2 image stitch, 3 image, horizontal, vertical, multiple overlaps (e.g. 4 images in a square grid, where they all overlap in the center)

2) prepare a mock of the gui / some idea how it would work, we'll need to be able to draw some constraints over each image individually, to be able to specify which parts to include / exclude, then calculate the result

3) dive into the opencv implementation of the graph cut seam finder: https://github.com/opencv/opencv/blob/7ff531b8ab57df6a63a2524f3a911663a3eb5457/modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp#L240 https://github.com/opencv/opencv/blob/7ff531b8ab57df6a63a2524f3a911663a3eb5457/modules/stitching/src/seam_finders.cpp#L1108 https://github.com/opencv/opencv/blob/4.x/modules/imgproc/include/opencv2/imgproc/detail/gcgraph.hpp a fork of the code will be necessary with a way to supply the constraints from part 2) these constraints will be encoded in the graph . google the term "graphcut segmentation" for more details

flightmansam commented 3 months ago

Thanks Krupkat! I'll have a think on it and see what I get up to.