Image Processing Toolbox User's Guide Previous page   Next Page
houghpeaks

Identify peaks in the Hough transform

Syntax

Description

peaks = houghpeaks(H,numpeaks) locates peaks in the Hough transform matrix, H, generated by the hough function. numpeaks specifies the maximum number of peaks to identify.

The function returns peaks, a Q-by-2 matrix, where Q can range from 0 to numpeaks. Q holds the row and column coordinates of the peaks. If numpeaks is omitted, it defaults to 1.

peaks = houghpeaks(...,param1,val1,param2,val2) specifies parameter/value pairs, listed in the following table. Parameter names can be abbreviated, and case does not matter.

Parameter
Description
'Threshold'

Nonnegative scalar value that specifies the threshold at which values of H are considered to be peaks. Threshold can vary from 0 to Inf. Default is 0.5*max(H(:)).

'NHoodSize'

Two-element vector of positive odd integers: [M N]. 'NHoodSize' specifies the size of the suppression neighborhood. This is the neighborhood around each peak that is set to zero after the peak is identified. Default: smallest odd values greater than or equal to size(H)/50.

Class Support

H is the output of the hough function. numpeaks is a positive integer scalar.

Example

Locate and display two peaks in the Hough transform of the rotated circuit.tif image.

See also

hough, houghlines


Previous page  houghlines hsv2rgb Next page

© 1994-2005 The MathWorks, Inc.