Illumination estimation: Finding boundary template
이전 댓글 표시
The gradient module and the boundary template are similar.The output is supposed to be like

but the gradient and boundary template comes like this for my code

[Gx, Gy] = imgradientxy(eimg);
[Gmag, Gdir] = imgradient(Gx, Gy);
g=Gmag;
imshow(g,'Parent',handles.axes5);
sum=0.0;
%? = c·?A
area=rows*cols;
sig= 0.0032*sqrt(area);
d = dog(g,4*sig, sig,0);
imshow(d,'Parent',handles.axes6);
for x = 1:rows
for y = 1:cols
if d(x,y)>0
d(x,y)=d(x,y);
else
d(x,y)=0;
end
sum = sum+d(x,y);
end
end
al = 1.2;
w = d ./ sum;
t=ones(rows,cols);
for x = 1:rows
for y = 1:cols
t(x,y) = conv(w(x,y),g(x,y));
if g(x,y)>0
g(x,y)=g(x,y);
else
g(x,y)=0;
end
end
end
b = g - (al .* t);
b is the boundary template and g is the gradient module .
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Contrast Adjustment에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!