I have grayscale images which I want to quantize to different gray levels.
To be more precise, in the EBImage package, we have a function equalize()
which has an argument levels
. we can set levels
value to 256 or 128 or 64 etc to quantize our grayscale images. (But the equalize()
function will perform a histogram equalization of the given grayscale image, which is not preferred for my current situation)
Can somebody suggest a formula or a function which we can use to change the number of gray levels in the given grayscale image.