views:

42

answers:

0

Hi. There is this assignment in which the first part involves dividing 3 images(RGB) A,B,C equally into A1,A2 ;B1,B2; C1,C2 Then we have to use (a) bitxor and (b)circular shift operation.The rule for bitxor is A1 bitxor B1 and A2 bitxor C2 and similarly for circular shift. Then merge the two results to obtain a mixed image. The last part is giving problem. How to recombine them after these operations? The code for the operation used is as under size(A)=size(B)=size(C)=256 256 3.

A=imread('lena_color.tif');
B=imread('monkey_color.tif');
C=imread('tree.tif');
A1=A;
A2=A;
B1=A;
B2=A;
C1=A;
C2=A;

A1(1:128,1:128,1:end)=A(1:128,1:128,1:end);
  A2(129:end,129:end,1:end)=A(129:end,129:end,1:end);

 B1(1:128,1:128,1:end)=B(1:128,1:128,1:end);
  C2(129:end,129:end,1:end)=C(129:end,129:end,1:end);
  A11=double(A);
 A22=double(A);

  b1=bitxor(uint8(round(A11)),uint8(B1));  %# bitxor operation
  b2=bitxor(uint8(round(A22)),uint8(C2));

How to proceed next in order to recombine b1 and b2 into an image format of the same size using bitxor and circular shift operation without loss of information?