IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Computation of accumulator matrix for Hough lines detection

computes the accumulator matrix used by the Hough lines detector More...

IPSDKIPLFEATUREDETECTION_API image::ImagePtr ipsdk::imaproc::fd::houghLines2dImg (const image::ImageConstPtr &pInGreyImg2d)
 wrapper function for computation of accumulator matrix of regular Hough lines detector detector, from a grey-level input image More...
 
IPSDKIPLFEATUREDETECTION_API image::ImagePtr ipsdk::imaproc::fd::houghLines2dImg (const image::ImageConstPtr &pInGreyImg2d, const ipsdk::imaproc::attr::HoughLinesImgParamsConstPtr &pHoughLinesImgParams)
 wrapper function for computation of accumulator matrix of regular Hough lines detector detector, from a grey-level input image More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InGreyImg2d [Input] 2d grey levels image X
ipsdk::imaproc::attr::InOptHoughLinesImgParams [Input Optional] Parameters for Hough lines detection algorithm X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation customOutput (_pOutImg, outputHoughLines2dImg(_pInGreyImg2d,_pInOptHoughLinesImgParams))

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::customImageProperty (_pOutImg,
 ipsdk::imaproc::fd::houghLines2dCheckOutImgSzXEquals (_pInGreyImg2d,_pInOptHoughLinesImgParams)) && 
ipsdk::imaproc::customImageProperty (_pOutImg,
 ipsdk::imaproc::fd::houghLines2dCheckOutImgSzYEquals (_pInGreyImg2d,_pInOptHoughLinesImgParams)) && 
ipsdk::imaproc::customImageProperty (_pOutImg,
 ipsdk::imaproc::fd::houghLines2dCheckOutImgBufferType (_pInGreyImg2d)) && 
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_T,_pInGreyImg2d,_pOutImg) && 
ipsdk::imaproc::matchVolumeGeometryType (_pInGreyImg2d,_pOutImg) && 
ipsdk::imaproc::matchColorGeometryType (_pInGreyImg2d,_pOutImg) && 
ipsdk::imaproc::noInSitu (_pInGreyImg2d,_pOutImg)

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

Associated library

IPSDKIPLFeatureDetection

Header file

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);
See also
HoughLines2dImgLvl1
HoughLines2dImgLvl2
HoughLines2dImgLvl3

Function Documentation

◆ houghLines2dImg() [1/2]

IPSDKIPLFEATUREDETECTION_API image::ImagePtr ipsdk::imaproc::fd::houghLines2dImg ( const image::ImageConstPtr pInGreyImg2d)

wrapper function for computation of accumulator matrix of regular Hough lines detector detector, from a grey-level input image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ houghLines2dImg() [2/2]

IPSDKIPLFEATUREDETECTION_API image::ImagePtr ipsdk::imaproc::fd::houghLines2dImg ( const image::ImageConstPtr pInGreyImg2d,
const ipsdk::imaproc::attr::HoughLinesImgParamsConstPtr pHoughLinesImgParams 
)

wrapper function for computation of accumulator matrix of regular Hough lines detector detector, from a grey-level input image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure