SlideShare a Scribd company logo
1 of 20
Digital Image Processing:
Image Enhancement in Spatial
Domain
Nidhi Sharma
Image Enhancement
 Image enhancement in the spatial domain is a technique used to improve the
visual quality of digital images by directly manipulating the pixel values.
 It involves modifying the image pixel by pixel, considering their spatial
relationships within the image.
 Image enhancement approaches fall into two broad categories:
 Spatial domain methods
 Point processes
 Area processes
 Frame process
 Frequency domain methods
Image Enhancement: Spatial Domain
 The term spatial domain refers to the aggregate of pixels composing an
image.
 Spatial domain methods are procedures that operate directly on these pixels.
Spatial domain processes will be denoted by the expression
g (x, y) = T [f (x, y)]
where f(x, y) is the input image, g(x, y) is the processed image, and T is an
operator on f, defined over some neighborhood of (x, y).
For example:
T can operate on a set of input images, such as performing the pixel-by-pixel sum
of K images for noise reduction.
Spatial Image Enhancement
 Single-pixel operation (Intensity Transformation)
Negative Image, contrast stretching etc.
 Neighbourhood operations
Averaging filter, median filtering etc.
 Geometric spatial transformations
Scaling, Rotation, Translations et
Single Pixel Operations
Neighbourhood Operations
Geometric Spatial Operators
Averaging
 Often done to improve SNR.
avgI = (img1+img2+img3+img4+img5)/5;
Remember that the data is Uint8 type…..which may saturate the sum values to 255!
So
avgI = (im2double(img1)+im2double(img2)+ im2double(img3)+ im2double(img4)+
im2double(img5))/5;
Im2double also rescales range to [0,1]
Resizing and Transforming
 Use ‘montage’ to see and compare image side by side
Montage ({image1, image2})
avgGray = im2gray (avgI);
avgIreduced = imresize( avgI, 0.75);
avgIsquared = imresize( avgI, 2000, 2000);
avgIrotated = imrotate( avgI, 30, ‘crop’);
 Imwrite( avgI, “filename.png”); % to save image as a given file name
 Imwrite( avgI, “filename.jpg”, “Quality”, 80); % to save image as a given file name
Some Basic Intensity Transformation
Functions
 Image Negatives
s = L – 1 – r
S is the output intensity value
L is the highest intensity levels
r is the input intensity value
 Particularly suited for enhancing white or gray detail embedded in dark
regions of an image, especially when the black areas are dominant in size
Some Basic Intensity Transformation
Functions
 Log Transformations
 s = c log(1 + r) where , c is a constant
 It maps a narrow range of low intensity values in the input into a wide range of output
levels
 The opposite is true of higher values of input levels
 It expands the values of dark pixels in an image while compressing the higher level
values
 It compresses the dynamic range of images with large variations in pixel values
% Read the input image
inputImage = imread('input_image.jpg'); % Replace 'input_image.jpg' with your image file name and
extension
% Convert the input image to double precision for accurate calculations
inputImage = im2double(inputImage);
% Perform log transformation
c = 1; % Constant value for scaling
outputImage = c * log(1 + inputImage);
% Rescale the output image to the range [0, 1] for display
outputImage = (outputImage - min(outputImage(:))) / (max(outputImage(:)) - min(outputImage(:)));
% Display the input and output images figure;
subplot(1, 2, 1);
imshow(inputImage);
title('Input Image');
subplot(1, 2, 2);
imshow(outputImage);
title('Log Transformed Image');
% Save the output image
imwrite(outputImage, 'output_image.jpg'); % Replace 'output_image.jpg' with your desired output image
file name and extension
Example:
Some Basic Intensity Transformation
Functions
 Power Law (Gamma) Transformations
 s = c rγ
 c and γ are both positive constants
 With fractional values(0<γ<1) of gamma map a narrow range of dark input
values into a wider range of output values, with the opposite being true for
higher values (γ >1)of input levels.
 C=gamma=1 means it is an identity transformations.
 Variety of devices used for image capture , printing, and display respond
according to a power law.
 Process used to correct these power law response phenomena is called
gamma correction.
Some Basic Intensity Transformation
Functions
Some Basic Intensity Transformation
Functions
Power Law (Gamma) Transformations
 Images that are not corrected properly look either bleached out or too dark.
 Varying gamma changes not only intensity, but also the ratio of red to green to blue in
a color images.
 Gamma correction has become increasingly important, as the use of the digital images
over internet.
 Useful for general purpose contrast manipulation.
 Apply gamma correction on CRT (Television, monitor), printers, scanners etc.
 Gamma value depends on device.
Some Basic Intensity Transformation
Functions
DIP-Enhancement-Spatial.pptx

More Related Content

Similar to DIP-Enhancement-Spatial.pptx

Image processing
Image processingImage processing
Image processingmaheshpene
 
image processing intensity transformation
image processing intensity transformationimage processing intensity transformation
image processing intensity transformationalobaidimki
 
Digital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainDigital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainMalik obeisat
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point ProcessingGayathri31093
 
Image processing basics using matlab
Image processing basics using matlabImage processing basics using matlab
Image processing basics using matlabAnkur Tyagi
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Introduction to image contrast and enhancement method
Introduction to image contrast and enhancement methodIntroduction to image contrast and enhancement method
Introduction to image contrast and enhancement methodAbhishekvb
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lectureISRAR HUSSAIN
 
Image Enhancement in the Spatial Domain.pdf
Image Enhancement in the Spatial Domain.pdfImage Enhancement in the Spatial Domain.pdf
Image Enhancement in the Spatial Domain.pdfkamaluddinnstu
 
Image Enhancement in the Spatial Domain U2.ppt
Image Enhancement in the Spatial Domain U2.pptImage Enhancement in the Spatial Domain U2.ppt
Image Enhancement in the Spatial Domain U2.pptssuser7ec6af
 
Digital Image Processing (Lab 07)
Digital Image Processing (Lab 07)Digital Image Processing (Lab 07)
Digital Image Processing (Lab 07)Moe Moe Myint
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2Surabhi Ks
 
Intensity Transformation Functions of image with Matlab
Intensity Transformation Functions of image with Matlab Intensity Transformation Functions of image with Matlab
Intensity Transformation Functions of image with Matlab Shafi Sourov
 
Working with images in matlab graphics
Working with images in matlab graphicsWorking with images in matlab graphics
Working with images in matlab graphicsmustafa_92
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 

Similar to DIP-Enhancement-Spatial.pptx (20)

Image processing
Image processingImage processing
Image processing
 
image processing intensity transformation
image processing intensity transformationimage processing intensity transformation
image processing intensity transformation
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Digital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainDigital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domain
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point Processing
 
Image processing basics using matlab
Image processing basics using matlabImage processing basics using matlab
Image processing basics using matlab
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Introduction to image contrast and enhancement method
Introduction to image contrast and enhancement methodIntroduction to image contrast and enhancement method
Introduction to image contrast and enhancement method
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lecture
 
Image Enhancement in the Spatial Domain.pdf
Image Enhancement in the Spatial Domain.pdfImage Enhancement in the Spatial Domain.pdf
Image Enhancement in the Spatial Domain.pdf
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
Image Enhancement in the Spatial Domain U2.ppt
Image Enhancement in the Spatial Domain U2.pptImage Enhancement in the Spatial Domain U2.ppt
Image Enhancement in the Spatial Domain U2.ppt
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Digital Image Processing (Lab 07)
Digital Image Processing (Lab 07)Digital Image Processing (Lab 07)
Digital Image Processing (Lab 07)
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
Intensity Transformation Functions of image with Matlab
Intensity Transformation Functions of image with Matlab Intensity Transformation Functions of image with Matlab
Intensity Transformation Functions of image with Matlab
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Working with images in matlab graphics
Working with images in matlab graphicsWorking with images in matlab graphics
Working with images in matlab graphics
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 

DIP-Enhancement-Spatial.pptx

  • 1. Digital Image Processing: Image Enhancement in Spatial Domain Nidhi Sharma
  • 2. Image Enhancement  Image enhancement in the spatial domain is a technique used to improve the visual quality of digital images by directly manipulating the pixel values.  It involves modifying the image pixel by pixel, considering their spatial relationships within the image.  Image enhancement approaches fall into two broad categories:  Spatial domain methods  Point processes  Area processes  Frame process  Frequency domain methods
  • 3. Image Enhancement: Spatial Domain  The term spatial domain refers to the aggregate of pixels composing an image.  Spatial domain methods are procedures that operate directly on these pixels. Spatial domain processes will be denoted by the expression g (x, y) = T [f (x, y)] where f(x, y) is the input image, g(x, y) is the processed image, and T is an operator on f, defined over some neighborhood of (x, y). For example: T can operate on a set of input images, such as performing the pixel-by-pixel sum of K images for noise reduction.
  • 4. Spatial Image Enhancement  Single-pixel operation (Intensity Transformation) Negative Image, contrast stretching etc.  Neighbourhood operations Averaging filter, median filtering etc.  Geometric spatial transformations Scaling, Rotation, Translations et
  • 8. Averaging  Often done to improve SNR. avgI = (img1+img2+img3+img4+img5)/5; Remember that the data is Uint8 type…..which may saturate the sum values to 255! So avgI = (im2double(img1)+im2double(img2)+ im2double(img3)+ im2double(img4)+ im2double(img5))/5; Im2double also rescales range to [0,1]
  • 9. Resizing and Transforming  Use ‘montage’ to see and compare image side by side Montage ({image1, image2}) avgGray = im2gray (avgI); avgIreduced = imresize( avgI, 0.75); avgIsquared = imresize( avgI, 2000, 2000); avgIrotated = imrotate( avgI, 30, ‘crop’);
  • 10.  Imwrite( avgI, “filename.png”); % to save image as a given file name  Imwrite( avgI, “filename.jpg”, “Quality”, 80); % to save image as a given file name
  • 11. Some Basic Intensity Transformation Functions  Image Negatives s = L – 1 – r S is the output intensity value L is the highest intensity levels r is the input intensity value  Particularly suited for enhancing white or gray detail embedded in dark regions of an image, especially when the black areas are dominant in size
  • 12. Some Basic Intensity Transformation Functions  Log Transformations  s = c log(1 + r) where , c is a constant  It maps a narrow range of low intensity values in the input into a wide range of output levels  The opposite is true of higher values of input levels  It expands the values of dark pixels in an image while compressing the higher level values  It compresses the dynamic range of images with large variations in pixel values
  • 13. % Read the input image inputImage = imread('input_image.jpg'); % Replace 'input_image.jpg' with your image file name and extension % Convert the input image to double precision for accurate calculations inputImage = im2double(inputImage); % Perform log transformation c = 1; % Constant value for scaling outputImage = c * log(1 + inputImage); % Rescale the output image to the range [0, 1] for display outputImage = (outputImage - min(outputImage(:))) / (max(outputImage(:)) - min(outputImage(:))); % Display the input and output images figure; subplot(1, 2, 1); imshow(inputImage); title('Input Image'); subplot(1, 2, 2); imshow(outputImage); title('Log Transformed Image'); % Save the output image imwrite(outputImage, 'output_image.jpg'); % Replace 'output_image.jpg' with your desired output image file name and extension
  • 15. Some Basic Intensity Transformation Functions  Power Law (Gamma) Transformations  s = c rγ  c and γ are both positive constants  With fractional values(0<γ<1) of gamma map a narrow range of dark input values into a wider range of output values, with the opposite being true for higher values (γ >1)of input levels.  C=gamma=1 means it is an identity transformations.  Variety of devices used for image capture , printing, and display respond according to a power law.  Process used to correct these power law response phenomena is called gamma correction.
  • 16. Some Basic Intensity Transformation Functions
  • 17. Some Basic Intensity Transformation Functions
  • 18. Power Law (Gamma) Transformations  Images that are not corrected properly look either bleached out or too dark.  Varying gamma changes not only intensity, but also the ratio of red to green to blue in a color images.  Gamma correction has become increasingly important, as the use of the digital images over internet.  Useful for general purpose contrast manipulation.  Apply gamma correction on CRT (Television, monitor), printers, scanners etc.  Gamma value depends on device.
  • 19. Some Basic Intensity Transformation Functions