Trying to translate formula for blending mode
I am using opencv c++ for making the blending mode like in photoshop , i want to make overlay mode in it , i search its alternate in opencv in which i found this blending way , but its not the overlay as i want to use the overlay method in it.
overlay method formula from this documentation
(Target > 0.5) * (1 - (1-2*(Target-0.5)) * (1-Blend)) +
(Target <= 0.5) * ((2*Target) * Blend)
Can any one please explain this formula for implementation in opencv c++ , how i can easy understand it for implementation or is there any already build in function for it or any other easy way out :P
that formula looks very expensive.
first break it down into simple multiply()[since it's per element] and add() calls.
you'd have to do it in float format, since e.g. (2*Target) would overflow the original uchar value.
What are actually
Target
?Target,Blend, 2 images.
try to write it on paper:
A = Target > 0.5
B = 1 - Blend
C = Target - 0.5
...