I am implementing an image processing filter in OTB (C ++ library).
I have weird behavior with some basic testing. When I read my image as "char", the following code always displays the pixel value (in the range 0-200), even if it is greater than 150. However, it works fine when I use the "short int". Is there a special behavior with "char" (for example, instead of comparing with a numerical value instead of comparing), or can there be any other reason?
Of course, my image pixels are stored in bytes, so I prefer to process "char" instead of "int" because the image is quite large (> 10 Gb).
if (pixelvalue > 150)
{
out = 255;
}
else
{
out = pixelvalue;
}