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

2 ビュー (過去 30 日間)
Amlan basu
Amlan basu 2023 年 3 月 9 日
回答済み: Kevin Holly 2023 年 3 月 9 日
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')

採用された回答

Kevin Holly
Kevin Holly 2023 年 3 月 9 日
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')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by