Hello,
I would like to write a piece of code which takes the RGB values from a picture and change them in temperature.
I have a calibration file which has for each RGB a temperature. I wanted to use the interp3 to start from the calibration file and go to the new picture.
THe function interp3 gives me an error when I use it, since it says that V (in my case temperature) should be a 3D matrix.
PLease, would you mind helping me or addressing in a different direction.
Thank you very much
Antonio
I attacch my piece of code
%calRGB.txt contains 4 columns: R,G,B,temperature (calibration file)
load calRGB.txt%RGB_f.dat contains 5 columns, x, y, R, G, B of the picture (2d picture)
load RGB_f.datRGB=RGB_f;x=RGB(:,1);y=RGB(:,2);v=RGB(:,3);w=RGB(:,4);z=RGB(:,5);%initialize temp
temp=x;temp(:)=0;%interpolation
for ii = 1:length(x(:,1))temp(ii)=interp3(calRGB(:,1), calRGB(:,2),calRGB(:,3),calRGB(:,4), v(ii),w(ii),z(ii));end%write the temperature for each point on a variable
output=RGB_f;output(:,:,:)=0;for ii = 1:length(x(:,1)) output(ii,:)=[x(ii), y(ii) ,temp(ii)];end
Best Answer