OpenStitching / stitching

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

Camera parameters adjusting failed. #178

Closed Tickets14 closed 7 months ago

Tickets14 commented 7 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 7 months ago

You need to use AffineStitcher

Tickets14 commented 7 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 7 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 7 months ago

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