CSIT 5410 Assignment 2 solution

$29.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

Overview
This assignment consists of two sections: programming section and written section. Both
sections should be submitted via the Canvas system.
In the programming section, you need to finish two tasks. The skeleton code is prepared in
MATLAB and can be obtained from CANVAS. You need to complete the missing
implementations in the corresponding M-files.
In the written section, you need to answer one question about image registration. If you would
like to finish the written assignment with handwriting, you may scan and upload it.
You must compress all your files with the following filename format: [your 8-digit student
ID]_assign2.zip, e.g.: 12345678_assign2.zip, into one file. Your compressed file should
include: (1) All M-files and input images related to the programming section, (2) a PDF file
for the written section, and (3) a README.txt file indicating the programming software
(Octave/MATLAB) that you are using for this assignment.
If your compressed file has been submitted multiple times before the due date (including late
submission date), the newer version will replace the old version in marking.
Programming section (70%)
M-file: csit5410_assign2
The routine csit5410_assign2 calls two functions: hough_transform and myfld. This routine
completes the following two tasks:
Task 1: Hough Transform for Line Detection
Task 2: Fisher Linear Discriminant
You are not allowed to modify the csit5410_assign2.m file.
2
(Task 1) Function: hough_transform
There is a piece of target A4 paper in each input image. Your task is to detect and plot the four
sides of the target A4 paper by Hough transform. A framework for this task is provided:
a) Pre-processing: Perform denoising on the input image.
b) Edge extraction: You can use any operators based on what you have learned in this
course.
c) Hough transform: Use Hough transform to find four straight lines that segment the A4
paper. You CANNOT use the built-in functions related to Hough transform (e.g.,
Hough, Houghpeaks, Houghlines, etc.).
d) Output: Plot the four sides of the A4 paper. You need to draw the green lines with
LineWidth =2 on top of the input images.
The function prototype is given in the hough_transform.m file. You can modify this M-file if
the provided skeleton code does not fit your implementation. There are 3 input images in total.
You are supposed to show all 3 output figures for Task 1 when you run the command “>>
csit5410_assign2” in the MATLAB environment.
A sample output figure is provided as follows:
3
(Task 2) Function: myfld
The function myfld classifies an input sample into either class 1 or class 2, from samples of
class 1 (class1_samples) and samples of class 2 (class2_samples). Detailed descriptions
regarding the input parameters, output parameters and program requirements can be found in
the myfld.m file. You CANNOT use the built-in functions related to Fisher Linear
Discriminant (e.g., ClassificationDiscriminant, CLASSIFY, eval, mahal, etc.).
You are supposed to obtain the following output for Task 2 when you run the command “>>
csit5410_assign2” in the MATLAB environment:
The above sample output is for the input data in fld_routine.m. Your function myfld should be
flexible to any class 1 and class 2 input data (i.e., different dimension and number of data
point).
4
Written section (30%)
Spatial Transformation and Gray-level Assignment
There is an image I shown as follows. The transformation is defined as 𝑇(𝑥⃗) ≡ 𝑆⃡𝑥⃗, where 𝑆⃡ =
(
𝑎 𝑏
𝑐 𝑑
) and 𝑥⃗ = (
𝑥
𝑦
). After the transformation using 𝑇, point A, B, C and D are transformed
to point E, F, G and H respectively. Find the transformation matrix 𝑆⃡.
Answer:
Image I
Image I’
x
y
5
Suppose the intensity values of point I, K, L and M are 4, 10, 18 and 30 respectively.
Find the intensity value of point J using Bilinear Interpolation.
Hint: Bilinear Interpolation: 𝑔(𝑥, 𝑦) = 𝑎𝑥 + 𝑏𝑦 + 𝑐𝑥𝑦 + 𝑑, where a, b, c and d are
coefficients.
Answer:
~~ End of Assignment 2 ~~
Image I’
Image I
x
y