IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Computation of accumulator matrix for Hough lines detection
image = houghLines2dImg (inGreyImg2d)
image = houghLines2dImg (inGreyImg2d,houghLinesImgParams)

Detailed Description

computes the accumulator matrix used by the Hough lines detector

This algorithm computes, from a grey levels 2d image, the accumulation matrix used to detect straight lines in the input image, using Hough transform.

See HoughLines2d for more information

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFeatureDetection as fd
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# Initialize parameters for Hough lines accumulation matrix construction:
# - step for rho = 1
rhoStep = 2.0
# - range of 15 evenly spaced orientations between pi/2 and 3.pi/4 radians
thetaRange = PyIPSDK.createEvenlySpacedRange(math.pi/2, 3*math.pi/4, 15)
# only accumulate pixels of input image with intensity greater than 210
intensityThreshold = 210.0
imgParams = PyIPSDK.createHoughLinesImgParams(
rhoStep, thetaRange, intensityThreshold)
# hough circle detection computation
outImg = fd.houghLines2dImg(inImg, imgParams)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLFeatureDetection/Processor/HoughLines2dImg/HoughLines2dImg.h>

Code Example

ImageConstPtr pInImg = loadTiffImageFile(inImgPath);
// Initialize parameters for Hough lines accumulation matrix construction:
// - step for rho = 1
const ipReal64 rhoStep = 1.0;
// - range of 15 evenly spaced orientations between pi/2 and 3.pi/4 radians
const EvenlySpacedRange& thetaRange = *createEvenlySpacedRange(
M_PI / 2, 3 * M_PI / 4, 15);
// only accumulate pixels of input image with intensity greater than 10
const ipReal32 intensityThreshold = 10.0f;
rhoStep, thetaRange, intensityThreshold);
// launch Hough lines detection algorithm
const ImageConstPtr pOutImg = houghLines2dImg(pInImg, pInHoughImgPrms);