Docsity

Satellite Image Processing - GIS and Mapping - Lecture Notes, Study notes of Geology

Toggle sidebar
bg1
Satellite Image Processing with MATLAB
Introduction
MATLAB (MATrix LABoratory) integrates computation, visualization, and programming in
an easy-to-use environment where problems and solutions are expressed in familiar
mathematical notation. MATLAB features a family of application-specific solutions called
toolboxes. Toolboxes are comprehensive collections of MATLAB functions (M-files) that
extend the MATLAB environment to solve particular classes of problems. Areas in which
toolboxes are available include signal processing, control systems, neural networks, fuzzy
logic, wavelets, simulation, image processing and many others. Image processing tool box
has extensive functions for many operations for image restoration, enhancement and
information extraction. Some of the basic features of the image processing tool box are
explained and demonstrated with the help of a satellite imagery obtained from IRS (Indian
Remote Sensing Satellite) LISS III data of Uttara Kannada district, Karnataka.
Basic operations with matlab image processing tool box
Read and Display an Image:
Clear the MATLAB workspace of any variables and close the open figure windows. To read
an image, use the imread command. Let's read in a JPEG image named image4. JPG, and
store it in an array named I.
I = imread (‘image4. JPG’);
Now call imshow to display I.
imshow (I)
Image is displayed as shown in Fig 1.
This image is IRS LISS III Band 4
(Near Infrared) data showing a portion
of Uttara Kannada district in
Karnataka. Some features in the image
are (i) Arabian Sea on the left (ii)
Kalinadi in top half (iii) Dense
vegetation. Small white patches in the
image are clouds.
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Satellite Image Processing - GIS and Mapping - Lecture Notes and more Study notes Geology in PDF only on Docsity!

Satellite Image Processing with MATLAB

Introduction

MATLAB (MATrix LABoratory) integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. MATLAB features a family of application-specific solutions called toolboxes. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, image processing and many others. Image processing tool box has extensive functions for many operations for image restoration, enhancement and information extraction. Some of the basic features of the image processing tool box are explained and demonstrated with the help of a satellite imagery obtained from IRS (Indian Remote Sensing Satellite) LISS III data of Uttara Kannada district, Karnataka.

Basic operations with matlab image processing tool box

Read and Display an Image : Clear the MATLAB workspace of any variables and close the open figure windows. To read an image, use the imread command. Let's read in a JPEG image named image4. JPG, and store it in an array named I. I = imread (‘image4. JPG’); Now call imshow to display I.

imshow (I) Image is displayed as shown in Fig 1. This image is IRS LISS III Band 4 (Near Infrared) data showing a portion of Uttara Kannada district in Karnataka. Some features in the image are (i) Arabian Sea on the left (ii) Kalinadi in top half (iii) Dense vegetation. Small white patches in the image are clouds.

Figure 1. Image displayed using imshow

Figure 2. Histogram of raw image

Check the Image in Memory Enter the whos command to see how I is stored in memory. whos MATLAB responds with Name Size Bytes Class I 342x342 116964 uint Grand total is 116964 elements using 116964 bytes

Histogram Equalization As can be seen, image4.JPG is in low contrast i.e., although pixels can be in the intensity range of 0-255 they are distributed in a narrow range. To see the distribution of intensities in image4.JPG in its current state, a histogram can be created by calling the imhist function. (Precede the call to imhist with the figure command so that the histogram does not overwrite the display of the image in the current figure window.) figure, imhist (I) % Display a histogram of I in a new figure (Fig. 2).

Figure 4. Image after adding two images

PCX (Paintbrush) PNG (Portable Network Graphics) TIFF (Tagged Image File Format) XWD (X Window Dump)

Converting Image Storage Classes uint8 and uint16 data can be converted to double precision using the MATLAB function, double. However, converting between storage classes changes the way MATLAB and the toolbox interpret the image data. If it is desired to interpret the resulting array properly as image data, the original data should be rescaled or offset to suit the conversion. For easier conversion of storage classes, use one of these toolbox functions: im2double , im2uint8 , and im2uint16. These functions automatically handle the rescaling and offsetting of the original data. For example, the following command converts a double- precision RGB (Red Green Blue) image with data in the range [0,1] to a uint8 RGB image with data in the range [0,255]. RGB2 = im2uint8(RGB1);

Converting Graphics File Formats To change the graphics format of an image, use imread to read in the image and then save the image with imwrite, specifying the appropriate format. For example, to convert an image from a BMP to a PNG, read the BMP image using imread, convert the storage class if necessary, and then write the image using imwrite, with 'PNG' specified as your target format. bitmap = imread('image4.BMP','bmp'); imwrite(bitmap,'image4.png','png');

Image Arithmetic

Image arithmetic is the implementation of standard arithmetic operations, such as addition, subtraction, multiplication, and division, on images. Image arithmetic has many uses in image processing both as a preliminary step and in more complex operations. For example, image subtraction can be used to detect differences between two or more images of the same scene or object.

Adding Images To add two images or add a constant value to an image, use the imadd function. imadd adds the value of each pixel in one of the input images with the corresponding pixel in the other input image and returns the sum in the

Figure 5. Image multiplied by an integer 3

corresponding pixel of the output image. Image addition has many uses in image processing. For example, the following code fragment uses addition to superimpose one image on top of another. The images must be of the same size and class. I = imread('image3.JPG'); J = imread('image4.JPG'); K = imadd(I,J); imshow(K)

Added image is shown in Figure 4. In this figure LISS III bands 3 and 4 (i.e., Red band and NIR bands) are added. One can also use addition to brighten an image by adding a constant value to each pixel. For example, the following code brightens image4.JPG. I = imread('image4.JPG'); J = imadd(I,50);

Subtracting Images To subtract one image from another, or subtract a constant value from an image, use the imsubtract function. imsubtract subtracts each pixel value in one of the input images from the corresponding pixel in the other input image and returns the result in the corresponding pixel in an output image. X= imread('image5.JPG'); J= imread('image4.JPG'); K= imsubtract(X,J);

Multiplying Images To multiply two images, use the immultiply function. immultiply does an element-by-element multiplication of each corresponding pixel in a pair of input images and returns the product of these multiplications in the corresponding pixel in an output image. Image multiplication by a constant, referred to as scaling, is a common image processing operation. When used with a scaling factor greater than one, scaling brightens an image; a factor less than one darkens an image. Scaling generally produces a much more natural brightening/ darkening effect than simply adding an offset to the pixels, since it preserves the relative contrast of the image better.

For example, the code below scales an image by a constant factor. I = imread('image4.JPG'); J = immultiply(I,3.0); figure, imshow(J);

Dividing Images To divide two images, use the imdivide function. The imdivide function does an element-by-element division of each corresponding pixel in a pair of input images. The

immultiply function returns the result in the corresponding pixel in an output image. Image division, like image subtraction, can be used to detect changes in two

Figure 8. Image rotated by 35 degrees

Using imresize, one can also specify the actual size of the output image. The command below creates an output image of size 100-by-150. Y = imresize(X,[100 150])

Image Rotation To rotate an image, the imrotate function can be used. imrotate accepts two primary arguments viz., (i) The image to be rotated and (ii) The rotation angle. The rotation angle should be specified in degrees. For a positive value, imrotate rotates the image counterclockwise; and for a negative value, imrotate rotates the image clockwise. For example, these commands rotate an image 35 degrees counterclockwise (Fig. 8). F = imread('image5.JPG'); J = imrotate(I,35,'bilinear'); figure, imshow(J)

Image Cropping

To extract a rectangular portion of an image, the imcrop function can be used. imcrop accepts two primary arguments viz., (i) The image to be cropped and (ii) The coordinates of a rectangle that defines the crop area.

If imcrop is called without specifying the crop rectangle, the cursor changes to a cross hair when it is over the image. Click on one corner of the region to be selected and while holding down the mouse button, drag across the image. imcrop draws a rectangle around the selected area. When the mouse button is released, imcrop creates a new image from the selected region.

Analyzing and Enhancing Images

The Image Processing Toolbox supports a range of standard image processing operations for analyzing and enhancing images. Its functions simplify several categories of tasks, including:

  • Obtaining pixel values and statistics, which are numerical summaries of data in an image.
  • Analyzing images to extract information about their essential structure.
  • Enhancing images to make certain features easier to see or to reduce noise.

Pixel Selection The toolbox includes two functions that provide information about the color data values of image pixels specified. The pixval function interactively displays the data values for pixels as the cursor is moved over the image. pixval can also display the Euclidean distance between two pixels. The impixel function returns the data values for a selected pixel or set of pixels. You can supply the coordinates of the pixels as input arguments, or you can select pixels using a mouse.

Figure 9. Contour plot of an Image

imshow image4.JPG vals = impixel

Summary Statistics One can compute standard statistics of an image using the mean2, std2, and corr2 functions. mean2 and std2 compute the mean and standard deviation of the elements of a matrix. corr computes the correlation coefficient between two matrices of the same size.

Image Contours One can use the toolbox function imcontour to display a contour plot of the data in an intensity image. This function is similar to the contour function in MATLAB, but it automatically sets up the axes so their orientation and aspect ratio match the image. This example displays a contour plot of the image5.JPG as shown in Figure 9.

I = imread('image5.JPG'); figure, imcontour(I)

Image Analysis

Image analysis techniques return information about the structure of an image.

Edge Detection One can use the edge function to detect edges, which are those places in an image that correspond to object boundaries. To find edges, this function looks for places in the image where the intensity changes rapidly, using one of these two criteria:

  1. Places where the first derivative of the intensity is larger in magnitude than some threshold
  2. Places where the second derivative of the intensity with a zero crossing edge provides a number of derivative estimators, each of which implements one of the above definitions. For some of these estimators, it can be specified whether the operation should be sensitive to horizontal or vertical edges, or both. edge returns a binary image containing 1's where edges are found and 0's elsewhere. The most powerful edge-detection method that edge provides is the Canny method. The Canny method differs from the other edge-detection methods in that it uses two different

To use imadjust , one must typically perform two steps:

  1. View the histogram of the image to determine the intensity value limits.
  2. Specify these limits as a fraction between 0.0 and 1.0 so that you can pass them to imadjust in the [low_in high_in] vector.

MATLAB image processing tool box has many more capabilities and only a small portion of them is explained in this article.