How can I use lorentzian norm in 2D gray scale image segmentation?
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
Image Analyst
il 7 Set 2013
0 voti
I have no idea. If you don't either, then why are you so sure you want to do it?
17 Commenti
Rasha
il 7 Set 2013
Image Analyst
il 7 Set 2013
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
il 7 Set 2013
Image Analyst
il 7 Set 2013
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
il 7 Set 2013
Modificato: Image Analyst
il 7 Set 2013
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
il 7 Set 2013
Image Analyst
il 7 Set 2013
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
il 7 Set 2013
Image Analyst
il 8 Set 2013
Please accept my answer since I finally got it working for you.
Image Analyst
il 8 Set 2013
They don't have that functionality (yet), though many have been asking for it.
Youssef Khmou
il 8 Set 2013
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
il 8 Set 2013
Rasha
il 8 Set 2013
Modificato: Image Analyst
il 8 Set 2013
Categorie
Scopri di più su Image Processing and Computer Vision in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!