Professional Documents
Culture Documents
Experiment 6A 10-236: Nicéphore Niépce Negative Silver Chloride
Experiment 6A 10-236: Nicéphore Niépce Negative Silver Chloride
Objective: In this experiment, student should be able to understand the formula to perform contrast
stretching of a black and white image.
PEO to be achieved:
Pre Lab/ Prior Concepts: Basic MATLAB knowledge of the standard formula to obtain Digital
Negative
______________________________________________________________________________________
Historical Profile:
1816 – Nicéphore Niépce succeeds in making negative photographs of camera images on paper coated
with silver chloride, but cannot adequately "fix" them to stop them from darkening all over when exposed to
light for viewing
New Concepts to be learned: How to increase or decrease the pixel values in an image.
Flow Chart:
Start
Stop
Stepwise Procedure:
1. Open Matlab software
2. Goto New Script
3. Write the program code given below.
4. Save the code with an “.m” extension.
5. Run the code to get the output.
Program Code:
clc;
clear all;
r=imread('cameraman.tif');
[x y]=size(r);
l=s1/r1;
Experiment 6A 10-236
m=(s2-s1)/(r2-r1);
n=(255-s2)/(255-r2);
for i=1:x
for j=1:y
if(r(i,j)<r1)
rcs(i,j)=l*r(i,j);
else if(r(i,j)<r2 && r(i,j)>=r1)
rcs(i,j)=m*(r(i,j)-r1)+s1;
else
rcs(i,j)=n*(r(i,j)-r2)+s2;
end
end
end
end
subplot(1,2,1);
imshow(r);
subplot(1,2,2);
imshow(rcs);
Output:
_________________________________________________________________________
_______
Viva Questions:
1. Define Contrast.
Contrast is the difference in luminance and/or color that makes an object (or its
representation in an image or display) distinguishable. In visual perception of the real world,
contrast is determined by the difference in the color and brightness of the object and other
objects within the same field of view.
_________________________________________________________________________
_______