OpenStitching / stitching

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

modifying colored_img_generator to loop over known colors. #100

Closed KaceCM closed 1 year ago

KaceCM commented 1 year ago

Before this correction, the function raised "ValueError("Not enough default colors! Pass additional " 'colors to "colors" parameter')", but we couldn't pass additional colors.

To avoid this problem and to make it easier, the correction takes the 9 known colors (Blue, Red, Green, Yellow, Magenta, Pink, Gray, Brown, Orange), and loop over them if needed.

lukasalexanderweber commented 1 year ago

Thanks! Can we keep the error message anyway?

lukasalexanderweber commented 1 year ago

Or what exactly is idx%len(colors) doing? Just repeating the first color after the last one is reached?

KaceCM commented 1 year ago

Yes of course we can keep the message, I'm going to add a couple of lines to make it even better.

idx%len(colors) means that, for a given tuple "colors", if the number of images is longer than this tuple length, it will repeat from the first color. I had a problem using 20 images, so I did this correction and thought it would be useful for people !

By the way, thank you for this insane package !

KaceCM commented 1 year ago

I have added a warning message, with instructions for those who wish to add their own colours. Otherwise, it loops the default colors.

Let me know if anything is missing, or if you need anything else !

KaceCM commented 1 year ago

I have now corrected all your requests, tell me if everything is correct now !

lukasalexanderweber commented 1 year ago

Thanks a lot! :)