Upload
atiqa-khan
View
161
Download
0
Tags:
Embed Size (px)
DESCRIPTION
MATLAB problems
Citation preview
5/31/2014
Assignment - 05
Using MATLAB
Submitted To: Sir. Imran Ali Memon
Subject: Geo-Informatics
Submitted By: Atiqa Ijaz Khan
Roll No: Geol-02
MPhil Geomatics
Institute of Geology, university of the Punjab
Page 1 of 13
ASSIGNMENT - 05
Question.1:
Differentiate the following Matlab commands with example and write shortly about
their application and characteristics.
1. Imshow
It is used to display an image. It tried to fit the image onto the screen. But if is too large
it shows a warning message. It scales an image by using interpolation to re-fit for display.
One can show two images on a same figure plot by ‘imshow’. In comparison to
‘imtool’, ‘imshow’ dose not display automatic pixel values at the bottom.
‘Imshow’ can display images by passing:
Image URL, if not in the current folder,
Complete image name if in the current folder, and,
Variable name in which image is stored previously.
2. Geoshow
It projects and displays the latitude and longitude vectors using projection stored in the
axes. Of not, then it display in the default Plate Carree projection.
To use ‘geoshow’, function ‘shaperead’ must include ‘‘UseGeoCoords’, true’. Otherwise
it will create a mapstruct, with X and Y, without lat and long.
It can go with: points, multipoints, lines, and, polygons
Not a current
folder
Stored in
Workspace
Page 2 of 13
ASSIGNMENT - 05
Displays the lat and long instead
of XY
Page 3 of 13
ASSIGNMENT - 05
Page 4 of 13
ASSIGNMENT - 05
3. Mapshow
It display map coordinate xy vectors. The default is to show in lines. If use ‘geoshow’
instead, it will show a warning message in the command window. But displays the
image using ‘mapshow’
XY instead of
lat and long
Page 5 of 13
ASSIGNMENT - 05
Question No.2:
The edge command is used to find edges in intensity image. Use this command on a
image with different parameters and edge techniques. Write down about the differences
and application of all variants of edge command.
Edge detection is an image processing technique for finding the boundaries of objects
within images. It works by detecting discontinuities in brightness. Edge detection is used
for image segmentation and data extraction in areas such as image processing, computer
vision, and machine vision. It let you identify object boundaries in an image.
Common edge detection algorithms include Sobel, Canny, Prewitt, and Roberts
methods.
1st Method (General Syntax):
>> D = imread('D.jpg');
>> G = rgb2gray(D);
>> E = edge(G);
Page 6 of 13
ASSIGNMENT - 05
2nd
Method (Sobel):
>> E = edge(I, 'sobel');
>> imshow(E)
It returns those points where gradient of image is maximum.
By default, ‘edge’ uses the technique ‘sobel’ to detect the edges of an image. It will
display edges for a binary image and gray image. But no for 3D images like, rgb.
3rd Method (Prewitt):
>> E = edge(I, 'prewitt');
>> imshow(E)
4th Method (Roberts):
>> E = edge(I, 'roberts');
>> imshow(E)
Page 7 of 13
ASSIGNMENT - 05
5th Method (Laplacian of ):
>> E = edge(I, 'log');
>> imshow(E)
6th Method (Zero-cross):
>> E = edge(I, 'zerocross');
Page 8 of 13
ASSIGNMENT - 05
>> imshow(E)
7th Method (Canny):
>> E = edge(I, 'canny');
>> imshow(E)
Page 9 of 13
ASSIGNMENT - 05
Sr.
No Algorithms Methods Merits De-merits
01. Sobel Uses 3*3 mask,
separately on x-y axis
Most common 1st
order, simple Sensitive to noise.
02. Prewitt
It’s done by
averaging filter and
1st order
differentiation
Simple 1st order
technique
Less accurate,
sensitive to noise.
03. Roberts
Perform 2*2 mask on
2D spatial gradient
measurement on an
image
Basic 1st order
technique,
Sensitive to noise,
not for 3D images.
04.
LoG
(Laplacian
of
Gaussian)
Use 3*3 mask with
central value to be
+ve, while all other
are –ve, so to have
the sum = 0. Applied
on 2D isotropic
measurements of 2nd
derivative.
Test wide area
around pixels, find
correct places of
edges, highlights
the region of rapid
intensity changes,
and show dark
and white line
along the BLOB.
Not good at curves
and corners, for
good results apply
it to already
smoothen images,
and is independent
of directions.
05. Canny
Use Gaussian filter,
to find out the
maxima threshold
(white), and non-
maxima (black),
incorporating the
directions.
Most Better
powerful,
detection in noise
conditions,
Complex
computations.
Edge Detection Algorithms
Classical-Directional (1st Order)
Sobel Prewitt Roberts
Zero-
crossing
Laplacian
2nd
Directioanl
Derivative
LoG Gaussian
CannyShen_Cast
an
Page 10 of 13
ASSIGNMENT - 05
Question No.3:
What is world file. Write its extensions and structure of the file, the command to read
and write a world file in Matlab.
A world file is a plain text computer data file used by geographic information
systems to geo-reference raster map images. The file specification was introduced by
ESRI.
The world file adds extension of ‘w’ with the normal used extensions, like tif to tfw.
World files do not specify a coordinate system; this information is generally stored
somewhere else in the raster file itself or in another companion file. The generic
meaning of world file parameters are:
Line 1: A: pixel size in the x-direction in map units/pixel.
Line 2: D: rotation about y-axis.
Line 3: B: rotation about x-axis.
Line 4: E: pixel size in the y-direction in map units, almost always negative.
Line 5: C: x-coordinate of the center of the upper left pixel.
Line 6: F: y-coordinate of the center of the upper left pixel.
A better description of the A, D, B and E parameters would be:
Line 1: A: x component of the pixel width.
Line 2: D: y component of the pixel width.
Line 3: B: x component of the pixel height.
Line 4: E: y component of the pixel height, almost always negative.
All four parameters are expressed in the map units depending on the coordinate system
associated with the raster.
World files describing a map on the Universal Transverse Mercator coordinate
system (UTM) use these conventions:
D and B are usually 0, since the image pixels are usually made to align with the
UTM grid
C is the UTM easting
F is the UTM northing
Units are always meters per pixel
The transformation parameters are stored in the world file in this order:
20.17541308822119 = A
0.00000000000000 = D
0.00000000000000 = B
-20.17541308822119 = E
Page 11 of 13
ASSIGNMENT - 05
424178.11472601280548=C
4313415.90726399607956 = F
If the base name follows the convention of ‘.3’ for extension, then skipped the middle
one to append ‘w’ for world-file extension, like ‘tif’ to ‘tfw’.
If now, then ‘w’ is appended to the full image extension name, like ‘jpeg’ to ‘jpegw’.
If does not contain any extension, then, ‘.wld’ is appended to the base image name.
WORLDFILEWRITE:
The general syntax is:
worldfilewrite (R, worldfilename.extw)
It requires a:
Map raster reference object
Geographic raster reference object
3-by-2 referencing matrix
Page 12 of 13
ASSIGNMENT - 05
WORLDFILEREAD:
The general syntax for ‘worldfileread’ is:
R = worldfileread (worldFileName, coordinatesystemtype, rastersize)
It will construct a spatial reference object. It can be:
Planar for projected coordinates, or,
Geographical for lat-long system.
This can be accessed by ‘coordinateSystemType’ string. The ‘raster-size’ should match
image size corresponding the world-file.
Page 13 of 13
ASSIGNMENT - 05
1. Chao, Yang. "A comparison of medical image analysis algorithms for edge
detection." 2010.
2. H.S. Bhadauria, Annapurna Singh, Anuj Kumar. "Comparison between Various
Edge Detection Methods on Satellite Images." Comparison between Various
Edge Detection Methods on 3, no. 6 (2013): 324-328.
3. Hao Yuan Kueh, Eugenio Marco, and Sivaraj Sivaramakrishnan. "Image analysis
for biology." n.d.
4. MapInfo Products Knowledge Base. n.d.
http://testdrive.mapinfo.com/TechSupp/MIProd.nsf/05edbd1e930f8d4d85257
12500748199/61409cb5b20c23f28525771a0054558a?OpenDocument
(accessed May 31, 2014).
5. MathWorks. "mathworks." Mapping Toolbox User Guide. n.d. (accessed May
2014).
6. Morris, Dr. Tim. Image Processing with MATLAB. n.d. (accessed May 2014).
7. Pushpajit A. Khaire & Dr. N. V. Thakur. "A Fuzzy Set Approach for Edge
Detection." International Journal of Image Processing 6, no. 6 (2012): 403-412.
8. Raman Maini & Dr. Himanshu Aggarwal. "Study and Comparison of Various
Image Edge Detection Techniques." International Journal of Image Processing 3,
no. 1 (n.d.).
9. Tauler, Romà. Mapping. n.d. (accessed May 2014).
10. Using ArcIMS 9.2 Understanding World File. n.d.
http://webhelp.esri.com/arcims/9.2/general/topics/author_world_files.htm
(accessed May 31, 2014).