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

Rik
Rik 2021년 6월 8일
I don't recognize this language. Shouldn't you ask this question on a forum about either this device, or this language?
Sarah DS
Sarah DS 2021년 6월 8일
I have but no one is capable of provding an answer. This is C++.
Rik
Rik 2021년 6월 8일
If your question is not directly related to Matlab, why did you post it here?
What kind of data goes into this function? What kind of output is expected? Have a read here. It will greatly improve your chances of getting an answer.
Sarah Sierra
Sarah Sierra 2021년 6월 8일
You are right sir, if you don't mind, in that case is better to be deleted. Sorry for trouble

댓글을 달려면 로그인하십시오.

 채택된 답변

Surabhi KS
Surabhi KS 2021년 6월 10일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2021년 6월 8일

답변:

2021년 6월 10일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by