Image resize in GUIDE GUI

5 次查看(过去 30 天)
I've been using a gui to analyze some images that get loaded into the gui axes. All of the images are photographs taken from the same digital camera with the same specifications. The image resolution is larger than the resolution of the axes and so the images get auto-resized. This is fine except for one image that gets resized with an aspect ratio that is way, way off from the image resolution.
Is there an easy way to specify the image aspect ratio just once that doesn't depend on how often the image gets loaded or which image it actual is?
thanks
  1 个评论
curoi
curoi 2015-2-3
load( strcat( presavepath, '\', figname, '_Time_Coord.mat' ) );
load( strcat( presavepath, '\', figname, '_HiLoMisc_pts.mat' ) );
load( strcat( presavepath, '\', figname, '_Trimmed_File.mat' ) );
cla;
AA_trimmed = AA;
for i = 1:length(x_i);
% Toggle the color?
AA_trimmed( y_i(i) + swath_size + 1:end, i, 1 ) = 256;
AA_trimmed( 1:y_i(i) - swath_size, i, 1 ) = 256;
end
imshow( AA_trimmed, 'Parent', aa )
hold on;
plot( aa, j_R, k_R, colorspec{ tog }, 'MarkerSize', 16, ...
'LineWidth', 2 );
plot( aa, jlo, klo, 'ro', jhi, khi, 'go', jmisc, kmisc, 'co', ...
'MarkerSize', 16, 'LineWidth', 2 );
for i = 1:length(j_R);
text( j_R(i), k_R(i) + 5, ['(', num2str( x_a(i)) , ',', ...
num2str( y_a(i) ), ')'], 'FontSize', 12 );
end
hold off;

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2015-2-3
The aspect ratio does not change unless you did something to change it. Did you call "axis equal" or "axis square" or something like that? Did you call "hold on" at all? You might want to call "hold off" and/or "cla reset" before you call imshow().

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by