Hemprasad is Professor at Pune University's College of Engineering in INDIA.He completed Master of Technology in Electronics and Telecommunication.Now uses MATLAB for curriculum improvement.

hey guys,
I like this concept however,
i was wondering why you have put the accession to each pixel in a loop for examples 6 and 7 (it might be there in the others i didnt check).
for r=1:length(a)
b(r)=a(r)+20;
for p=1:m
for q=1:n
if (I(p,q)>= a(r) & I(p,q)<=b(r))

I6(p,q)=L;
else
I6(p,q)=I(p,q);

end
end
end

this is much slower than the single line command:

for r=1:length(a)
I6=I>a(r)&I<b(r);% <<< this line
figure,imshow(I6);xlabel(a(r));title('Gray Level slicing with background');
end

where only a loop for r is required. putting things in a loop completely undoes the power of matlab

Incredibly fast. I use conv2 a lot, and replacing with conv2olam makes calculations much, much faster.
Here is a snippet of code to return the same output as conv2(a, b, 'valid' ):
out = conv2olam( a, b );
out = cnv_cone2( floor(length(b)/2)+[1:size(a,1)], floor(length(b)/2) + [1:size(a,2)] );

hey guys,
I like this concept however,
i was wondering why you have put the accession to each pixel in a loop for examples 6 and 7 (it might be there in the others i didnt check).
for r=1:length(a)
b(r)=a(r)+20;
for p=1:m
for q=1:n
if (I(p,q)>= a(r) & I(p,q)<=b(r))
I6(p,q)=L;
else
I6(p,q)=I(p,q);
end
end
end
this is much slower than the single line command:
for r=1:length(a)
I6=I>a(r)&I<b(r);% <<< this line
figure,imshow(I6);xlabel(a(r));title('Gray Level slicing with background');
end
where only a loop for r is required. putting things in a loop completely undoes the power of matlab

Comment only