The logarithmic function is I' =C*ln (I+1) (for each band), where I is the original value (0~255), I' is the quantized value, and C is a constant to scale I' into (0~255), and ln is the natural logarithm.
I tried this so far:
C1 = double(C1);
C = 0;
I = (C*log(1+C1));
image(I);
figure;
And the result is a black image.
You have set
C=0
then multiplied byC
. Instead, computeC
by considering the maximum value the resulting image and making sure it scales to1
.