-
-
Notifications
You must be signed in to change notification settings - Fork 888
New overloads for binary threshold operations. The new argument Color… #1555
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
New overloads for binary threshold operations. The new argument Color… #1555
Conversation
…Component defines the scalar color component to be used for threshold comparison: Luminance, Saturation or MaxChroma. Luminance is default and identical to previous versions. Saturation is the HSL saturation component. MaxChroma is calculated as the maximum of YCbCr chroma value, i.e. Cb and Cr distance from achromatic value. Background: This component shall discriminate colorful parts from achromatic parts in human perception. Very dark pixels, which are perceived as near black, can have high HSL saturation values if e.g. (rgb)==(4,0,0); this would definitely not be perceived as colorful by a human. The MaxChroma component will calculate them low.
Codecov Report
@@ Coverage Diff @@
## master #1555 +/- ##
==========================================
+ Coverage 83.57% 83.59% +0.01%
==========================================
Files 742 742
Lines 32829 32877 +48
Branches 3668 3674 +6
==========================================
+ Hits 27437 27483 +46
- Misses 4678 4680 +2
Partials 714 714
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Thanks for redoing this @Franz1960 and sorry about the runaround. The Git docs tend to describe situations that should be prefaced with "In a vacuum...". |
| } | ||
| else if (this.colorComponent == BinaryThresholdColorComponent.MaxChroma) | ||
| { | ||
| float fThreshold = this.threshold / 2F; |
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.
Hey @Franz1960 Can you explain this bit to me please? I'm struggling to figure out why we're halving the threshold.
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.
The achromatic level is in the center of the Cb and Cr range, so the distance is half the range.
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.
Thanks... Makes sense.
One last thing. Can you please give me push permissions to your fork? I just did some optimization work on the process but do not have permissions to push for some reason (Normally I do with others).
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.
|
@Franz1960 Thanks for your patience here. Still trying to figure out LFS as I had to manually add your new files to it. I made some changes to optimize the methods which should keep them snappy also if you're curious but I'm going to merge this now. It's awesome to have a new community feature! |
|
@JimBobSquarePants Thanks too for your patience, and @antonfirsov equally. I had to learn many things. Next time will hopefully go better. Replacing submodules by LFS was for sure the right thing to do. |
|
@Franz1960 thanks for the great work and also the patience towards our processes (with the submodules they were way more complicated than they should be)! One last thing: can you add your opinion on #1556? I'd like to rename the enum today. |

…Component defines the scalar color component to be used for threshold comparison: Luminance, Saturation or MaxChroma. Luminance is default and identical to previous versions. Saturation is the HSL saturation component. MaxChroma is calculated as the maximum of YCbCr chroma value, i.e. Cb and Cr distance from achromatic value. Background: This component shall discriminate colorful parts from achromatic parts in human perception. Very dark pixels, which are perceived as near black, can have high HSL saturation values if e.g. (rgb)==(4,0,0); this would definitely not be perceived as colorful by a human. The MaxChroma component will calculate them low.
Prerequisites
Description