Your assignment it to write code in matlab that takes an ima
Your assignment it to write code in matlab that takes an image and removes shadow from the image. Write the whole code yourself, without using any built-in function. DO NOT USE BUILT IN FUNCIONS. YOU CAN USE FOR LOOPS OR ANY THING YOU LIKE BUT NOT BUILT IN FUNCIONS PLEASE.
Solution
The code for the aforementioned operation is: a=imread(\'foreground.jpg\'); b=imread(\'background.jpg\'); da=double(a); db=double(b); D=imabsdiff(a,b); r=zeros(240,320); h=a; for ix=1:240 for iy=1:320 if D(ix,iy)>20 if da(ix,iy,1)~=0&da(ix,iy,2)~=0&da(ix,iy,3)~=0 if (db(ix,iy,1)/da(ix,iy,1)<4)&(db(ix,iy,1)/da(ix,iy,1)>1.5) if (db(ix,iy,2)/da(ix,iy,2)<2.8)&(db(ix,iy,2)/da(ix,iy,2)>1.3) if (db(ix,iy,3)/da(ix,iy,3)<2.05)&(db(ix,iy,3)/da(ix,iy,3)>1.14) if (db(ix,iy,3)/da(ix,iy,3)