![]() So, in fact, if I apply it to my case, do you mean to do (using some random number for my colored 16 bits variables): What you're suggesting to do is the same as in Yes, i am already using 16 bits data type for red16, green16 and blue16, unsigned. ![]() In addition, I have little experience with working with > operators. To me converting like this the coloured image to 8 bits (total for all channels) means we have, at best 2 to 3 bits per channel. I am not confident at all with the data types i'm using, and if there's a better way than using qRgb given that i dispose of the 3 channels separately.īut in there, because the whole image is converted to 8 bits, it is unclear to me whether the answer was for monochrome 16 bits images or for coloured 16 x 3 bits images. Is that not the case? Is there a more proper/robust way to do it? Before incriminating how I do that, I am not even sure that I have done the above conversion properly. I have something displayed, but I see weird things when I do some intensity/contrast stretching. In the latter, I use Format_ARGB32 only because the documentation on qRgb says it gives out ARGB32 format. MyQImage = new QImage((uchar*)coloredImage, width, height, QImage::Format_ARGB32) Which I populated with each pixel colored value using qRgb like this:ĬoloredImage = qRgb(red8, green8, blue8) So far, I naively tried this to convert to 8 bits, without any stretching. So let's get the 8 bits converted values, called red8, green8, and blue8. I understand that Qt and QImages supports up to 8 bits per channels, Let's call those 3 variables: red16, green16, and blue16 (for each pixel). The minimum possible value is 0 and the maximum possible value 65535 (so, 16 bits per channel). So for each pixel I dispose of 3 different variables, the red, green and blue value. Here I simplified a bit as Raw images have 4 channels, with 2 different green channels, but I have some processing that gives me the 3 effective channels (with some average of the 2 green channel into a single green channel). With only 3 channels, R, G and B, we would end up with a 48 bits image. Let's consider for this example a case of 16 bits per channel. It is read in with some external library (Libraw, to be exact). I have raw images from DSLR cameras which I want do display, and, eventually, rescaled (intensity/contrast stretching). ![]() After dealing with gray scale images and QImage without much trouble, I am stepping into color images and I am confused by the various methods to convert images, into various image formats.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |