www.gusucode.com > vision 源码程序 matlab案例代码 > vision/DrawaRedTriangleinaColorImageExample.m
%% Draw a Red Triangle in a Color Image %% % Create a shape inserter object and read the image file. % % shapeInserter = vision.ShapeInserter('Shape','Polygons','BorderColor','Custom',... % 'CustomBorderColor', uint8([255 0 0])); % I = imread('autumn.tif'); %% % Define vertices which will form a triangle: [x1 y1 x2 y2 x3 y3]. % % polygon = int32([50 60 100 60 75 30]); %% % Draw the triangles and display the result. % % J = shapeInserter(I, polygon); % imshow(J);