OpenStitching / stitching

A Python package for fast and robust Image Stitching
Apache License 2.0
2.11k stars 162 forks source link

Camera parameters adjusting failed. #178

Closed Tickets14 closed 11 months ago

Tickets14 commented 11 months ago

How do you fix this error?

from stitching import Stitcher
import cv2

stitcher = Stitcher(detector="sift", confidence_threshold=0.2)
panorama = stitcher.stitch([cv2.imread("receipt\mercadona_1.jpg"), cv2.imread("receipt\mercadona_2.jpg")])

cv2.imwrite("panorama.jpg", panorama)

Error: raise StitchingError("Camera parameters adjusting failed.") stitching.stitching_error.StitchingError: Camera parameters adjusting failed.

here the image i used: mercadona_1 mercadona_2

lukasalexanderweber commented 11 months ago

You need to use AffineStitcher

Tickets14 commented 11 months ago

I tried to use AffineStitcher but i got an error:

    raise StitchingError(
stitching.stitching_error.StitchingError: No match exceeds the given confidence threshold.
                                 Do your images have enough overlap and common
                                 features? If yes, you might want to lower the
                                 'confidence_threshold' or try another
                                 'detector'.
HDareYR commented 11 months ago

The code seems cant been able to find enough matches 。try another two images or modify some parameters about matches finding maybe。 by the why ,could you tell me how to learn more about the lib of Stitching? waiting for your reply.thanks

lukasalexanderweber commented 11 months ago

the best thing you could do is to use the verbose mode (-v) to see where the problems are