答案 0 :(得分:1)
a1= 256; b1= 256; %% big square size
a2 = 200;b2 = 200; %% small square size
r = a1/4; %% cicle radius
shape1 = zeros(a1,b1);
shape2 = rgb2gray(insertShape(shape1,'FilledRectangle',[0.5*(a1-a2) 0.5*(b1-b2) a2 b2],'Opacity',0.5));
shape3 = rgb2gray(insertShape(shape2,'FilledCircle',[a1/2 b1/2 r],'Opacity',1));
imshow(shape3)