help with my code

조회 수: 1 (최근 30일)
Isee You
Isee You 2013년 6월 23일
i write this code so i can search for intesity point in 8 direction like this http://s11.postimg.org/3l4z61wb7/Untitled.jpg and see also http://www.mediafire.com/?y3sy0xs6i7eis58
my code work well but i think it too too too long and take long time 3 minutes can any one help me to make it small and powerful and faster

답변 (1개)

Walter Roberson
Walter Roberson 2013년 6월 23일
편집: Walter Roberson 2013년 6월 23일
You indicate you are searching for intensity points, but you have not defined the algorithm and you have not defined what you want the output to be. The table in the .docx file does not help as you did not give any interpretation of it.
Your existing code has the appearance of a rats nest. There is no point in us analyzing how it works or what it is intended to do, when it would be much easier for you to describe it and document it (including comments.)
  댓글 수: 2
Isee You
Isee You 2013년 6월 25일
At first Ignore comments sorry , i forget do delete them .
my code create mask of 3X3 matrix that scan the image
z=[z1 z2 z3
z4 z5 z6;
z7 z8 z9];
avgg=mean2(z);
and get Average (avgg) and then
if ( avgg<10 && avgg>300 ||avgg==0 )
break;
end
to avoid zero and other values i do not want .
and then i search in 8 direction
c = {@northest, @north, @northwest,@west, @southwest, @south,@southeset,@eset};
for f=1:8
c{f}(avg,a,x,y,t) ;
end
for any direction i pass image, avg,x ,y , t (t no of cycle) like this example as you can find in .doc file i write the condition and thin i get the value of northeset
%north eset
function northest(avg,a,x,y,t)
while x-1 ~= NaN && y-1 ~= NaN && x-1 > 0 && y-1>0
northeset=avg-a(x-1,y-1);
then
if northeset < 20 && northeset >-20
if t<50
dataxnorthest=[dataxnorthest (x-1)];
dataynorthest=[dataynorthest (y-1)];
elseif t>=50 && t<100
dataxnorthest ,dataynorthest are the point i find . i divide these storage from (dataxnorthest to dataxnorthest12 ) , to speed i got a lot of data , then at last i combine them at one datax and datay .
[~,tt]=size (datay);
[k,m]=size (a);
z = ones(k,m, 'double');
z = logical(z);
for u=1:tt
z(datax(u),datay(u)) = 0;
end
then i use above code to creat array that has same size of image but it array of one and zeroes.
No.one expresses the chosen data then
a=double(a).*z;
to get the final image
figure;imshow(a, []);title('cancer image')
Isee You
Isee You 2013년 6월 27일
Walter Roberson , help

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

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by