0

I'm porcessing a batch of 50 to 800 images in matlab. The progras read some .tif images and then ,after making some changes, outputs an .tif image using imwrite.

The problem is that i want the output image to have a some refence of the scale i'm using. something like a bar of n pixels thats says what is the equivalent in mm(like thos usually used in microscopic measurements), or a couple of axes showing the scale in mm would be even better.

i already know the equivalente of 1 pixel in mm, but i don't know how to showit in every image(keep in mind that there are a lot of images, so it has to be something automatic).

Thanks.

here is the code i'm using right now:

dird=['G:\Alexis\interf camara rapida\Project_2013.08.07_2\W_80_cilindro_4mm\00-50-C2-1D-7E-AB_AutoSave_003_001\00-50-C2-1D-7E-AB_AutoSave_003_001_FR0'];

dirfondo = [dird,'.tif']; % La imagen de fondo debe estar en el mismo lugar que las imagenes a restarselo

fondo = imread(dirfondo);

zonainter=imshow(fondo);

zona=round(ginput(2));


xmin=zona(1,1);

ymin=zona(1,2);
xmax=zona(2,1);
ymax=zona(2,2);



j=0;

for i =1:1:200;

mil=floor(i/1000);
cien=floor((i-mil*1000)/100);
diez=floor((i-mil*1000-cien*100)/10);
uno=(i-mil*1000-cien*100-diez*10); 
numero=[num2str(cien),num2str(diez),num2str(uno)];

i; % sin el punto y coma voy viendo por que número va.

j = j + 1 ; 

oldfileimage = [dird,numero,'.tif'];

 %     numerosalida = [num2str(i)]; 

newfileimage = ['im',numero,'.tif'];

inter = imread(oldfileimage); %Imagen cruda 

rango = 255;  %// choose the new maximum. (new minimum always at 0.0).



imgMin = double(min(min(inter(xmin:xmax,ymin:ymax))));
 imgMax = double(max(max(inter(xmin:xmax,ymin:ymax))));
 inter = ((inter - imgMin)*(rango/(imgMax - imgMin)));


imwrite(inter',newfileimage,'tif');
end;
imshow(inter);
4

1 回答 1

0

您可以使用linetext绘制自己的比例尺或尝试文件交换选项。

于 2013-08-29T19:43:58.697 回答