Wednesday, 9 July 2014

How to insert a shape on an gray image

yellow = uint8([255 255 0]);
shapeInserter = vision.ShapeInserter('Shape','Circles','BorderColor','Custom','CustomBorderColor',yellow);
I = imread('cameraman.tif');
circles = int32([30 30 20; 80 80 25]);
RGB = repmat(I,[1,1,3]); % convert I to an RGB image
J = step(shapeInserter, RGB, circles);
imshow(J);

No comments:

Post a Comment