SlideShare a Scribd company logo
1 of 19
Download to read offline
Name-Anish Hemmady
Project 2
Low level Image Processing
I have applied following low level processing in python programming :
1) Histogram equalization
2) Log Transformation
3) Median Filter
4) Gaussian filter-1D and 2D both have been implemented
5) Image rotation
6) Noise experiments have been carried out using Gaussian and median filters
1) Histogram equalization:
In histogram equalization we have to distribute the intensity values of given image since some
intensity values are clustered as a group together which can contribute to more intensity in
certain regions and less in others. We want to distribute these intensities equally that’s why we
use histogram equalization method. We want to get more accurate information of certain regions
which is made possible through histogram equalization. We make use of cumulative density
function of histogram.
Following are images output which have been generated without any external library usage for
histogram equalization.
Mine program has given foll output:
Input image Output image(after histogram equalz.)
Input Image Output Image
(ct_scan.pnm)
(tire.pnm)
(Auto.pnm)
(building.pnm)
Building.pnm histogram
After Histogram equalization:
Ct_scan initial image histogram
After histogram equalization:
These histograms you can generate easily from my code.Similarly you can get other images
histogram and compare your results. See how the intensity has spreaded evenly.
Now let us look at output images generated by using inbuilt library function:
Using Library function outputs:
Left handside images are input images and right handside are output images
These output images generated by inbuilt library functions are exactly similar to what I have
generated using my coding for histogram equalization.
2) Median filter-Median filter uses neighbouring pixel information to fix middle pixel values of
the sliding window or mask moving on it.It makes use of sorting technique to get the neighbours
sorted and then picks up the median value and places it as middle pixel value.
Median filter removes completely salt and pepper noise.its really good against it.
Below I have shown output on Noise experiments carried out on images using median
filtering to clear out the noise.
Amount of noise added is 0.09 for all images shown below (in program its 1-0.01)
These outputs are results without using any inbuilt library of medianfilter:
Lefthandside consists of noisy image and righthandside consists of output after median
filter
(child.pnm)
(tire.pnm)
(ct_scan.pnm)
(auto.pnm)
(building.pnm)
Below are the outputs generated using Library inbuilt function for medianfilter of matlab
3) Log Transformation-Log Transformation is done to increase brightness in darker
regions, its like contrast stretching . It lights up the darker parts of images. It makes use
of formula c*(1+log(r)) where r is the intensity value.
Below are the outputs generated using log transformation without using library function:
Using library function it gives us same output it’s the same syntax for library.
4) Gaussian Filter-Gaussian filter is used to smoothen image but it tough to remove salt and
pepper noise.It depends upon sigma value which is applied to the Gaussian filter. If sigma value
is large it removes most of salt and pepper noise but in this process it tried to blur image.This is
the problem og Gaussian filter. It can be done in 2d and 1d,it can be done in 1d since Gaussian
filter is separable.I have implemented in both ways. Also Gaussian filter in 1-D is faster than 2-D
filter. I have some good results noted down.If sigma increases noise is reduced by blurring
occurs more.
Below is the output of Gaussian 2-D kernel without inbuilt library:(Input images contain
noise and output images are after applying Gaussian filtering-see noise on rhs.lhs is input
image)
Sigma value used is 1.5 Noise type-salt and pepper, amount-0.09 for all images
Input Image Output Image
Below is the output generated using inbuilt library of Gaussian filter in matlab
Input Image Output Image
Now using 1-D Gaussian kernel I get similar results:
From the above results we can see that Gaussian filter cannot completely eliminate salt
and pepper noise,it blurs it out
Noteable Facts of Gaussian filter
Time taken by Gaussian kernel in 1-D is less as compared to 2-D kernel to filter out the
image.
Gaussian Kernel type Time taken(milliseconds) Input image
size(width*height) pixels
1-D 7.0542585998 (341, 374)
2-D 11.3605490906 (341, 374)
1-D 0.819472711185 (128, 128)
2-D 1.90503216172 (128, 128)
5) Image Rotation: Image Rotation is performed by going backwards method,in which one
has to first loop through new image where new pixel values will be placed and find out the point
in input image where this current pixel of output will be replaced. This is done by multiplying
inverse of rotation matrix with output image x,y coordiantes and translating back to origin.First
translate back to origin then rotate it with inverse matrix, you will get x,y coordinates.Using
these x,y coordinates first draw out the pixel intensity value in the input image and then place
this intensity value in output image.This method avoids aliasing effect in output image.Dont
forget to translate back after rotation by translating back by same amount from origin to rotate
image about its center.The translating factor is width/2 and height/2 of input image.
Images shown below is rotated at angle 45 degrees therefore its anticlockwise direction. If -45
then clockwise.
Following are output images without using inbuilt library of imroatate in python
Input Image OutputImage
Now Rotation using inbuilt library of cv2.getRotationMatrix2D in Python
Conclusion:
Low level processing Technique Its use
Histogram equalization Spread the intensity evenly
Log Transformation See darker regions clearly
Median filter Eliminate the salt and pepper noise
completely
Gaussian Filter (1-D and 2-D) Doesnt eliminate salt and pepper noise
completely but blurs it out
Image Rotation Rotate an image by specific angle clockwise
if negative angle and counter clockwise if
positive angle

More Related Content

What's hot

Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalization
treasure17
 

What's hot (20)

06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram Processing
 
Histogram Equalization
Histogram EqualizationHistogram Equalization
Histogram Equalization
 
Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalization
 
Report
ReportReport
Report
 
Point processing
Point processingPoint processing
Point processing
 
5. gray level transformation
5. gray level transformation5. gray level transformation
5. gray level transformation
 
Image Enhancement
Image Enhancement Image Enhancement
Image Enhancement
 
Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalization
 
Image enhancement in the spatial domain1
Image enhancement in the spatial domain1Image enhancement in the spatial domain1
Image enhancement in the spatial domain1
 
Mathematical operations in image processing
Mathematical operations in image processingMathematical operations in image processing
Mathematical operations in image processing
 
Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Digital image processing using matlab: basic transformations, filters and ope...
Digital image processing using matlab: basic transformations, filters and ope...Digital image processing using matlab: basic transformations, filters and ope...
Digital image processing using matlab: basic transformations, filters and ope...
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
 
Image Restoration And Reconstruction
Image Restoration And ReconstructionImage Restoration And Reconstruction
Image Restoration And Reconstruction
 
image_enhancement_spatial
 image_enhancement_spatial image_enhancement_spatial
image_enhancement_spatial
 

Similar to Project 2-Image_Processng by Anish Hemmady

Comparative study of Salt & Pepper filters and Gaussian filters
Comparative study of Salt & Pepper filters and Gaussian filtersComparative study of Salt & Pepper filters and Gaussian filters
Comparative study of Salt & Pepper filters and Gaussian filters
Ankush Srivastava
 

Similar to Project 2-Image_Processng by Anish Hemmady (20)

Image processing sw & hw
Image processing sw & hwImage processing sw & hw
Image processing sw & hw
 
reducing noises in images
reducing noises in imagesreducing noises in images
reducing noises in images
 
Poster cs543
Poster cs543Poster cs543
Poster cs543
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
Comparative study of Salt & Pepper filters and Gaussian filters
Comparative study of Salt & Pepper filters and Gaussian filtersComparative study of Salt & Pepper filters and Gaussian filters
Comparative study of Salt & Pepper filters and Gaussian filters
 
project presentation-90-MCS-200003.pptx
project presentation-90-MCS-200003.pptxproject presentation-90-MCS-200003.pptx
project presentation-90-MCS-200003.pptx
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptx
 
D122733
D122733D122733
D122733
 
Visual Quality for both Images and Display of Systems by Visual Enhancement u...
Visual Quality for both Images and Display of Systems by Visual Enhancement u...Visual Quality for both Images and Display of Systems by Visual Enhancement u...
Visual Quality for both Images and Display of Systems by Visual Enhancement u...
 
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
 
IRJET- A Review on Various Restoration Techniques in Digital Image Processing
IRJET- A Review on Various Restoration Techniques in Digital Image ProcessingIRJET- A Review on Various Restoration Techniques in Digital Image Processing
IRJET- A Review on Various Restoration Techniques in Digital Image Processing
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image Enhancement
 
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
 
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lecture
 
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
 
DIP - Image Restoration
DIP - Image RestorationDIP - Image Restoration
DIP - Image Restoration
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 

Project 2-Image_Processng by Anish Hemmady

  • 1. Name-Anish Hemmady Project 2 Low level Image Processing I have applied following low level processing in python programming : 1) Histogram equalization 2) Log Transformation 3) Median Filter 4) Gaussian filter-1D and 2D both have been implemented 5) Image rotation 6) Noise experiments have been carried out using Gaussian and median filters 1) Histogram equalization: In histogram equalization we have to distribute the intensity values of given image since some intensity values are clustered as a group together which can contribute to more intensity in certain regions and less in others. We want to distribute these intensities equally that’s why we use histogram equalization method. We want to get more accurate information of certain regions which is made possible through histogram equalization. We make use of cumulative density function of histogram. Following are images output which have been generated without any external library usage for histogram equalization. Mine program has given foll output: Input image Output image(after histogram equalz.)
  • 2. Input Image Output Image (ct_scan.pnm) (tire.pnm) (Auto.pnm)
  • 4. Ct_scan initial image histogram After histogram equalization: These histograms you can generate easily from my code.Similarly you can get other images histogram and compare your results. See how the intensity has spreaded evenly. Now let us look at output images generated by using inbuilt library function: Using Library function outputs: Left handside images are input images and right handside are output images
  • 5.
  • 6. These output images generated by inbuilt library functions are exactly similar to what I have generated using my coding for histogram equalization. 2) Median filter-Median filter uses neighbouring pixel information to fix middle pixel values of the sliding window or mask moving on it.It makes use of sorting technique to get the neighbours sorted and then picks up the median value and places it as middle pixel value. Median filter removes completely salt and pepper noise.its really good against it. Below I have shown output on Noise experiments carried out on images using median filtering to clear out the noise. Amount of noise added is 0.09 for all images shown below (in program its 1-0.01) These outputs are results without using any inbuilt library of medianfilter: Lefthandside consists of noisy image and righthandside consists of output after median filter (child.pnm)
  • 8. (building.pnm) Below are the outputs generated using Library inbuilt function for medianfilter of matlab
  • 9. 3) Log Transformation-Log Transformation is done to increase brightness in darker regions, its like contrast stretching . It lights up the darker parts of images. It makes use of formula c*(1+log(r)) where r is the intensity value. Below are the outputs generated using log transformation without using library function: Using library function it gives us same output it’s the same syntax for library.
  • 10.
  • 11. 4) Gaussian Filter-Gaussian filter is used to smoothen image but it tough to remove salt and pepper noise.It depends upon sigma value which is applied to the Gaussian filter. If sigma value is large it removes most of salt and pepper noise but in this process it tried to blur image.This is the problem og Gaussian filter. It can be done in 2d and 1d,it can be done in 1d since Gaussian filter is separable.I have implemented in both ways. Also Gaussian filter in 1-D is faster than 2-D filter. I have some good results noted down.If sigma increases noise is reduced by blurring occurs more. Below is the output of Gaussian 2-D kernel without inbuilt library:(Input images contain noise and output images are after applying Gaussian filtering-see noise on rhs.lhs is input image) Sigma value used is 1.5 Noise type-salt and pepper, amount-0.09 for all images Input Image Output Image
  • 12. Below is the output generated using inbuilt library of Gaussian filter in matlab Input Image Output Image
  • 13. Now using 1-D Gaussian kernel I get similar results:
  • 14.
  • 15. From the above results we can see that Gaussian filter cannot completely eliminate salt and pepper noise,it blurs it out Noteable Facts of Gaussian filter Time taken by Gaussian kernel in 1-D is less as compared to 2-D kernel to filter out the image. Gaussian Kernel type Time taken(milliseconds) Input image size(width*height) pixels 1-D 7.0542585998 (341, 374) 2-D 11.3605490906 (341, 374) 1-D 0.819472711185 (128, 128) 2-D 1.90503216172 (128, 128) 5) Image Rotation: Image Rotation is performed by going backwards method,in which one has to first loop through new image where new pixel values will be placed and find out the point in input image where this current pixel of output will be replaced. This is done by multiplying inverse of rotation matrix with output image x,y coordiantes and translating back to origin.First translate back to origin then rotate it with inverse matrix, you will get x,y coordinates.Using these x,y coordinates first draw out the pixel intensity value in the input image and then place this intensity value in output image.This method avoids aliasing effect in output image.Dont forget to translate back after rotation by translating back by same amount from origin to rotate image about its center.The translating factor is width/2 and height/2 of input image.
  • 16. Images shown below is rotated at angle 45 degrees therefore its anticlockwise direction. If -45 then clockwise. Following are output images without using inbuilt library of imroatate in python Input Image OutputImage
  • 17. Now Rotation using inbuilt library of cv2.getRotationMatrix2D in Python
  • 18.
  • 19. Conclusion: Low level processing Technique Its use Histogram equalization Spread the intensity evenly Log Transformation See darker regions clearly Median filter Eliminate the salt and pepper noise completely Gaussian Filter (1-D and 2-D) Doesnt eliminate salt and pepper noise completely but blurs it out Image Rotation Rotate an image by specific angle clockwise if negative angle and counter clockwise if positive angle