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!