% MATLAB CODE Add Coloured Frame to the RGB image.
function AddColouredFrame(img)
% This function takes colour image only.
[x,y,~]=size(img);
framed_img(x+20,y+20,3)=0;
framed_img=uint8(framed_img);
framed_img(11:x+10,11:y+10,:)=img(:,:,:);
% Horizontal Yellow lines on Top and bottom of 3 px.
framed_img(1:3,:,1:2)=255;
framed_img(x+18:x+20,:,1:2)=255;
% Vertical Yellow lines on Left and Right of 3 px.
framed_img(:,1:3,1:2)=255;
framed_img(:,y+18:y+20,1:2)=255;
% Horizontal Cyan lines on Top and bottom of 4 px.
framed_img(4:7,4:y+17,2:3)=255;
framed_img(x+14:x+17,4:y+17,2:3)=255;
% Vertical Cyan lines on Left and Right of 4 px.
framed_img(4:x+17,4:7,2:3)=255;
framed_img(4:x+17,y+14:y+17,2:3)=255;
% Horizontal Red lines on Top and bottom of 3 px.
framed_img(8:10,8:y+13,1)=200;
framed_img(x+11:x+13,8:y+13,1)=200;
% Vertical Red lines on Left and Right of 3 px.
framed_img(8:x+13,8:10,1)=200;
framed_img(8:x+13,y+11:y+13,1)=200;
imtool(framed_img,[]);
end
% Utility code%
k=imread("logo.png");
AddColouredFrame(k);