clear clc n = 4

clear
clc
n = 4;
d=1;
u=2;
v=4;
%Secret Image
lp=imread(‘f.png’);
l=rgb2gray(lp);
secretImg = im2bw((l),u/v);
M N = size(secretImg);
tempShares = ones(n, M, N);
tempShares1 = ones(n, M, N);

%Cover Image
lp=imread(‘e.png’);
l=rgb2gray(lp);
coverImg = im2bw((l),u/v);
c=coverImg;

K L = size(coverImg);
coverImg1=ones(4,K,L);

newn=1;
%Mapping matrix
C=1 0 1; 1 1 1;1 0 1;1 1 0;
det= sum(C,2);
Shares_random_grid1 = randomGrid(newn, coverImg);
i=1;
j=1;
while i