Convert a uint16 into values into RGB
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sarah DS
am 8 Jun. 2021
Beantwortet: Surabhi KS
am 10 Jun. 2021
Hello Matlab community!
I have a question regarding the transformation of an uint16 values captured by a arduino photoeletric sensor to RGB values. The image below is the photodiode spectral responsivity. Clear are the photodiodes without any spectral filters.
The cod below is provided by the manufacturer itself in order to transform the uint16 into rgb values, however it is a bit confused to me still on why they would assume the entire sum of the is equal to clear, is it perphaps as seen in the image below, all the channels are included within the clear channel itself? The manufacturer explained very briefly something about being adapted to "low RGB resolution" so it can be seem by screens, however it did not developed anymore.
The end result is in RGB I am just trying to comprehend the exact theory behind it
uint16_t sum = clear;
float r, g, b;
r = red;
r /= sum;
g = green;
g /= sum;
b = blue;
b /= sum;
r *= 256; g *= 256; b *= 256;
4 Kommentare
Sarah Sierra
am 8 Jun. 2021
You are right sir, if you don't mind, in that case is better to be deleted. Sorry for trouble
Akzeptierte Antwort
Surabhi KS
am 10 Jun. 2021
If you have an image I that is uint 16 you could try this to convert it to RGB:
I = mat2gray(I);
IRGB = cat(3, I, I, I);
imshow(IRGB)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Filtering and Enhancement finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!