Skip to main content

LH Computer Vision and Imaging - Lab 3

info

The lab sheet and files can be downloaded here

Introduction 介紹

In this lab exercise, you will look at applying an edge detector and using the built-in matlab hough transform to detect lines. 在本實驗練習中,您將了解如何應用邊緣檢測器並使用內置的 matlab 霍夫變換來檢測線條。

You are asked to write a short (no more than 2 pages) report of your work, answering specific questions, and showing example images. This work is not assessed (it will not count towards your module mark) but you will get formative feedback. 您被要求撰寫一份短報告(不超過 2 頁),回答特定問題並顯示示例圖像。 這項工作不會被評估(不會計入您的模塊成績),但您將獲得格式化的反饋。

STEP 1

  • Download the zip file and extract the .m script file and the data files (.jpg) for Lab from CANVAS and save them in your working directory 從 CANVAS 下載 zip 文件並提取 .m 腳本文件和實驗室數據文件 (.jpg),並將它們保存在您的工作目錄中
  • Use the matlab script Lab3.m, which has all the steps needed for line detection. 使用 matlab 腳本 Lab3.m,其中包含線檢測所需的所有步驟。

TASK 1

  • Work your way through the script file. Using the help function, understand how each function works, from edge detection, Hough Transform and line detection. Write a summary of how this algorithm works, particularly when finding the start/finish of a line. 完成腳本文件。使用幫助功能,了解每個功能的工作原理,從邊緣檢測、霍夫變換和線檢測。總結一下這個算法是如何工作的,特別是在找到一行的開始/結束時。

TASK 2

  • What is the effect of increasing/decreasing the required number of peaks in 'houghpeaks'? This is the second input variable on line 31 of Lab3.m 增加/減少"houghpeaks"中所需的峰數有什麼影響?這是 Lab3.m 第 31 行的第二個輸入變量

TASK 3

  • Replace the Canny Edge detector with other algorithms. Which one do you think performs best and why? 將 Canny 邊緣檢測器替換為其他算法。您認為哪一個表現最好,為什麼?