18 Dec 2014
Following is the matlab codes for Grey Level or Intensity transformation functions...
3.Power-Law Transformations
1. Linear(Negative Transformation)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A=imread('401566.jpg'); %Change 401566.jpg with your image file | |
A=rgb2gray(A); | |
imshow(255-A); %(L-1)-r;L=256(8 bit gray scale) |
2. Log Transform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Log Transform | |
% Equation s=c*log(1+r) | |
A=imread('401566.jpg'); | |
A=rgb2gray(A); | |
imshow(log(double(A)+1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Power-Law Transformation | |
% Equation s=cr^a | |
A=imread('401566.jpg'); | |
A=rgb2gray(A); | |
c=1; | |
a=2.2; | |
imshow(uint8(c*(double(A).^a))); |