0
votes

I am new to Matlab. I need to read an image from a file and process it. (i.e. read pixel values, resize it using my own functions,...) Then I need to display it on the UI. How do I do this?

IMSHOW() takes the whole axis area assigned and do not get resize.

EDITED I get an image of 100X100px. I want the user to see the 100X100px. Then resize that image using my own function to 50X50px. I want to show the resized image on the same axis, but this time it should be seen half of the original size.

1
I'm sorry this doesn't make any sense. It sounds like you should display the whole image, but now you don't want to?rayryeng
mathworks.com/help/images/… Adjusting the initial magnification may help; Also try this - mathworks.com/help/images/ref/truesize.htmlYvon
Thank you both... It was helpful...user3946110

1 Answers

0
votes

If I understand correctly what you want to do, the following should work for you

I=imread('path/to/file');
Ir=I(1:2:end,1:2:end); //resize 50%

This will only work for 50% resizing. Resizing at an arbitrary scale will need some interpolation.

The following will display the resized image on the upper left corner of the same figure:

imshow(I);
hold on;
imshow(Ir);

If I have not understood your purpose correctly let me know in the comments