How can I use lorentzian norm in 2D gray scale image segmentation?
이전 댓글 표시
I'm working on 2D image segmentation & I want to refine the image with lorentz as a preprocessing operation.
lorentzian norm equation is:
f(x)= sum(log(1+0.5(x/T))), where "x" is a distance.
my problem is how can I calculate the distance "x".
is it the distance between center pixel and just one neighbor?
or it's the distance between this pixel and its 8-neighbors?
"or is it the maximum or minimum distance"?
thanks
채택된 답변
추가 답변 (1개)
Image Analyst
2013년 9월 7일
0 개 추천
I have no idea. If you don't either, then why are you so sure you want to do it?
댓글 수: 17
Rasha
2013년 9월 7일
Image Analyst
2013년 9월 7일
That didn't answer the question. So WHY do you think you need it? I guess that you're trying to follow some paper that uses it. If so, then doesn't the paper tell you what x and T are? And tell you why this operation is needed, and what you're supposed to do with f(x) once you've constructed it?
Rasha
2013년 9월 7일
Image Analyst
2013년 9월 7일
Sorry I can't help you http://matlab.wikia.com/wiki/FAQ#Can_you_program_up_the_algorithm_in_this_article_for_me_and_explain_it_to_me.3F. Perhaps the authors will help.
Image Analyst
2013년 9월 7일
편집: Image Analyst
2013년 9월 7일
grayImage = imread('cameraman.tif');
grayImage = im2double(grayImage);
J = zeros(size(grayImage)); % Output
[rows, columns] = size(grayImage);
f = zeros(1,8);
T = 50;
for i = 2 : rows-1
for j = 2 : columns-1
cp=grayImage(i,j);
np=grayImage(i-1,j);
sp=grayImage(i+1,j);
wp=grayImage(i,j-1);
ep=grayImage(i,j+1);
nwp=grayImage(i-1,j-1);
nep=grayImage(i-1,j+1);
swp=grayImage(i+1,j-1);
sep=grayImage(i+1,j+1);
x(1) = (np-cp) ;
x(2) = (nwp-cp)/1.4;
x(3) = (nep-cp)/1.4 ;
x(4) = (sp-cp);
x(5) = (swp-cp)/1.4;
x(6) = (sep-cp)/1.4;
x(7) = (wp-cp);
x(8) = (ep-cp);
f = abs(log(1+0.5*(x/T) .^ 2));
J(i,j) = sum(f(:));
end
end
imshow(J, [])
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
Rasha
2013년 9월 7일
Image Analyst
2013년 9월 7일
What does it do though? It looks like an edge detector. Is that what you wanted? You could probably speed it up even more though clever use of the conv2() function.
Rasha
2013년 9월 7일
Image Analyst
2013년 9월 8일
Please accept my answer since I finally got it working for you.
Image Analyst
2013년 9월 8일
They don't have that functionality (yet), though many have been asking for it.
Youssef Khmou
2013년 9월 8일
rasha, the problem is solved, if you posted the code at the first time it would easier to make suggestions. Unaccept my response and accept the other answer ,
good luck
Image Analyst
2013년 9월 8일
Rasha
2013년 9월 8일
편집: Image Analyst
2013년 9월 8일
카테고리
도움말 센터 및 File Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!