Skip to content

Commit 9a7c015

Browse files
CLI improvements (#163)
* ignore folders in wildcards * provide --version in cli
1 parent 50fbb42 commit 9a7c015

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

stitching/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .stitcher import AffineStitcher, Stitcher # noqa: F401
22

3-
__version__ = "0.5.1"
3+
__version__ = "0.5.2"

stitching/cli/stitch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import cv2 as cv
1111
import numpy as np
1212

13-
from stitching import AffineStitcher, Stitcher
13+
from stitching import AffineStitcher, Stitcher, __version__
1414
from stitching.blender import Blender
1515
from stitching.camera_adjuster import CameraAdjuster
1616
from stitching.camera_estimator import CameraEstimator
@@ -28,6 +28,7 @@
2828

2929
def create_parser():
3030
parser = argparse.ArgumentParser(prog="stitch.py")
31+
parser.add_argument("--version", action="version", version=__version__)
3132
parser.add_argument("images", nargs="+", help="Files to stitch", type=str)
3233
parser.add_argument(
3334
"-v",

stitching/images.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import glob
1+
import os
22
from abc import ABC, abstractmethod
33
from enum import Enum
4+
from glob import glob
45

56
import cv2 as cv
67
import numpy as np
@@ -131,7 +132,7 @@ def check_resolution(resolution):
131132
@staticmethod
132133
def resolve_wildcards(img_names):
133134
if len(img_names) == 1:
134-
img_names = glob.glob(img_names[0])
135+
img_names = [i for i in glob(img_names[0]) if not os.path.isdir(i)]
135136
return img_names
136137

137138
@staticmethod

0 commit comments

Comments
 (0)