Loading [MathJax]/jax/output/CommonHTML/jax.js
ImageDev

Area2d

Computes the area of foreground pixels in a two-dimensional binary image.

Access to parameter description

For an introduction: section Image Analysis.

In the continuous, or theoretical, case, area is defined as: A(x)=R2dxdy In the discrete, or actual, case, area is approximated by the number of pixels in X: A(x)=i,jg(xi,yj) where:
g(xi,yj)=1 if the pixel lies within the object Xg(xi,yj)=0 otherwise The area measurement can be weighted by a size factor which characterizes the area of a single pixel. This information is given by the calibration spacing of the input image. If this image peoperty is correctly filled, the measurement is physically homogeneous to the area.

This algorithm can be applied on a binary image and returns: See also
See related example

Function Syntax

This function returns outputMeasurement.
// Function prototype
Area2dMsr::Ptr area2d( std::shared_ptr< iolink::ImageView > inputBinaryImage, Area2dMsr::Ptr outputMeasurement = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The 2D binary input image. Image Binary nullptr
output
outputMeasurement
The output measurement results. Area2dMsr nullptr

Object Examples

auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" );

Area2d area2dAlgo;
area2dAlgo.setInputBinaryImage( polystyrene_sep );
area2dAlgo.execute();

std::cout << "area: " << area2dAlgo.outputMeasurement()->area( 0 ) ;

Function Examples

auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" );

auto result = area2d( polystyrene_sep );

std::cout << "area: " << result->area( 0 ) ;