Reputation: 5477
I need to draw a rectangle inside an image, then i want to set all the area that is out of the rectangle (that filled by the orange airBrush) to black and save the editing!
Here is my code:
%Draw rectangle
shapeInserter = vision.ShapeInserter;
rectangle = int32([100 100 800 800]);
J = step(shapeInserter, imageA , rectangle);
imshow(J);
I was just drawn the rectangle, without any idea to complete my work, any help ?
Image dimension is 1000x1000.
Upvotes: 1
Views: 1169
Reputation: 22225
RickRoll = rgb2gray(imread('Rick-Roll3.png')); % 800x800 image
I = zeros ([1000, 1000]);
I(101:100+800, 101:100+800) = RickRoll;
Upvotes: 4