<< Chapter < Page | Chapter >> Page > |
Questions or comments concerning this laboratory should be directedto Prof. Charles A. Bouman, School of Electrical and Computer Engineering, Purdue University, West Lafayette IN 47907;(765) 494-0340; bouman@ecn.purdue.edu
This is the first part of a two week experiment in image processing. During this week, we will cover the fundamentalsof digital monochrome images, intensity histograms, pointwise transformations, gamma correction, and image enhancement based on filtering.
In the second week, we will cover some fundamental concepts of colorimages. This will include a brief description on how humans perceive color, followed by descriptions of two standard color spaces.The second week will also discuss an application known as image halftoning .
An image is the optical representation of objects illuminated by a light source. Since we want to process images using acomputer, we represent them as functions of discrete spatial variables. For monochrome (black-and-white) images, a scalar function $f(i,j)$ can be used to represent the light intensity at each spatial coordinate $(i,j)$ . [link] illustrates the convention we will use for spatial coordinates to represent images.
If we assume the coordinates to be a set of positive integers, for example $i=1,\cdots ,M$ and $j=1,\cdots ,N$ , then an image can be conveniently represented by a matrix.
We call this an $M\times N$ image, and the elements of the matrix are known as pixels .
The pixels in digital images usually take on integer values in the finite range,
where 0 represents the minimum intensity level (black), and ${L}_{max}$ is the maximum intensity level (white) that the digital image can take on. The interval $[0,{L}_{max}]$ is known as a gray scale .
In this lab, we will concentrate on 8-bit images, meaning that each pixel is represented by a single byte.Since a byte can take on 256 distinct values, ${L}_{max}$ is 255 for an 8-bit image.
Download the file yacht.tif for the following section. Click here for help on the Matlab image command .
In order to process images within Matlab, we need to first understand their numerical representation.Download the image file yacht.tif . This is an 8-bit monochrome image.Read it into a matrix using
A = imread('yacht.tif');
Type
whos
to display your variables.
Notice under the "Class" column that the
$A$ matrix
elements are of type
uint8 (unsigned integer, 8 bits).
This means that Matlab is using a single byte to represent each pixel.Matlab cannot perform numerical computation on numbers of type
uint8 , so we usually need to convert the matrix to a floating point
representation.Create a double precision representation of the image using
B = double(A);
.
Again, type
whos
and notice the difference in the number
of bytes between
$A$ and
$B$ .
In future sections, we will be performing computations on our images,so we need to remember to convert them to type
double before processing them.
Display yacht.tif using the following sequence of commands:
Notification Switch
Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?