From 73bd81017549ff71fa24371d36f1372a0bb764ac Mon Sep 17 00:00:00 2001 From: Lukas Weber <32765578+lukasalexanderweber@users.noreply.github.com> Date: Tue, 3 Jan 2023 22:34:00 +0100 Subject: [PATCH] add GraphCutSeamFinder (#43) * add GraphCutSeamFinder * bump version --- README.md | 2 +- stitching/__init__.py | 2 +- stitching/seam_finder.py | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3e53996..e245c77 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ panorama = stitcher.stitch(["img1.jpg", "img2.jpg", "img3.jpg"]) Specify your custom settings as ```python -settings = {"detector": "sift", "confidence_threshold": 0.2} +settings = {"detector": "sift", "confidence_threshold": 0.2} stitcher = Stitcher(**settings) ``` diff --git a/stitching/__init__.py b/stitching/__init__.py index 0b65627..924986b 100644 --- a/stitching/__init__.py +++ b/stitching/__init__.py @@ -1,3 +1,3 @@ from .stitcher import AffineStitcher, Stitcher # noqa: F401 -__version__ = "0.3.0" +__version__ = "0.4.0" diff --git a/stitching/seam_finder.py b/stitching/seam_finder.py index 50929c1..152c101 100644 --- a/stitching/seam_finder.py +++ b/stitching/seam_finder.py @@ -12,12 +12,16 @@ class SeamFinder: SEAM_FINDER_CHOICES = OrderedDict() SEAM_FINDER_CHOICES["dp_color"] = cv.detail_DpSeamFinder("COLOR") SEAM_FINDER_CHOICES["dp_colorgrad"] = cv.detail_DpSeamFinder("COLOR_GRAD") + SEAM_FINDER_CHOICES["gc_color"] = cv.detail_GraphCutSeamFinder("COST_COLOR") + SEAM_FINDER_CHOICES["gc_colorgrad"] = cv.detail_GraphCutSeamFinder( + "COST_COLOR_GRAD" + ) SEAM_FINDER_CHOICES["voronoi"] = cv.detail.SeamFinder_createDefault( cv.detail.SeamFinder_VORONOI_SEAM - ) # noqa + ) SEAM_FINDER_CHOICES["no"] = cv.detail.SeamFinder_createDefault( cv.detail.SeamFinder_NO - ) # noqa + ) DEFAULT_SEAM_FINDER = list(SEAM_FINDER_CHOICES.keys())[0]