Documentation Portal      

What are you looking for?

Image Statistics

////////////////////////////////////////////////////////////////////
// This code snippet shows how to compute basic image statistics. //
////////////////////////////////////////////////////////////////////
// Image constructor
EImageBW8 srcImage;
// ...
// Count the number of pixels above the threshold (128)
INT32 count;
EasyImage::Area(&srcImage, 128, count);
// Compute the pixels' average and standard deviation values
float stdDev, average;
EasyImage::PixelStdDev(&srcImage, stdDev, average);
// Compute the image gravity center (pixels above threshold)
float x, y;
EasyImage::GravityCenter(&srcImage, 128, x, y);
'////////////////////////////////////////////////////////////////////
'// This code snippet shows how to compute basic image statistics. //
'////////////////////////////////////////////////////////////////////
' EasyImage context constructor
Dim EasyImage As New EasyImage
' Image constructor
Dim srcImage As New EImageBW8
' ...
' Count the number of pixels above the threshold (128)
Dim count As Long
Dim threshold As EBW8
threshold.value = 128
EasyImage.Area srcImage, threshold, count
' Compute the pixels' average and standard deviation values
Dim stdDev As Single
Dim average As Single
EasyImage.PixelStdDev srcImage, stdDev, average
' Compute the image gravity center (pixels above threshold)
Dim x As Single
Dim y As Single
EasyImage.GravityCenter srcImage, 128, x, y
////////////////////////////////////////////////////////////////////
// This code snippet shows how to compute basic image statistics. //
////////////////////////////////////////////////////////////////////
// Image constructor
EImageBW8 srcImage= new EImageBW8();
// ...
// Count the number of pixels above the threshold (128)
int count;
EBW8 threshold = new EBW8(128);
EasyImage.Area(srcImage, threshold, out count);
// Compute the pixels' average and standard deviation values
float stdDev, average;
EasyImage.PixelStdDev(srcImage, out stdDev, out average);
// Compute the image gravity center (pixels above threshold)
float x, y;
EasyImage.GravityCenter(srcImage, 128, out x, out y);

See also in the Functional Guide

See also in the Reference

Area

GravityCenter

PixelStdDev

Which API shall we display?

© 2019 EURESYS s.a.  -  About Documentation  -  Open Source Licenses  -  Open eVision 2.10.0.1121