actual size of axes GUI change after uploading IMAGE ASPECT RATIO CHANGE

1 次查看(过去 30 天)
IMAGE ASPECT RATIO CHANGE IMAGE SIZE 1024*768 BUT AFTER UPLOAD SIZE CHANGE ON AXES GUI I HAVE ENCLOSED ERROR SCREEN SHOT.
[image_file_name,image_file_path ] = uigetfile({'*.jpg';'*.avi'},'Please select Frozen Image or Video'); %;*.png;*.yuv;*.bmp;*.tif'},'Pick a file');
handles.image_file_name = image_file_name;
handles.image_file_path = image_file_path;
[pathstr,name,ext] = fileparts(image_file_name)
if(strcmp(ext,'.jpg')||strcmp(ext,'.png'))
if(isequal(image_file_path,0))
msgbox('Please select file');
return;
end
input_image_file = [image_file_path,image_file_name];
handles.temp_image_file = input_image_file;
handles.input_image_file =input_image_file;
% Acquiring Image
img = imread(input_image_file);
[width,height] = size(rgb2gray(img));
handles.img = img;
axes(handles.axes2);
imshow(img);
drawnow;

回答(1 个)

Walter Roberson
Walter Roberson 2017-9-21
imshow() tends to resize axes in order to match the image aspect ratio.
If you have an axes whose aspect ratio does not happen to match the image, and you want to force the image to fill the entire axes, then you can do that -- but the result will not have square pixels.
  1 个评论
praveen chandaliya
praveen chandaliya 2017-9-21
can you more detail way explain. suppose initial axes size 400*300 after before uploading image (size of image 600*400) after upload image size convert into (300*250 ). i am getting actual axes size . in scree shot you see that the size of axes in white. after upload size go 20 to 30 % reduce .

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by