Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#199)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0)
- [github.com/psf/black: 24.3.0 → 24.4.2](psf/black@24.3.0...24.4.2)
- [github.com/igorshubovych/markdownlint-cli: v0.39.0 → v0.41.0](igorshubovych/markdownlint-cli@v0.39.0...v0.41.0)

* fix markdown

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lukas <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and lukasalexanderweber authored Jun 1, 2024
1 parent cf74fdf commit 494a978
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
rev: v0.41.0
hooks:
- id: markdownlint
- repo: https://github.com/pycqa/flake8
Expand Down
4 changes: 2 additions & 2 deletions stitching/feature_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def detect_with_masks(self, imgs, masks):
raise StitchingError("image and mask lists must be of same length")
if not np.array_equal(img.shape[:2], mask.shape):
raise StitchingError(
f"Resolution of mask {idx+1} {mask.shape} does not match"
f" the resolution of image {idx+1} {img.shape[:2]}."
f"Resolution of mask {idx + 1} {mask.shape} does not match"
f" the resolution of image {idx + 1} {img.shape[:2]}."
)
features.append(self.detect_features(img, mask=mask))
return features
Expand Down
16 changes: 9 additions & 7 deletions stitching/verbose.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def verbose_stitching(stitcher, images, feature_masks=[], verbose_dir=None):
features = stitcher.find_features(imgs, feature_masks)
for idx, img_features in enumerate(features):
img_with_features = finder.draw_keypoints(imgs[idx], img_features)
write_verbose_result(_dir, f"01_features_img{idx+1}.jpg", img_with_features)
write_verbose_result(_dir, f"01_features_img{idx + 1}.jpg", img_with_features)

# Match Features
matcher = stitcher.matcher
Expand All @@ -42,7 +42,9 @@ def verbose_stitching(stitcher, images, feature_masks=[], verbose_dir=None):
)
)
for idx1, idx2, img in all_relevant_matches:
write_verbose_result(_dir, f"02_matches_img{idx1+1}_to_img{idx2+1}.jpg", img)
write_verbose_result(
_dir, f"02_matches_img{idx1 + 1}_to_img{idx2 + 1}.jpg", img
)

# Subset
subsetter = stitcher.subsetter
Expand Down Expand Up @@ -90,7 +92,7 @@ def verbose_stitching(stitcher, images, feature_masks=[], verbose_dir=None):
final_corners, final_sizes = warper.warp_rois(final_sizes, cameras, camera_aspect)

for idx, warped_img in enumerate(final_imgs):
write_verbose_result(_dir, f"04_warped_img{idx+1}.jpg", warped_img)
write_verbose_result(_dir, f"04_warped_img{idx + 1}.jpg", warped_img)

# Excursion: Timelapser
timelapser = Timelapser("as_is")
Expand All @@ -99,7 +101,7 @@ def verbose_stitching(stitcher, images, feature_masks=[], verbose_dir=None):
for idx, (img, corner) in enumerate(zip(final_imgs, final_corners)):
timelapser.process_frame(img, corner)
frame = timelapser.get_frame()
write_verbose_result(_dir, f"05_timelapse_img{idx+1}.jpg", frame)
write_verbose_result(_dir, f"05_timelapse_img{idx + 1}.jpg", frame)

# Crop
cropper = stitcher.cropper
Expand Down Expand Up @@ -135,7 +137,7 @@ def verbose_stitching(stitcher, images, feature_masks=[], verbose_dir=None):
for idx, (img, corner) in enumerate(zip(final_imgs, final_corners)):
timelapser.process_frame(img, corner)
frame = timelapser.get_frame()
write_verbose_result(_dir, f"07_timelapse_cropped_img{idx+1}.jpg", frame)
write_verbose_result(_dir, f"07_timelapse_cropped_img{idx + 1}.jpg", frame)

# Seam Masks
seam_finder = stitcher.seam_finder
Expand All @@ -151,7 +153,7 @@ def verbose_stitching(stitcher, images, feature_masks=[], verbose_dir=None):
]

for idx, seam_mask in enumerate(seam_masks_plots):
write_verbose_result(_dir, f"08_seam_mask{idx+1}.jpg", seam_mask)
write_verbose_result(_dir, f"08_seam_mask{idx + 1}.jpg", seam_mask)

# Exposure Error Compensation
compensator = stitcher.compensator
Expand All @@ -166,7 +168,7 @@ def verbose_stitching(stitcher, images, feature_masks=[], verbose_dir=None):
]

for idx, compensated_img in enumerate(compensated_imgs):
write_verbose_result(_dir, f"08_compensated{idx+1}.jpg", compensated_img)
write_verbose_result(_dir, f"08_compensated{idx + 1}.jpg", compensated_img)

# Blending
blender = stitcher.blender
Expand Down

0 comments on commit 494a978

Please sign in to comment.