2experiment Writeup DPCOE
2experiment Writeup DPCOE
CLASS: TE SEMESTER : 6
THEORY:
Point processing is used to transform an image by operating on individual pixels. If array A
represents an input image then an output array B is produced by a transformation.
B[x,y] = T(A[x,y])
DPCOE/E&TC DIVP 1
Figure: Some basic gray-level
transformation functions.
All curves were to fit in the
range shown
Image Negative s = L - 1 - r
DPCOE/E&TC DIVP 2
in the new image. And for vertical flip i.e. upside down, the pixel situated at
coordinate (x, y) will be situated at coordinate (x, height - y-1) in the new image.
d) Rotate: The algorithm used for a rotation is similar to a flip: to compute the new
image, we iterate over all the pixels and print the corresponding pixel from the source
image. The point situated at the coordinates (x, y) in the new image is equal to the
point (xp, yp) in the input image:
xp = x * cos(angle) - y * sin(angle)
yp = x * sin(angle) + y * cos(angle)
ALGORITHMS:
1. Negative image
Step 1 – Import libraries.
Step 2 – Let’s read the image.
Step 3 – Convert the image to RGB
Step 4 – Let’s read the image in grayscale also.
Step 5 – Lets generate the negative image with the Algorithm:
s = L - 1 – r (where L=255 for grayscale images)
Step 6 – Let’s plot the results.
RESULTS:
CONCLUSION:
___________________________________________________________________________
DPCOE/E&TC DIVP 3
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
REFERENCES:
1. Rafael C. Gonzalez and Richard E. Woods, “Digital Image Processing”, 3rd Edition,
Pearson Education.
2. S Sridhar, “Digital Image Processing”, Oxford University Press.
3. Rafael C. Gonzalez, Richard E. Woods, and Steven L. Eddins, “Digital Image Processing
using MATLAB”, 2nd Edition, Tata McGraw Hill Publication.
DPCOE/E&TC DIVP 4