Dear Carmen Z,
Thank you for your reply.
I want to do pseudo color processing on gray images. Color model refers to the jet color model in MATLAB. This is the function of jet color model in MATLAB.
%function J = jet(m)
% if nargin < 1
% m = size(get(gcf,'colormap'),1);
% end
% n = ceil(m/4);
% u = [(1:n)/n ones(1,n-1) (n:-1:1)/n]';
% g = ceil(n/2) - (mod(m,4)==1) + (1:length(u))';
% r = g + n;
% b = g - n;
% g(g>m) = [];
% r(r>m) = [];
% b(b<1) = [];
% J = zeros(m,3);
% J(r,1) = u(1:length(r));
% J(g,2) = u(1:length(g));
% J(b,3) = u(end-length(b)+1:end);
pasted-from-clipboard.png
Because I don't know much about the jet function in MATLAB, and I'm not sure if I can simulate the jet function in the visual applet, I also plan to use a simple function conversion for pseudo color processing.
Input a gray image, for each pixel I (I, J), judge the pixel whose gray value is less than 64, transform according to r = 0, g = 4 * I (I, J), B = 255; for the pixel whose gray value is greater than 63 and less than 128, transform according to r = 0, g = 255, B = 255-4 * [I (I, J) - 128]; for the pixel whose gray value is greater than 127 and less than 192, transform according to r = 4 * [I (I, J) - 128], G= 255, B = 0 for transformation; for pixels with gray value greater than 191, according to r = 255, g = 255-4 * [I (I, J) - 192], B = 0 for transformation.
I tried to write a pseudo color VA file (as shown in the attachment), but it didn't work very well. I would appreciate it if you could help me to point out the problem.
I hope you can help me solve this problem. thank you very much. And I'm really sorry for the trouble caused by the language problem.
Best wishes
Danna