IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Hough circles label 2d image
imagehoughCircles2dLabelImg (spheresPpties,inImg)
imagehoughCircles2dLabelImg (pISpheresPpties,inImg)

Detailed Description

Creates a label image from 2D circles detected with te 2D Hough detection algorithm.

This algorithms creates a label image representing the circles detected by the result of Hough circles detection. In the case of automatically allocated output image, IPSDK needs to know the size of the ouput image and the image used to calculate the circles properties in Hough circles detection must also be specified.

If two circles intersect each other, the label calculated according to the interface between the two circles.

The output image pixels intensities are CircleIndex + 1 for pixels inside the circle and 0 otherwise, where CircleIndex is the circle index in the result of Hough circles detection.

Here is a slice of an image and the result of the algorithm application :

houghCircles2dLabelImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFeatureDetection as fd

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# radius range detection definition
radiusRange = PyIPSDK.createHoughCirclesRadiusRange(10, 25)
# hough circle detection computation
outCircles = fd.houghCircles2d(inImg, radiusRange)
# compute the label image
outImg = fd.houghCircles2dLabelImg(outCircles, inImg)

Example of C++ code :

Example informations

Header file

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

Code Example

// Load the input image
ImagePtr pInImg = loadTiffImageFile(inputPath);
// Detect the spheres
HoughCircles2dPptiesPtr pCircles = houghCircles2d(pInImg, pHoughRange);
ImagePtr pOutImg = houghCircles2dLabelImg(pCircles, pInImg);