Monday, 26 March 2012

Lab 3

Well, what we learned last week?? here's a recap on what we did.

Intensity transformation function

Photographic negative (imcomplement)
-imagine this as turning the black color to white and white color to black. the gradient in between is also reverse. here we turns the white cat to black cat using this code. its vice versa.

>> I = imread('cat.jpg');
>>imshow(I)
>> J=imcomplement(I);
>>figure,imshow(J)




Gamma transformation (imadjust)

>> J1 = imadjust(I,[],[],1);
>> J2 = imadjust(I,[],[],3);
>> J3 = imadjust(I,[],[],0.4);
>>imshow(J1);
>>figure, imshow(J2);
>>figure, imshow(J3);

Algorithmic Transformation (c*log(1+f))
>>imshow(I)
>> I2 = im2double(I);
>> J4 = 1 * log(1 + I2);
>> J5 = 2 * log(1 + I2);
>> J6 = 5 * log(1 + I2);
>>figure, imshow(J4)
>>figure, imshow(J5)
>>figure, imshow(J6)
 



Contrast-stretching transformation( 1. / (1 + ( m./(double (f) + eps ) ) . ^ E )
>> contrast1 = 1./(1 + (m ./(I2 + eps )).^4);
>>figure, imshow(contrast1)
>> contrast2 = 1./(1 + (m ./(I2 + eps )).^5);
>> contrast3 = 1./(1 + (m ./(I2 + eps )).^10);
>>figure, imshow(contrast2)
>>figure, imshow(contrast3)
>> contrast4 = 1./(1 + (m ./(I2 + eps )).^-5);
>>figure, imshow(contrast4)
>> contrast5 = 1./(1 + (m ./(I2 + eps )).^-1);
>>figure, imshow(contrast5)
>>figure, imshow(I2)
>>figure, imshow(I)




No comments:

Post a Comment