How to superimpose one image on another in UI Axes of Matlab app designer?

6 visualizzazioni (ultimi 30 giorni)
The below given code is automatically popping up the figure attahced (2.png). I want this figure to appear on the left UI Axes (1.png) superimposed on the existing image instead of just popping up separately.
[~,~,NR_wells] = well_finder(I_final,2);
hold(app.UIAxes,'on')
for c = 1:NR_wells
rectangle('Position',[newC(c,1)-HB,newC(c,2)-HB,HB*2,HB*2],'EdgeColor','y','LineWidth',3);
app.ROI(c,:) = [newC(c,1)-HB,newC(c,2)-HB,HB*2,HB*2];
app.Well{c} = imcrop(I_final,[newC(c,1)-HB,newC(c,2)-HB,HB*2,HB*2]);
end
hold(app.UIAxes,'off')

Risposta accettata

Kevin Holly
Kevin Holly il 9 Mar 2023
Try the following:
[~,~,NR_wells] = well_finder(I_final,2);
hold(app.UIAxes,'on')
for c = 1:NR_wells
rectangle('Position',[newC(c,1)-HB,newC(c,2)-HB,HB*2,HB*2],'EdgeColor','y','LineWidth',3,"Parent",app.UIAxes);
app.ROI(c,:) = [newC(c,1)-HB,newC(c,2)-HB,HB*2,HB*2];
app.Well{c} = imcrop(I_final,[newC(c,1)-HB,newC(c,2)-HB,HB*2,HB*2]);
end
hold(app.UIAxes,'off')

Più risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by