alexlouden / hough-transform

Repository from Github https://github.comalexlouden/hough-transformRepository from Github https://github.comalexlouden/hough-transform

Hough transform exploration

A jupyter notebook that implements the Hough transform from scratch, and allows exporting the Hough accumulator image.

For example, if we take the following input image:

Input image

We perform a gaussian blur and Canny edge detection to find the edges:

Edges

We run the Hough transform, and preview the accumulator:

Hough transform accumulator

We then threshold this and detect the peaks:

Accumulator peaks

We can convert these points from rho/theta to cartesian line coordinates, and plot them on our input image:

Output


Development

You can run this up in a single command using my python-opencv-notebook docker image:

  1. Run docker image
docker run --interactive --tty --init --rm --name opencv-notebook --publish 8888:8888 --volume `pwd`/data:/app/data alexlouden/python-opencv-notebook
  1. Open localhost:8888 URL output by the previous command

About


Languages

Language:Jupyter Notebook 100.0%