Changing a histogram (creating a hole)
Hi there. This is a histogram of a grayscaled image I have:
I need it to be more like this:
And I wonder what's the best and efficient way to reach it. In general, I need n% (I guess n is between 0-20) of the image's area with the highest luminance to be brighter. Or (100-n)% to be darker. I tried chanigng each pixel's luminance one-by-one but it is highly ineffective.
Your question is not about opencv.
You should use a function f(grey_level) : f(grey_level) =grey_level for grey_level>128 and what you want for f(grey_level) other values
It seems that's not a linear operation you will need to write your own loop using forEach or paralllelbody