Introduce Cropping to OpenCV Stitching Tool#21420
Merged
alalek merged 6 commits intoopencv:4.xfrom Feb 1, 2022
lukasalexanderweber:4.x
Merged
Introduce Cropping to OpenCV Stitching Tool#21420alalek merged 6 commits intoopencv:4.xfrom lukasalexanderweber:4.x
alalek merged 6 commits intoopencv:4.xfrom
lukasalexanderweber:4.x
Conversation
Contributor
Author
|
@alalek I don't exactly know where the whitespace error is |
alalek
reviewed
Jan 28, 2022
apps/opencv_stitching_tool/opencv_stitching/largest_interior_rectangle.py
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@alalek fixed it |
Merged
a-sajjad72
pushed a commit
to a-sajjad72/opencv
that referenced
this pull request
Mar 30, 2023
Introduce Cropping to OpenCV Stitching Tool * Introduced Cropping * integrate opencv#21413 * fixed failing subsetter tests * updated stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Stitching Pipeline can be extended by estimate cropping ROIs in low resolution:
Therefore, the warped low resolution images can be blended together to create a blend mask on which the largest interior rectangle (lir) can be found. At the moment the outline approach of the lir repository is used, which can detect the lir in 0.1s in a 1 MP image. The Algorithm used is Marzeh, Tahmasbi and Mireh (2019): Algorithm for finding the largest inscribed rectangle in polygon, optimized on the outline of a binary raster. On the long run, it might be worth to integrate the functionality natively in opencv. Using the lir (red), the cropping roi (blue) of a single image (green) can be determined and used for cropping both the small and the full resolution images.
Cropping the images on low resolution and before estimating the seam masks has mayor benefits:
With cropping the seam carving is much more natural:
I already updated the opencv_stitching_tutorial with a more detailed explaination of the cropping procedure.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.