I have the $256$-bin histogram representing a distribution of the values taken by a certain descriptor element. This descriptor element takes the values in $0-255$ range, hence $256$ bins. I want to compress this descriptor by limiting the resolution of the values that it can take. In order to do that, I would like to select $3$ thresholds for the aforementioned histogram which would divide the histogram into $4$ parts. Ideally, I would like to be able to do that automatically, since the shape of the distribution will change depending on the type of data used. I was thinking about a way of measuring how good the selected thresholds are and I came up with following idea:
I would normalise the values in each of the $4$ histogram parts independently and calculate the entropy. This would basically describe the randomness of the values in this part.
I would sum all $4$ entropy values, assuming that the best set of thresholds is the one, for which this sum takes the lowest value.
I think such an approach has a chance to succeed, but unfortunately I don't know about a numerical method which would allow me to come up with the solution.
Any suggestions will be greatly appreciated. Also, if you think that there is a better method of assessing a quality of selected threshold, please share your thoughts.