Maximum recursion limit of 500 reached. Use set(0,’RecursionLimit’,N) to change the limit. Be aware that exceeding your available stack space can crash MATLAB and/or your computer.
it’s fine working on another laptop but in my laptop will getting above error………? can any one solve this….?
clear all;
close all;
a=imread(‘indus.jpg’);
b=rgb2gray(a);
[m,n]=size(b);
r=im2double(b);
% r=im2bw(b,0.75);
% ^r=b;
out=r;
for i=2:m-1
for j=2:n-1
h=[1*r(i-1,j-1) 1*r(i-1,j) 1*r(i-1,j+1);…
1*r(i,j-1) 1*r(i,j) 1*r(i,j+1);…
1*r(i+1,j-1) 1*r(i+1,j) 1*r(i+1,j+1)];
out(i,j)=(median(median(h)));
end
end
r=out;
sobel=r;
for i=2:m-1
for j=2:n-1
h=[-1*r(i-1,j-1) 0*r(i-1,j) 1*r(i-1,j+1);…
-2*r(i,j-1) 0*r(i,j) 2*r(i,j+1);…
-1*r(i+1,j-1) 0*r(i+1,j) 1*r(i+1,j+1)];
sobel(i,j)=(mean(mean(h)));
end
end
sobel1=sobel;
for i=2:m-1
for j=2:n-1
h=[-1*sobel(i-1,j-1) -2*sobel(i-1,j) -1*sobel(i-1,j+1);…
0*sobel(i,j-1) 0*sobel(i,j) 0*sobel(i,j+1);…
1*sobel(i+1,j-1) 2*sobel(i+1,j) 1*sobel(i+1,j+1)];
sobel1(i,j)=(mean(mean(h)));
end
end
% a=min(r,sobel1);
% figure,imshow(a);
res=max(sobel1,r);
figure,imshow(res);
subplot(221);imshow(r,[]);
subplot(222);imshow(res,[]);
subplot(223);imshow(sobel,[]);
subplot(224);imshow(sobel1,[]);it’s fine working on another laptop but in my laptop will getting above error………? can any one solve this….?
clear all;
close all;
a=imread(‘indus.jpg’);
b=rgb2gray(a);
[m,n]=size(b);
r=im2double(b);
% r=im2bw(b,0.75);
% ^r=b;
out=r;
for i=2:m-1
for j=2:n-1
h=[1*r(i-1,j-1) 1*r(i-1,j) 1*r(i-1,j+1);…
1*r(i,j-1) 1*r(i,j) 1*r(i,j+1);…
1*r(i+1,j-1) 1*r(i+1,j) 1*r(i+1,j+1)];
out(i,j)=(median(median(h)));
end
end
r=out;
sobel=r;
for i=2:m-1
for j=2:n-1
h=[-1*r(i-1,j-1) 0*r(i-1,j) 1*r(i-1,j+1);…
-2*r(i,j-1) 0*r(i,j) 2*r(i,j+1);…
-1*r(i+1,j-1) 0*r(i+1,j) 1*r(i+1,j+1)];
sobel(i,j)=(mean(mean(h)));
end
end
sobel1=sobel;
for i=2:m-1
for j=2:n-1
h=[-1*sobel(i-1,j-1) -2*sobel(i-1,j) -1*sobel(i-1,j+1);…
0*sobel(i,j-1) 0*sobel(i,j) 0*sobel(i,j+1);…
1*sobel(i+1,j-1) 2*sobel(i+1,j) 1*sobel(i+1,j+1)];
sobel1(i,j)=(mean(mean(h)));
end
end
% a=min(r,sobel1);
% figure,imshow(a);
res=max(sobel1,r);
figure,imshow(res);
subplot(221);imshow(r,[]);
subplot(222);imshow(res,[]);
subplot(223);imshow(sobel,[]);
subplot(224);imshow(sobel1,[]); it’s fine working on another laptop but in my laptop will getting above error………? can any one solve this….?
clear all;
close all;
a=imread(‘indus.jpg’);
b=rgb2gray(a);
[m,n]=size(b);
r=im2double(b);
% r=im2bw(b,0.75);
% ^r=b;
out=r;
for i=2:m-1
for j=2:n-1
h=[1*r(i-1,j-1) 1*r(i-1,j) 1*r(i-1,j+1);…
1*r(i,j-1) 1*r(i,j) 1*r(i,j+1);…
1*r(i+1,j-1) 1*r(i+1,j) 1*r(i+1,j+1)];
out(i,j)=(median(median(h)));
end
end
r=out;
sobel=r;
for i=2:m-1
for j=2:n-1
h=[-1*r(i-1,j-1) 0*r(i-1,j) 1*r(i-1,j+1);…
-2*r(i,j-1) 0*r(i,j) 2*r(i,j+1);…
-1*r(i+1,j-1) 0*r(i+1,j) 1*r(i+1,j+1)];
sobel(i,j)=(mean(mean(h)));
end
end
sobel1=sobel;
for i=2:m-1
for j=2:n-1
h=[-1*sobel(i-1,j-1) -2*sobel(i-1,j) -1*sobel(i-1,j+1);…
0*sobel(i,j-1) 0*sobel(i,j) 0*sobel(i,j+1);…
1*sobel(i+1,j-1) 2*sobel(i+1,j) 1*sobel(i+1,j+1)];
sobel1(i,j)=(mean(mean(h)));
end
end
% a=min(r,sobel1);
% figure,imshow(a);
res=max(sobel1,r);
figure,imshow(res);
subplot(221);imshow(r,[]);
subplot(222);imshow(res,[]);
subplot(223);imshow(sobel,[]);
subplot(224);imshow(sobel1,[]); maximum recursion limit of 500 reached. use set(0, ‘recursionlimit’, n) MATLAB Answers — New Questions