how to make a new mat variable with 9 elements
Hi, I want make a new mat variable (image) of 9 element where i can add the 4 pixel of a mat image in its corner and the row and colums in the mat, and in the middle the mat image itself. How i can do this? I am not able to create a mat variable with 9 elements.
I have done this in matlab.
I=imread('1.jpg');
in= im2double(rgb2gray(I));
[row col]=size(in);
h = ones(5);
out1=stdfilt(in,h); %Standard deviation from inbuilt function
imshow(out1);
%% Replicating two rows and two columns on all the four sides of image
image1=[ in(1,1), in(1,:), in(1,col);
in(:,1), in, in(:,col);
in(row,1), in(row,:), in(row,col)];
Here in(1,1),in(1,col),in(row,1), in(row,col) are the 4 corner of new mat variable, and in is the previous mat image and else are the boundaries of the new mat variable.
This is like adding a row and a column in existing image, so that i can do furter calcualtion.
help me.
thanks