Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

%log transformation clc,clear all; a=imread('E:\dip images\college.

bmp'); b=log(1+im2double(a)); figure; subplot(1,2,1),imshow(a),title('real image'); subplot(1,2,2),imshow(b),title('transformed image'); %negative transformation clc, clear all; a=imread('E:\dip images\college.bmp'); b=256-a-1; figure; subplot(1,2,1),imshow(a),title('real image'); subplot(1,2,2),imshow(b),title('negative image'); %contrast stretching a=imread('E:\dip images\college.bmp'); [m,n]=size(a); d=reshape(a,m,n); for i=1:m*n if (d(i)<40 || d(i)>160) e(i)=60; else e(i)=130; end end f=reshape(e,m,n); figure; subplot(1,2,1),imshow(a),title('real image'); subplot(1,2,2),imshow(uint8(f)),title('contrast stretching image'); %power law transformation clc, clear all; a=imread('E:\dip images\college.bmp'); figure,imshow(a); r=1; figure for c=0.1:0.2:0.9 d=(im2double(a).^c); subplot(1,5,r),imshow(d); title(c); r=r+1; end

You might also like