0

I have read this part of the CImg documentation:

However, it is not clear how to set this normalization levels (it is not a display() function parameter).

Can anybody tell me how to use them? Thank you!

Javi
  • 3,440
  • 5
  • 29
  • 43

1 Answers1

1

Two methods :

  • The clean one : you specify the normalization parameter at the construction of the CImgDisplay instance, like :

    CImgDisplay disp(img,"Title",normalization_type);

or CImgDisplay disp(640,480,"Title",normalization_type);

  • The dirty one : you can also change the normalization type of an existing display directly by setting it like this :

    disp._normalization = normalization_type;

bvalabas
  • 301
  • 1
  • 1
  • But I am using a CImg class, something like this: CImg img (256,256, 1,3,0) /*...*/ img.display("Title"); Should I change and create a CImgDisplay? – Javi Feb 25 '14 at 08:17
  • 1
    Ha. In this case, the `normalization` parameter used by the underlying CImgDisplay depends on the pixel type your displayed image has. Basically, the normalization will be done for `CImg`and `CImg`, whereas no normalization will occur for usual integer types. To force the normalization, I would suggest to first create a display `CImgDisplay disp(img,"Title",normalization);`then use it like this `img.display(disp,true);` – bvalabas Mar 01 '14 at 09:12