Changing a histogram (creating a hole)

asked 2018-12-11 13:15:37 -0600

Filippo9669 gravatar image

updated 2018-12-11 13:16:27 -0600

Hi there. This is a histogram of a grayscaled image I have:

image description

I need it to be more like this:

image description

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.

edit retag flag offensive close merge delete

Comments

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

LBerger gravatar imageLBerger ( 2018-12-12 01:30:17 -0600 )edit