show image independently

1 次查看(过去 30 天)
Izzo
Izzo 2011-10-21
i was building a program for capturing image from webcam, and show it using imshow(image) but suddenly after the image is captured, the image is shown in the part of gui, what i mean is to show the image independently, help me guys! thx!

采纳的回答

Jan
Jan 2011-10-21
imshow displays the image in the current AXES-object. I assume "showing the image independently" means to display it in a new figure. Then:
newFigureH = figure;
newAxesH = axes('Parent', newFigureH);
imshow(rand(100, 100, 3), 'Parent', newAxesH);
  7 个评论
Walter Roberson
Walter Roberson 2011-10-22
No, Izzo, where Jan showed "figure" you require a figure number, and cannot use an image handle. An image is a single bit-mapped drawing such as a photograph, and cannot contain any other objects (except an annotation object.)
If img is the image you want to show, then you need to adapt Jan's example to
newFigureH = figure;
newAxesH = axes('Parent', newFigureH);
imshow(img, 'Parent', newAxesH);
Izzo
Izzo 2011-10-22
right it works! thank you very much for you guys help

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Display Image 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by