image magnification

Hello all, heres a qs thats troubling me
I've an scanning electron microscope (SEM) image A (at *8000 magnification) and another optical image B (of unknown magnification). It is known that a 12000 times SEM image needs to reduce 3.8 times to match the optical image. Thus, a 8000 times SEM image is to be reduce by 2.53 times.
May i know what is the matlab code for me to perform this magnification? Any help is greatly appreaciated. thanks!

 採用された回答

David Young
David Young 2011 年 10 月 5 日

1 投票

If you have the Image Processing Toolbox, you can use imresize to do this:
imnew = imresize(imold, scale);

1 件のコメント

shirley
shirley 2011 年 10 月 5 日
thanks alot!

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 10 月 5 日

0 投票

David is correct, but leaves open the question of which scale to use.
scale = 1 ./ max( size(A,1)./size(B,1), size(A,2)./size(B,2) );
This assumes that the scaled image must completely "fit into" the size of the optical image. If it is sufficient that one of the two dimensions match the size of the optical image, then use min() instead of max(). If matching a particular dimension is important, then you would use either
scale = size(B,1)./size(A,1);
or
scale = size(B,2)./size(A,2);

4 件のコメント

shirley
shirley 2011 年 10 月 5 日
oo i can only accept one answer... although i prefer your answer.
may i know for the first code. that does the 1 in size(A,1) and 2 in size(A,2) means? many thanks!
Walter Roberson
Walter Roberson 2011 年 10 月 5 日
The 1 or 2 refers to the dimension number. size(A,1) is the number of rows in A, size(A,2) is the number of columns in A.
shirley
shirley 2011 年 10 月 6 日
i see. thanks alot!! =)
David Young
David Young 2011 年 10 月 6 日
As you say, this answer assumes that the SEM and optical images have the same field of view, so can be mapped onto one another.
However, I'd thought, from the original question, that the scale was already known to be 2.53, or 1/2.53 depending on which image you resize, and that you'd then have to register and crop if you want the images to be the same size.
Shirley likes this answer though, so maybe my interpretation is wrong.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by