【发布时间】:2019-08-04 17:06:36
【问题描述】:
我有一个如下所示的用户界面。 “图像”面板中有几个部分用于显示图像。如果我单击选项面板中的打开按钮,图像面板的左侧会显示一个图像,这很好。但是,当我单击选项面板中的 PROCESS 按钮时出现问题。我希望图像显示在图像面板的右侧。但是图像显示在我不想要的单独窗口上。任何建议将不胜感激。谢谢。
% Button pushed function: ProcessButton
function ProcessButtonPushed(app, event)
img = imread('Intensity1.jpg');
% get red, green, blue channels
redC = img(:,:,1);
greenC = img(:,:,2);
blueC = img(:,:,3);
% mask where red channel is greater than blue channel and green channel greater than blue channel
mask = redC > blueC & greenC > blueC;
% overlay mask into original image
finalimg = bsxfun(@times, img, cast(mask,class(img)));
f = imshow(finalimg);
ax = axes('Parent',f);
plot(ax);
新图像显示在单独的窗口中,而不是显示在用户界面图像面板的右侧。另外,我收到以下错误消息:
使用坐标区时出错 坐标区不能是 Image 的子级。
Patient4/ProcessButtonPushed 中的错误(第 215 行) ax = axes('父',f);
【问题讨论】:
标签: matlab