actual size of axes GUI change after uploading IMAGE ASPECT RATIO CHANGE
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
praveen chandaliya
el 21 de Sept. de 2017
Comentada: praveen chandaliya
el 21 de Sept. de 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 comentarios
Respuestas (1)
Walter Roberson
el 21 de Sept. de 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.
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!