Is it possible to display an matrix with an Bitdepth of 16 Bit (Colormap)

Hello,

I would like to display an one channel Matrix with a bitdepth of more then 8 Bit because I have integers up to 3000.

I found out that with Colormap it is only possible with CV_8UC1. So it is only possible to display integers from 0 to 255.

https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html

Do I have to scale the bigger integers down do 255 because in opencv it is only possible to plot a matrix with different color for each value with colormap. Or is there a different method where I can display Integers with a bit depth of 16 Bit.

Thanks in advance.

Hi,
Unfortunately there is no such function. You have to manage yourself such palette

you would use convertTo to map your value range of 0…3000 to 0…255. set alpha = 255.0/3000.0 and rtype = CV_8U

then you could apply a color map to these values.

1 Like