0% found this document useful (0 votes)
40 views

3experiment Writeup DPCOE

Uploaded by

Sachin Rathod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

3experiment Writeup DPCOE

Uploaded by

Sachin Rathod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

DHOLE PATIL EDUCATION SOCIETY’s

DHOLE PATIL COLLEGE OF ENGINEERING


DEPARTMENT: E&TC Engg ACADEMIC YEAR:

CLASS: TE SEMESTER : 6

SUBJECT: DIP DATE:

NAME: ROLL NO.:

TITLE : Perform Point Processing operations on images

AIM Perform the following point processing operations on the image

(a) Implement Gray level slicing (intensity level slicing) in to read the ‘cameraman’
image.
(b) Read an 8-bit image, and see the effect of each bit on the image.
(c) Read an image and extract 8 different planes i.e. ‘bit plane slicing.”

SOFTWARE REQUIREMENT: Matlab /Python

THEORY:
Point Operations: The operations that are performed on individual pixels of the image are called
point operations. Different point operations in the spatial domain are:
1)Inverting the image 2) Log and antilog of image 3) Power low and inverse power low 4) Gray-
level slicing 5) Bit-level Slicing and 6) contrast stretching
Gray Level slicing
Gray-level slicing is also known as intensity slicing. It is used to highlight a particular part of the
image. There are two methods -

a) Without a background: This technique is used to select a specific range of gray levels from
an image and reduces all other intensities to lower level

b) With background: This technique is used to select a specific range of gray levels from an
image and preserves all other intensity levels.

DPCOE/E&TC DIP 1
s= output gray level, r= Input gray level, L-1= maximum gray level

Bit Plane Slicing


Since the pixel value of the grayscale image lies between 0 -255, it is represented using 8 bits. So,
we can slice the image into 8 planes (8 Binary images).
For an 8-bit image “0” is encoded in 00000000 and “255” is encoded in 11111111

Example: Apply bit plane slicing on the following image size (3X3)

DPCOE/E&TC DIP 2
Bit plane slicing of above:

Bit Plane Slicing is a method of representing an image with one or more-bit planes of the image. The
main goal of Bit Plane Slicing are as follows:
• Converting grey level image to binary image.
• Representing an image with fewer bits.
• Enhancing an image by focusing

DPCOE/E&TC DIP 3
numpy.binary_repr(num, width=None)
Return the binary representation of the input number as a string.

Example:

>>> np.binary_repr(3)
'11'
>>> np.binary_repr(3, width=4)
'0011'

ALGORITHMS:
1. Gray Level Slicing
i. Load the image.
ii. Find the width and height of the image.
iii. Create an array of zeros to store the sliced image
iv. Specify the min and max range of the slice.
v. Loop over the input image and if the pixel value lies in the desired range set it
to 255 otherwise set it to 0(Without a background) or keep unchanged (with a
background)
vi. Display the gray-level sliced image

2. Bit plane Slicing


i. Read the image in greyscale
ii. Iterate over each pixel and change pixel value to binary using np.binary_repr() and
store it in a list.
iii. We have a list of strings where each string represents a binary pixel value. To extract
bit planes, we need to iterate over the strings and store the characters corresponding to
bit planes in the lists.
iv. Multiply with 2^(n-1) and reshape to reconstruct the bit image.
v. Concatenate these images for ease of display using cv2.hconcat()
vi. Vertically concatenate using cv2.vconcat()
vii. Display the images

RESULTS:
See the attachment

DPCOE/E&TC DIP 4
CONCLUSION:
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________

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.

Submission date: / / Subject Teacher

DPCOE/E&TC DIP 5

You might also like