Difference between revisions of "Function:CountInRange"

From CUVI Wiki
Line 45: Line 45:


===Image Type Support===
===Image Type Support===
 
{|
|style="font-size:75%;"|
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 62: Line 63:
| 32fC3
| 32fC3
| CuviScalar
| CuviScalar
|}
|}
|}



Revision as of 18:29, 19 October 2022

Counts the number of pixels within the given intensity range

Function

CuviStatus countInRange(const CuviImage& src,
                        CuviScalar& count,
                        const CuviScalar& rangeMin,
                        const CuviScalar& rangeMax,
                        const CuviStream& stream = NULL);

Parameters

Name Type Description
src const CuviImage& Input Image
count CuviScalar& Computed number of pixels within the given intensity range.
rangeMin const CuviScalar& Lower limit of the intensity range
rangeMax const CuviScalar& Upper limit of the intensity range
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC1 CuviScalar
8uC3 CuviScalar
32fC1 CuviScalar
32fC3 CuviScalar

Sample

Error creating thumbnail: Unable to save thumbnail to destination


Example

CuviImage gimg = cuvi::io::loadImage(path);

CuviScalar count;

const CuviScalar lowerBound(25.0, 10.0, 10.0);
const CuviScalar upperBound(100.0, 200.0, 150.0);


//Returns number of pixels within the given intensity range
cuvi::imageStatistics::countInRange(gimg, count, lowerBound, upperBound);