Removing the shadow from image

I have an image in which i have to remove the shadows from it ,please help how to process.I have uploaded the Image

답변 (1개)

Image Analyst
Image Analyst 2012년 7월 13일

0 개 추천

댓글 수: 5

kash
kash 2012년 7월 13일
편집: Oleg Komarov 2012년 9월 3일
I tried using the code
I = imread('imagesh1.bmp');
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(2)) + rho2*1/(sqrt(2)) - rho3*2/(sqrt(6))); %(1/sqrt(6); 1/sqrt(6); -2/sqrt(6))
theta = 10;
InvariantImage = cos(theta*pi/180)*X1 + sin(theta*pi/180)*X2;
imshow(InvariantImage)
but could not get the correct answer,i need the output as in the link
can u tell where had made mistake please
Keerthi  D
Keerthi D 2020년 6월 30일
편집: Keerthi D 2020년 6월 30일
sir l tried this code but it not work.
its output is:
sir how to solve this problem .
Image Analyst
Image Analyst 2020년 6월 30일
The attached algorithm looks pretty simple. Try it.
Keerthi  D
Keerthi D 2020년 7월 1일
I didn't get
Image Analyst
Image Analyst 2020년 7월 1일
Maybe someone else you work with could understand it and explain it to you? Otherwise, pick a different shadow removal algorithm that you can understand.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2012년 7월 13일

댓글:

2020년 7월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by