im=imread('VIS_0109.bmp');
imR=double(im(:,:,1));
A=100.0; B=150.0;
imR1=(imR<A);
imR2=(imR>B);
imR3=(imR>=A & imR<=B);
imRn=imR.*imR1+imR.*imR2+255.0*imR3;
R=imR; G=imR; B=imR;
R(imR1)=255; G(imR1)=0; B(imR1)=0; out1=cat(3,R,G,B);
R(imR2)=0; G(imR2)=255; B(imR2)=0; out2=cat(3,R,G,B);
R(imR3)=0; G(imR3)=0; B(imR3)=255; out3=cat(3,R,G,B);
figure; imagesc(imR); colormap(gray); hold;
imagesc(uint8(out1));
imagesc(uint8(out2));
imagesc(uint8(out3));
