log_input=imread('fig3.jpg'); gamma_input=imread('fig6.jpg'); neg_input=imread('fig5.jpg'); %img=rgb2gray(inpt); %imview(img); [m n]=size(log_input); [o p]=size(gamma_input); [q r]=size(neg_input); log_opt=zeros(m,n); gamma_opt=zeros(o,p); neg_opt=zeros(q,r); for k=1:m for l=1:n log_opt(k,l)=30*log(double(log_input(k,l))); end end for k=1:o for l=1:p gamma_opt(k,l)=0.6*power(double(gamma_input(k,l)),0.98); end end for k=1:q for l=1:r neg_opt(k,l)=255-neg_input(k,l); end end subplot(3,2,1); imshow(uint8(log_input)); title('Original image'); subplot(3,2,2); imshow(uint8(log_opt)); title('Log Transformation'); subplot(3,2,3); imshow(uint8(gamma_input)); title('Original image'); subplot(3,2,4); imshow(uint8(gamma_opt)); title('Gamma Transformation'); subplot(3,2,5); imshow(uint8(neg_input)); title('Original image'); subplot(3,2,6); imshow(uint8(neg_opt)); title('Negetive Transformation');
Saturday, September 8, 2012
[MATLAB] Gamma,Log and Negetive Trasformation Code
Subscribe to:
Post Comments (Atom)
Thanks alot..:)