hough | Line detection using Hough transform |
-in <image> | input image |
-out <image> | line image |
[-tmp <image>] | parameter space |
[-vdata <nodes> ] | output graph nodes |
[-edata <arcs> ] | output graph arcs |
[-r <rdim> ] | radius dimension |
[-t <tdim> ] | angle dimension |
[-l <llength> ] | minimum length for drawn lines |
[-h <hthresh> ] | minimum height for peaks in the parameter space |
[-hrad <radius> ] | size of area where only one peak is accepted |
Command hough detects lines from image using Hough transform. Input image should be black image where edge areas are marked with white. Output is image where detected lines are drawn. Lines are also stored in graph form if -vdata and -edata are specified. Other parametres allow user to change size of the parameter space and the way of finding the peaks in the parameter space.
Example: Following commands load an image and detect lines. The result is shown.
... # Load image and convert it NDA> loadimg lenna.gif img_in NDA> cnvimg -in img_in -out img_gray -gray # Find edges NDA> grad -in img_gray -out img_edge -tmp img_tmp -mask s \ -thresper 15 # Find lines NDA> hough -in img_edge -out img_lines -l 8 -h 40 -hrad 7 # Show the result NDA> mkgrp g NDA> bgimg g -img img_lines NDA> show g