View on GitHub

hough_lines_and_circles_detection

A program to detect lines, circles, or both from a USB camera stream using Hough detection method.

Hough Lines and Circles Detection

A program to detect lines, circles, or both from a USB camera stream using Hough detection method.

Requirments

  1. OpenCV 4.1.1
  2. Linux OS (tested with JetPack 4.6 on Jetson Nano 2GB)
  3. USB Camera

Build and run

The program can be built using the included Makefile. image

Example

  1. Launching the executable and showing the camera stream as-is:
    1. Upon launching the program, you should see a window with the camera feed as-is (no filtering or processing).
    2. The program should also print the possible options and runtime controls to switch on-the-fly. image
  2. Enabling Hough Line detection:
    1. As stated in the message displayed in the terminal, pressing ‘l’ (lower case L) key will enable the Hough Line detection on the current camera stream.
    2. Notice how the size lines (shown in gold of my two-wheeled bot, along with the break-out PCB (mounted on top of the blue plate) have been detected. However, the blue plate itself is not, that’s due to the wheel being in the way of the line. image
  3. Enabling Hough Circle detection:
    1. Now, by pressing ‘c’ (lower case C) key, we can switch to the Hough Circle detection and disable any other detection methods that may be enabled.
    2. Notice how the wheel of my two-wheeled bot was detected as a circle. image
  4. Enabling both Hough line and circle:
    1. Now, by pressing ‘b’ (lower case B) key, we can enable both the Hough Line and Circle detection at the same time on the same frame.
    2. Notice how both the lines and the wheel shown discussed in previous sections above are detected at the same time. image