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

2 views (last 30 days)
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')

Accepted Answer

Kevin Holly
Kevin Holly on 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')

More Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!