COSC$4393/6380$
Digital$Image$Processing$
Department$of$Computer$Science$
University$of$Houston$
Assignment$#3$
Due:$12/07/08!
1. Write a program to detect lines in an image using the Hough Transform. Use the
polar parameterization of a line for your implementation. Discretize your
parameter space to have 181 (-90 to +90 degrees) angles and 725 (256 * 1.414 + 1
(for images of size 256 x 256)) distances. Input to your program should be an
edge image and the number of lines to be detected. Use!a!simple!gradient‐based!
edge! detector,! such! as! Sobel, to generate the edge image. The output of your
program should be an image of the transform space and your original image with
the lines superimposed.
Your program should prevent lines that are too similar to each other from being
detected, i.e., you should not allow points to be selected in the shape space that
are tool close to each other. Set a threshold for the minimum allowable distance
between shape points that your program selects in the shape space. This can be
hard coded in your program. For example, if your threshold is 10, you would not
be able to select points in the shape space that were close than 10 accumulator
spaces.
Test your program on the following images:
hw3_1.gif
hw3_2.gif
hw3_3.gif
hw3_4.gif
2. Write! a! program! to! detect! circles! in! a! grayscale! image! using! the! Hough!
Transform.!!In!this!case,! use!the!parameterized!equation!for! a!circle!for!your!
implementation.! ! In! order! to! detect! circles! in! a! grayscale! image,! you! first!
need!to!detect!the!edges.!!Use!a!simple!gradient‐based!edge!detector,!such!as!
Sobel,! and! perform! edge! thinning! after! the! edge! detector! operation.! ! Your!
program! should! take! in! four! parameters;! the! grayscale! image,! minimum!
circle! radius,! maximum! circle! radius,! and! the! number! of! circles! to! be!
detected.!
!
The!output!of your program should be an image of the transform space and your
original image with the detected circles superimposed.
Test your program on the following image:
hw3_5.jpg