开发者

Matlab Image Processing: Bound image by a rectangle

I have an image and I plotted the boundary of the image. Can anyone please tell me how to draw a rectangle on the image by overwriting the boundary pixel values, using MAT开发者_运维知识库LAB.


If it is a straight rectangle, just set the values in the matrix:

function Stack1()
im = imread('peppers.png');
x = 10;
y = 20;
w = 40;
h = 50;
im(y:y+h,x,:) = 255;
im(y:y+h,x+w,:) = 255;

im(y,x:x+w,:) = 255;
im(y+h,x:x+w,:) = 255;

figure();imshow(im);


end


Probably you can use this File Exchange submission:

Draw a border around an image

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜