Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Shadow Removal Using Entropy minimization
Replies: 13   Last Post: Nov 6, 2017 2:17 AM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Sandeep Posts: 3 Registered: 10/6/09
Shadow Removal Using Entropy minimization
Posted: Oct 6, 2009 8:18 AM
 Plain Text Reply

Hi all,

I am trying to implement a shadow removal algorithm in matlab. I follow the paper
written by Mr.Graham.Finalyson i.e, "Shadow removal using Entropy minimization".
First of all i am trying to get 1-D illuminant invariant image by assuming that we
know the projection angle. I took some known images from the above mentioned
paper so that i know the projection angle and there is no need of entropy calculation.
The program which wrote works with some images and seems to be failed with some images. Please help me if some one has some experience with this algorithm. I am appending small part of my matlab code which is written to produce a 1-D illumination invariant image.
------------------------------------------------------------------------------------------------------------------

I = imread('file1.tiff');
J = im2double(I);

R = J(:,:,1);
G = J(:,:,2);
B = J(:,:,3);

[len,wid] = size(R);

% Generation of 2-D Log Chromaticity Image.
for i = 1:len
for j = 1:wid
if ((R(i,j)*G(i,j)*B(i,j))~= 0)
c1(i,j) = R(i,j)/((R(i,j)*G(i,j)*B(i,j))^(1/3));
c2(i,j) = G(i,j)/((R(i,j)*G(i,j)*B(i,j))^(1/3));
c3(i,j) = B(i,j)/((R(i,j)*G(i,j)*B(i,j))^(1/3));
else
c1(i,j) = 1;
c2(i,j) = 1;
c3(i,j) = 1;
end
end
end

rho1 = mat2gray(log(c1));
rho2 = mat2gray(log(c2));
rho3 = mat2gray(log(c3));

X1 = mat2gray(rho1*1/(sqrt(2)) - rho2*1/(sqrt(2))); %(1/sqrt(2); -1/sqrt(2); 0)
X2 = mat2gray(rho1*1/(sqrt(6)) + rho2*1/(sqrt(6)) - rho3*2/(sqrt(6))); %(1/sqrt(6); 1/sqrt(6); -2/sqrt(6))

theta = 120;

InvariantImage = cos(theta*pi/180)*X1 + sin(theta*pi/180)*X2;

-----------------------------------------------------------------------------------------------------

Thank you all,
Sandeep P

Date Subject Author
10/6/09 Sandeep
7/21/10 Luca
7/24/10 casa
7/24/10 casa
10/18/10 hao yu
10/18/10 Nasser Abbasi
10/18/10 hao yu
7/16/14 Waqar
7/16/14 Waqar
10/10/17 lavanyasanthosham14@gmail.com
7/31/14 Anand
8/19/16 Han Gong
3/30/17 bce.anil@gmail.com
11/6/17 shobamalar@gmail.com

© The Math Forum at NCTM 1994-2018. All Rights Reserved.