How to transform an gray scale image from spatial domain to neutrosophic image with matlab code?
1 次查看(过去 30 天)
显示 更早的评论
it is my code for applying these equations
where i/p is image in grayscale and i want to get o/p as image in T.I.F domain
but these code give empty images
what is the wrong
g=imread('H.jpg'); %g is my input image
g=rgb2gray(g);
g=double(g);
w=3; %assume w=3
for i = 3:size(g,1)-2
for j = 3:size(g,2)-2
s=0;
for m=i-round(w/2):i+round(w/2)
for n=j-round(w/2):j+round(w/2)
s=s+g(m,n);
end
end
g(i,j)=s/(w*w); % equation 2
segma(i,j)=abs(g(m,n)-g(i,j)); % equation 4
gmin = min(min(g(i,j))); % minumum of local mean intensity value ,min g ¯(i, j)
gmax = max(max(g(i,j))); % maxmum of local mean intensity value ,max g¯(i, j)
segmamin = min(min(segma(i,j)));
segmamax = max(max(segma(i,j)));
T(i,j)= ((g(i,j)-gmin)./(gmax-gmin)); %equation 1
I(i,j)=((segma(i,j)-segmamin)./(segmamax-segmamin)); %equation 3
F(i,j)=1-T(i,j); %equation 5
end
end
subplot(3,1,1),imshow(T(i,j)),title('T-domain');
subplot(3,1,2),imshow(I(i,j)),title('I-domain');
subplot(3,1,3),imshow(F(i,j)),title('F-domain');
![56819066_381115406071851_6045156277162606592_n.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213445/56819066_381115406071851_6045156277162606592_n.png)
1 个评论
Mohd Anas Wajid
2021-4-18
Did you get your code corrected by someone? I am working in same field. I also need some help regarding this code.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!