1. Homepage
  2. Programming
  3. COMP 4102A Computer Vision: Assignment 1: SVD, Edge Detection and Sticks filter

COMP 4102A Computer Vision: Assignment 1: SVD, Edge Detection and Sticks filter

Engage in a Conversation
CarletonCOMP 4102AComputer VisionEdge detectionSticks filterC++PythonOpenCV

COMP 4102A: Assignment 1 CourseNana.COM

Instructions for submission: Please submit a PDF with your solutions on theory questions. The PDF should explain your work. For coding questions you may use C/C++ and OpenCV or Python with OpenCV Python for this assignment. Comment your code to make it easier to grade. Include your codes for edge detection in a folder. Submit a single zip file that contains: 1 - PDF with your answers to question 1; 2 - folder containing edge detection code, images, and readme file that explains how to run your code; 2 - folder containing your sticks filtering code, images, and readme file that explains how to run your code. Please submit through Brightspace. You are expected to work on the assignment individually. Do not leave your submission to the last minute because if you run into technical issues the system will cut you off. You can submit multiple versions of your assignment, and we will grade the latest one. CourseNana.COM

(30 points) Theory questions CourseNana.COM

(5 points) Are three dimensional rotations expressed as Rx, followed by Ry, and then Rz (rotations around the x, y and z axis) commutative? That is, does the order in which they are applied matter. Explain the answer. CourseNana.COM

T 2 2 0 (8points)FindtheSVDofA,UΣV ,whereA= 1 1 0 CourseNana.COM

Hint: first find AT A, then find λ by solving det(AT A λI) = 0. Look at this example to find out how to calculate the U and V : https://www.d.umn.edu/~mhampton/m4326svd_example.pdf CourseNana.COM

(4 points) Scale a vector [x y]T in the plane can be achieved by x= sx and y= sy where s is a scalar.
(a) Write out the matrix form of this transformation.
(b) Write out the transformation matrix for homogeneous coordinates.
CourseNana.COM

(c) If the transformation also includes a translation
x= sx + tx and y= sy + ty
Write out the transformation matrix for homogeneous coordinates.
(d) What is the equivalent of the above matrix for three-dimensional vectors?
CourseNana.COM

(5 points) Find the least square solution x for Ax = b if 20 1 CourseNana.COM

A=1 1,b=002 1 CourseNana.COM

Verify that the error vector b -Ax is orthogonal to the columns of A.
Matrix
K is a discrete, separable 2D filter kernel of size k × k. Assume k is an odd number. After CourseNana.COM

applying filter K on an image I, we get a resulting image IK. CourseNana.COM

(a) (3 points) Given an image point (x,y), find its value in the resulting image, IK(x,y). Express your answer in terms of I, k, K, x and y. You don’t need to consider the case when (x, y) is near the image boundary. CourseNana.COM

(b) (5 points) One property of this separable kernel matrix K is that it can be expressed as the product of two vectors g Rk×1 and h R1×k, which can also be regarded as two 1D filter kernels. In other words, K = gh. The resulting image we get by first applying g and then applying h to the image I is Igh. Show that IK = Igh. CourseNana.COM

2 (35 points) Edge detection CourseNana.COM

Write a function that finds edge intensity and orientation in an image. Display the output of your function for one of the given images in the handout. CourseNana.COM

function[img1] = myEdgeFilter(img0,sigma) (1) CourseNana.COM

The function will input a greyscale image (img0) and scalar (sigma). sigma is the standard deviation of the Gaussian smoothing kernel to be used before edge detection. The function will output img1, the edge magnitude image. CourseNana.COM

First, use your convolution function to smooth out the image with the specified Gaussian kernel. This helps reduce noise and spurious fine edges in the image. The size of the Gaussian filter should depend on sigma (e.g., hsize = 2 * ceil(3 * sigma) + 1). CourseNana.COM

The edge magnitude image img1 can be calculated from image gradients in the x direction and y direction. To find the image gradient imgx in the x direction, convolve the smoothed image with the x-oriented Sobel filter. Similarly, find image gradient imgy in the y direction by convolving the smoothed image with the y-oriented Sobel filter. You can also output imgx and imgy if needed. CourseNana.COM

In many cases, the high gradient magnitude region along an edge will be quite thick. For finding lines its best to have edges that are a single pixel wide. Towards this end, make your edge filter implement non-maximum suppression, that is for each pixel look at the two neighboring pixels along the gradient direction and if either of those pixels has a larger gradient magnitude then set the edge magnitude at the center pixel to zero. Map the gradient angle to the closest of 4 cases, where the line is sloped at almost 0o,45o,90o, and 135o. For example, 30o would map to 45o. Please refer to the slides on non-maximum suppression for more details. You do not need to do hysteresis thresholding, but use a simple thresholding. CourseNana.COM

Your code cannot call on OpenCV edge function, or any other similar functions. You may use the edge detection from library just for comparison and debugging. CourseNana.COM

Submission CourseNana.COM

All results should be in a folder called Edge detection. You can use your own images and you should include the original image in the folder if you use your own. Submit your code with the edge detection result after non-maximum suppression, the gradient magnitude image and the gradient orientation image. Include your result from sticks filtering to this folder. Your code should have comments for each function and clear variables. CourseNana.COM

CourseNana.COM

3 (35 points) Sticks filter CourseNana.COM

To enhance thin and connected line structures, we can use the sticks filter1, originally designed to reduce speckle noise and preserve linear structures. Sticks filtering uses the maximum result from the m oriented filters as the output for the current pixel. Use the maximum response to decide what to do at the central pixel. Compute the difference among all the directions around the region. The chosen orientation, with maximum difference in intensity from the region, aligns with the locally strongest feature. The intensity should be increased along the direction of maximum response, amplifying local tonal differences. CourseNana.COM

You can create a sticks map T(x,y) using equation 1: CourseNana.COM

Figure 1: Rasterization of a set of discrete directions, representing 8 line orientations (length n = 5) CourseNana.COM

The sticks direction T(x,y) determines the maximal contrast response, defined as the maximum differ- ˆ CourseNana.COM

ence between the average intensity μ(si) of a stick and the average intensity In(x,y) of the neighboring pixels. Parameter n is the length of each stick; there are i sticks. Apply sticks filtering on gradient magnitude image, using n = 5 for i = 8 sticks orientations to enhance the edge segments before applying non-maxima suppression. CourseNana.COM

Submission CourseNana.COM

Show the effect of your sticks filtering on your gradient magnitude image. Show the results of the edge detection after applying the sticks filtering on the gradient magnitude. Note that you need to write a function that creates the kernels of the sticks filter. You can use filter2D function in OpenCV for convolution of the sticks filter kernels. CourseNana.COM

1Line And Boundary Detection In Speckle Images (1997)
CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Carleton代写,COMP 4102A代写,Computer Vision代写,Edge detection代写,Sticks filter代写,C++代写,Python代写,OpenCV代写,Carleton代编,COMP 4102A代编,Computer Vision代编,Edge detection代编,Sticks filter代编,C++代编,Python代编,OpenCV代编,Carleton代考,COMP 4102A代考,Computer Vision代考,Edge detection代考,Sticks filter代考,C++代考,Python代考,OpenCV代考,Carletonhelp,COMP 4102Ahelp,Computer Visionhelp,Edge detectionhelp,Sticks filterhelp,C++help,Pythonhelp,OpenCVhelp,Carleton作业代写,COMP 4102A作业代写,Computer Vision作业代写,Edge detection作业代写,Sticks filter作业代写,C++作业代写,Python作业代写,OpenCV作业代写,Carleton编程代写,COMP 4102A编程代写,Computer Vision编程代写,Edge detection编程代写,Sticks filter编程代写,C++编程代写,Python编程代写,OpenCV编程代写,Carletonprogramming help,COMP 4102Aprogramming help,Computer Visionprogramming help,Edge detectionprogramming help,Sticks filterprogramming help,C++programming help,Pythonprogramming help,OpenCVprogramming help,Carletonassignment help,COMP 4102Aassignment help,Computer Visionassignment help,Edge detectionassignment help,Sticks filterassignment help,C++assignment help,Pythonassignment help,OpenCVassignment help,Carletonsolution,COMP 4102Asolution,Computer Visionsolution,Edge detectionsolution,Sticks filtersolution,C++solution,Pythonsolution,OpenCVsolution,