HW3

Due on April 3

  1. You are asked to implement Harris corner detector from scratch in this problem

    1. (10 points) Compute the cornerness score \(C = det(M)-\alpha tr(M)^2 = g(I_x\circ I_x) g(I_y\circ I_y) - g(Ix \circ I_y)^2 -\alpha [g(I_x\circ I_x)+g(I_y\circ I_y)]^2\) for every pixel of the input image. You can assume \(\alpha = 0.04\).

    2. (5 points) Display your result by marking any pixel with cornerness score larger than a threshold in red. Please use \(0.1 C_{max}\) as the threshold.

    3. (Extra credit/10 points) Implement non-maximum supression to keep only local maximum for your detected corner pixels. Display your result again.

  2. In this problem, you will implement functions to stitch two images. Please download the assignment from this git repository

    1. (10 points) The homography to warp the first image to align with the second image is given. You are asked to implement a function to stitch the two images given the homography. That is, implement a function that warps img1 by h1 and img2 by h2 and then blend the resulting images together.

    2. (Extra credit/5 points) Implement a method to determine the size of the stitch image and output a translation matrix if shift is needed.

    3. (10 points) Implement (from first principle) to compute homography to warp given matched points. Note that you will only get half of the points if you use cv2.findhomography. Please use your own images to test your implementation.

    4. (Extra credit/5 points) Implement RANSAC to improve your homography estimate.

  3. This problem is related to Hough transform.

    1. (5 points) To detect lines, please convert a preprocessed (edge detected) image with everywhere zeros except \((80,100)\) and \((100,200)\) to the \((\rho,\theta)\)-Hough space with \(\rho = x \cos \theta + y \sin \theta\). Display the Hough transform of the image.

    2. (2 points) Find the detected “line” from your Hough transform (parameters with the largest response)

    3. (5 points) To detect circles, convert the same image above into the \((a,b)\)-Hough space with \((x-a)^2+(y-b)^2=10000\)

    4. (2 points) Find the detected “circle” from your Hough transform

    5. (1 point) What is the radius of the detected circle

  • Please convert any jupyter notebooks into pdf before submission. Please make sure your code is legible.