Azzera filtri
Azzera filtri

Image resize in GUIDE GUI

11 visualizzazioni (ultimi 30 giorni)
curoi
curoi il 3 Feb 2015
Commentato: curoi il 3 Feb 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 Commento
curoi
curoi il 3 Feb 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;

Accedi per commentare.

Risposta accettata

Image Analyst
Image Analyst il 3 Feb 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().

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by