Image resize in GUIDE GUI

5 vues (au cours des 30 derniers jours)
curoi
curoi le 3 Fév 2015
Commenté : curoi le 3 Fév 2015
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 commentaire
curoi
curoi le 3 Fév 2015
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;

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 3 Fév 2015
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().

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by