How to assign an image to another with a black frame?
1 次查看(过去 30 天)
显示 更早的评论
I used the code given below to assign another picture to a black filled picture. The given picture has to fit into the black background at the center so that it looks as if it is framed.
But the result is:
I'd like the pic I loaded, (that is j) inside the box. I tried a lot! Please help! Many thanks in advance! :)
j=imread('1.jpg');
[na, nb, nc]=size(j);
b=40;
j_big=zeros(na+2*b, nb+2*b, nc);
j_big(b+1:b+na, b+1:b+nb, :)=j;
imshow(j_big);
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!