Image resize in GUIDE GUI

조회 수: 8 (최근 30일)
curoi
curoi 2015년 2월 3일
댓글: curoi 2015년 2월 3일
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