matlab 图片最多显示几张_Matlab:如何在同一图像中显示多个输出?

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 16:31   1162   0

Let's say my image is img=zeros(100,100,3), my outputs are several ellipse which i get using a created function [ret]=draw_ellipse(x,y,a,b,angle,color,img), I can display one ellipse using imshow(ret).For the moment, I'm trying to show serval ellipse in the image. But i don't know how to code it. will ‘for loop’ work or I need to hold them?

解决方案

If this is related to what you were doing in your previous question, then what you need to do is to pass the result of one iteration as input to the next.

So assuming that the function [ret]=draw_ellipse(x,y,a,b,angle,color,img) you mentioned takes as input an image img and returns the same image with an ellipse drawn on it, you could do this:

%# ellipses parameters

%#x = {..}; y = {..};

%#a = {..}; b = {..};

%#angle = {..}; color = {..};

img = zeros(200,100,'uint8'); %# image to start with

for i=1:10

img = draw_ellipse(x{i},y{i}, a{i},b{i}, angle{i}, color{i}, img);

end

imshow(img)

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP