Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
praveen chandaliya
praveen chandaliya le 21 Sep 2017
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;
  2 commentaires
Walter Roberson
Walter Roberson le 21 Sep 2017
Please post some code so we can see your calls.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 21 Sep 2017
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 commentaire
praveen chandaliya
praveen chandaliya le 21 Sep 2017
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 .

Connectez-vous pour commenter.

Catégories

En savoir plus sur Printing and Saving dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by