65 views

Uploaded by rakesh1890

image processing

save

You are on page 1of 19

**Lecture9: Intensity (Gray-level)
**

Transformation Functions using

MATLAB

Function imadjust

• Function imadjust is the basic IPT tool for

intensity transformations of gray-scale images. It

has the syntax:

g = imadjust (f, [low_in high_in], [low_out high_out], gamma)

Function imadjust

• As illustrated in figure 3.2 (above), this function maps the intensity

values in image f to new values in g, such that values between

low_in and high_in map to values between low_out and high_out.

• Values below low_in and above high_in are clipped; that is values

below low_in map to low_out, and those above high_in map to

high_out.

Function imadjust

• The input image can be of class uint8, uint16, or double, and the

output image has the same class as the input.

• All inputs to function imadjust, other than f, are specified as values

between 0 and 1, regardless of the class of f. If f is of class uint8,

imadjust multiplies the value supplied by 255 to determine the actual

values to use; if f is of class uint16, the values are multiplied by

65535.

• Using the empty matrix ([ ]) for [low_in high_in] of for [low_out

high_out] results in the default values [0 1].

• If high_out is less than low_out, the output intensity is reversed.

Function imadjust

• Parameter gamma specifies the shape of the curve that maps the

intensity values of f to create g. If gamma is less than 1, the

mapping is weighted toward higher (brighter) output values, as fig

3.2 (a) shows. If gamma is greater than 1, the mapping is weighted

toward lower (darker) output values. If it is omitted from the function

arguments, gamma defaults to 1 (linear mapping).

Function imadjust

Examples

• Example1:

>> f = imread ('baby-BW.jpg');

>> g = imadjust (f, [0 1], [1 0]);

>> imshow(f), figure, imshow (g);

>> imshow(f), figure, imshow (g);

f g

Function imadjust

Examples

• Cont. Example1:

This process, which is the digital equivalent of obtaining a

photographic negative, is particularly useful for enhancing white or

gray detail embedded in a large dark region.

The negative of an image can be obtained also with IPT function

imcomplement:

g = imcomplement (f);

Function imadjust

Examples

• Example2:

>> g = imadjust (f, [0.5 0.75], [0 1], .5);

>> imshow(f), figure, imshow (g);

f g

Function imadjust

Examples

• Example3:

>> g = imadjust (f, [0.5 0.75], [0.6 1], 0.5);

>> imshow(f), figure, imshow (g);

f g

Function imadjust

Examples

• Example4:

>> g = imadjust (f, [ ], [ ], 2);

>> imshow(f), figure, imshow (g);

f g

Logarithmic Transformations

• The shape of logarithmic function curve, is similar to the gamma

curve where gamma < 1, where low values set to 0 and high values

set to 1 on both scales.

• The shape of the gamma curve is variable (because of the change

of low and high values), while the shape of the log function is fixed.

• Logarithmic transformations are implemented using the expression:

g = c * log (1 + double (f))

Logarithmic Transformations

• But this function changes the data class of the image to double, so

another sentence to return it back to uint8 should be done:

gs = im2uint8 (mat2gray(g));

• Use of mat2gray brings the values to the range [0 1] and im2uint8

brings them to the range [0 255]

Logarithmic Transformations

• Example:

>> g = log(1 + double(f));

>> gs = im2uint8(mat2gray(g));

>> imshow(f), figure, imshow (g), figure, imshow(gs);

f g gs

Contrast-Stretching

Transformation

The function shown in the figure below, as indicated in lecture 8, is called a

contrast-stretching transformation function, because it compresses the input

levels lower than m into a narrow range of dark levels in the output image.

Similarly, it compresses the values above m into a narrow band of light

levels in the output. The result is an image of higher contrast.

The limiting case shown below (b), shows the output of a binary image. This

function is called Thresholding, as mentioned earlier. Thresholding, is a

simple tool that can be used for image segmentation.

Contrast-Stretching

Transformation

• The function takes the form of:

Where r represents the intensities of the input image, s

the corresponding intensity values in the output image,

and E controls the slope of the function.

Contrast-Stretching

Transformation

• This equation is implemented in MATLAB for the entire

image as

Note the use of eps to prevent overflow if f has any 0

values.

Contrast-Stretching

Transformation

• Example1:

>>g = 1 ./ (1+ (100 ./(double(f) + eps)) .^ 20);

>> imshow(f), figure, imshow(g);

Contrast-Stretching

Transformation

• Example2:

>> g = 1 ./ (1+ (50 ./(double(f) + eps)) .^ 20);

>> imshow(f), figure, imshow(g);

Contrast-Stretching

Transformation

• Example3:

>> g = 1 ./ (1+ (150 ./(double(f) + eps)) .^ 20);

>> imshow(f), figure, imshow(g);

- SweetFX SettingsUploaded byDaniAnggaNugroho
- SweetFX Settings League of Legends LoL-SuperHighUploaded by123youdie
- SweetFX_settings.txtUploaded byHizwan Hassan
- Fmt 0013matUploaded bydiraazlan
- mit18_01scf10_ex17sol.pdfUploaded byAlex Grama
- T_Alg2 IndUploaded bylusienopop
- 1505743_934876502_CombinedtutorialQsforAndrewUploaded bygaziahmad
- Introduction to FunctionsUploaded bydanielleecave
- 1 1 function notation handoutUploaded byapi-292786746
- EMSE6600Uploaded bymarian07k
- Evolutionary_2variable Xy and Power SchedulingUploaded byRohan Repale
- ME Math ToolUploaded byMario Labastida Ayuban
- The Computer Journal 1966 Jarratt 304 7Uploaded bychikypuky
- 19 Things You Need to Know to Pass Alg1 EOC.pdfUploaded byava
- C3 Functions B - Questions.pdfUploaded bySpike Chingyen
- Chars of a Relations (1.1a)(3)Uploaded bySze Yinn Pikaa
- Brauer - 1975 - Simple Equations for the Magnetization and Reluctivity Curves of Steel.pdfUploaded bytimhls
- Quiz2 2004 SampleUploaded byPriyoti Ahmed
- Core AnalysisUploaded byDexter Geo
- 23Uploaded byctrilok
- Maxima Notes 5 SimplifyUploaded byyjlee123
- Golden Ratio Lesson PlanUploaded byLoganTupper
- Garcia Workshop01Uploaded byEsteban Garcia
- FHMM1014_Chapter_1_Number_and_Sets.pdfUploaded bySin Ting
- day 2 translations lesson planUploaded byapi-301240874
- BCIT ~ Mathematics - Examples - Electronics - Integrals (2)Uploaded byManio Mark
- Learning CurvesUploaded byAliya Raheel
- Ch1 - MCR3U - Review-1Uploaded byMohamed Ali
- Roughness and Growth Characteristics of Self-Affine Thin Gold FilmsUploaded bytwjdewild
- Learning CurvesUploaded byInnocent Won Aber

- 1495965772_1111.pdfUploaded bysharad panwar
- m1Uploaded byrakesh1890
- ResearchUploaded byrakesh1890
- my systemUploaded byrakesh1890
- Introduction to PHPUploaded byrakesh1890
- TitelUploaded byrakesh1890
- m4.txtUploaded byrakesh1890
- Annual Quality Assurance ReportUploaded byrakesh1890
- Real Estate1Uploaded byrakesh1890
- Tcp Ip Osi ReferenceUploaded byrakesh1890
- Todata for collegeUploaded byrakesh1890
- m3.txtUploaded byrakesh1890
- m2.txtUploaded byrakesh1890
- m5.txtUploaded byrakesh1890
- OCRUploaded byrakesh1890
- Input Deta FileUploaded byrakesh1890
- Example networkUploaded byrakesh1890
- MB NAACUploaded byrakesh1890

- Arithmetic MeanUploaded byCA Kaushik Ranjan Goswami
- transportation problemUploaded byPritam Mukherjee
- introduccion-calculo-fraccionarioUploaded bySanti Martinez C
- DM3_FibreOptiqueUploaded byVictor B.
- Copy of 38 ProgramsmmUploaded byHusnain A Ali
- Circuit Design Using Personal ComputersUploaded byBob Stone
- MCIN_U1_A3Uploaded byAnonymous Y4YFzPT0
- Notas de Topologia - SergeyUploaded byIsaac Sanchez
- Trave Su Suolo Alla WinklerUploaded byMarco Fasan
- Lenguaje R - Carlos a. SotoUploaded byJudaiU
- scheda-funzioni goniometricheUploaded bymaurizio_pischiutta
- Angles Orientes - Trigonometrie_old1Uploaded byYannick Roswilo
- Student Lecture 42 Fourier Series (1)Uploaded byuploadingperson
- hstx_alg1_pe_08Uploaded by김동주
- Statics H.W.IUploaded bygediko
- 16396_MetodosMatematicosIIUploaded byCarlos Melero Vilches
- vibraciones mecanicas IUploaded byJairo
- Curva BraquistócronaUploaded byGuzmanbueno
- sol08Uploaded bysniprip
- Rotation MatriciesUploaded bySoumya Civil S
- MODULE12 Matrices.docUploaded byCorey Lopez
- Distribución Normal FinalUploaded byValentin Cruz Martinez
- trayectorias ortogonalesUploaded byJAngelRios
- Fourier Sine Serie ExampleUploaded byHuy Dinh
- Conic Section Dpp 1-12-13thUploaded byKartikeya Arya
- Tensor TheoryUploaded bycuto9
- AES - Comparison of Numerical Simulation Models and Measured Low-Frequency Behavior of Loudspeaker EnclosuresUploaded byZoeloe_2
- Lecture 2Uploaded byBarney Stinson
- calc 8.2(10).pptUploaded bytheredgem
- Problemas CÃlculo IntegralUploaded bybrayanfimuni