-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix opencv crash #495
Fix opencv crash #495
Conversation
For the --fontcolor in keogram.cpp, would it be possible to allow both "#00ff00" format and "000 255 000" format (enclosed in quotes)? A lot of non-experienced users (and some experienced ones) find hex notation more difficult than a regular number. For example, what's half of "ff", versus half of 255? |
I though about that but decided against it in the interests of simplicity of parsing. There are lots of html color calculators online. |
@ckuethe I don't think making things easier for a programmer but harder for a user is the way to go. |
Rebased. |
Also mitigates #492 |
Add a new size flag, eg. `-s 1280x960` to ignore images not matching the specified size. Not sure where the improperly sized images are coming from (maybe truncated writes to disk?) but this allows me to just reject them and keep OpenCV from exploding.
What is it with my system, finding all of these broken images?! Anyway, somehow I've got a few monochrome images scattered through my directory of RGB, which of course makes OpenCV get its knickers in a knot. To mitigate this, I take the first image of appropriate dimension, and use its channel count as authoritative. Any images not matching that will be converted.
allow font color to be specified in opencv order as a string of 3 ints representing blue, green and red channels, eg. "255 128 64" as well as in the usual rgb hex format, eg. "c0ffee" or "#3333cc". and add a "-p"/"--parse-filename" flag to derive the image time from the filename rather than its time on disk (which may not be preserved across copies. Fixes #503
Just to clarify what's going in here, I found a few edge cases when reprocessing old images.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks sound!
This depends on the previous PR to add getopt. Now that I have getopt, it's easy to add extra flags to do useful things, like filtering improperly sized images to avoid opencv assertion failures.