No matter what I do in App Designer, the image doesn't update.

1 visualización (últimos 30 días)
채호 박
채호 박 el 9 de Dic. de 2022
Comentada: chrisw23 el 9 de Dic. de 2022
As shown in the figure, No. 101 (purple arrow) is in the opposite direction to No. 102. At this time, 101.jpg, which was newly saved after correcting the direction (rightmost picture), has an arrow pointing upward. However, whether I turn my computer off and on, create a new folder, or delete all my photos and move them back, the arrow always points in the downward direction before editing. What could be the problem?
function BtnOpen1ButtonPushed(app, event)
[app.filename1, user_canceled] = imgetfile('InitialPath', app.ROOT_PATH );
if user_canceled == true, return; end
[app.ROOT_PATH, name, ext] = fileparts(app.filename1);
app.Fn1.Value = app.filename1;
app.img1 = imread( app.filename1 );
image(app.UIAxes1, app.img1)
axis(app.UIAxes1, 'tight')
app.UIAxes1.Title.String = name;
nLen = length(name);
fmtspec = sprintf('%%0%dd', nLen);
name2 = sprintf(fmtspec, str2double(name) + 1 );
app.filename2 = fullfile( app.ROOT_PATH, strcat(name2, ext) );
app.img2 = imread( app.filename2 );
image(app.UIAxes2, app.img2)
axis(app.UIAxes2, 'tight')
app.UIAxes2.Title.String = name2;
end
The result window will display two arrows pointing upwards, respectively. (Like 101.jpg)
  1 comentario
chrisw23
chrisw23 el 9 de Dic. de 2022
save your last setting on close event and load the last setting at startup

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by