Skip to content

Group CImageStatistics

Modules > CImageStatistics

The functions in this section provide access to information and functionality related to image statistics. This includes context creation and destruction, the enabling and disabling of channels, and value retrieval.

Public Functions

Type Name
spinImageStatisticsCreate (spinImageStatistics * phStatistics)
spinImageStatisticsDestroy (spinImageStatistics hStatistics)
spinImageStatisticsDisableAll (spinImageStatistics hStatistics)
spinImageStatisticsEnableAll (spinImageStatistics hStatistics)
spinImageStatisticsEnableGreyOnly (spinImageStatistics hStatistics)
spinImageStatisticsEnableHslOnly (spinImageStatistics hStatistics)
spinImageStatisticsEnableRgbOnly (spinImageStatistics hStatistics)
spinImageStatisticsGetAll (spinImageStatistics hStatistics, spinStatisticsChannel channel, unsigned int * pRangeMin, unsigned int * pRangeMax, unsigned int * pPixelValueMin, unsigned int * pPixelValueMax, unsigned int * pNumPixelValues, float * pPixelValueMean, int ** ppHistogram)
spinImageStatisticsGetChannelStatus (spinImageStatistics hStatistics, spinStatisticsChannel channel, bool8_t * pbEnabled)
spinImageStatisticsGetHistogram (spinImageStatistics hStatistics, spinStatisticsChannel channel, int ** ppHistogram)
spinImageStatisticsGetMean (spinImageStatistics hStatistics, spinStatisticsChannel channel, float * pMean)
spinImageStatisticsGetNumPixelValues (spinImageStatistics hStatistics, spinStatisticsChannel channel, unsigned int * pNumValues)
spinImageStatisticsGetPixelValueRange (spinImageStatistics hStatistics, spinStatisticsChannel channel, unsigned int * pMin, unsigned int * pMax)
spinImageStatisticsGetRange (spinImageStatistics hStatistics, spinStatisticsChannel channel, unsigned int * pMin, unsigned int * pMax)
spinImageStatisticsSetChannelStatus (spinImageStatistics hStatistics, spinStatisticsChannel channel, bool8_t bEnable)

Public Functions Documentation

function spinImageStatisticsCreate

spinImageStatisticsCreate (
    spinImageStatistics * phStatistics
) 

Creates an image statistics context

Parameters:

  • phStatistics The statistics handle pointer in which the image statistics context is returned

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsDestroy

spinImageStatisticsDestroy (
    spinImageStatistics hStatistics
) 

Destroys an image statistics context

See also: spinError

Parameters:

  • hStatistics The image statistics context to destroy

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsDisableAll

spinImageStatisticsDisableAll (
    spinImageStatistics hStatistics
) 

Disables all channels of an image statistics context

See also: spinError

Parameters:

  • hStatistics The image statistics context to disable all channels

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsEnableAll

spinImageStatisticsEnableAll (
    spinImageStatistics hStatistics
) 

Enables all channels of an image statistics context

See also: spinError

Parameters:

  • hStatistics The image statistics context to enable all channels

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsEnableGreyOnly

spinImageStatisticsEnableGreyOnly (
    spinImageStatistics hStatistics
) 

Disables all channels of an image statistics context except grey-scale

See also: spinError

Parameters:

  • hStatistics The image statistics context to enable only grey

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsEnableHslOnly

spinImageStatisticsEnableHslOnly (
    spinImageStatistics hStatistics
) 

Disables all channels of an image statistics context except hue, saturation, and lightness

See also: spinError

Parameters:

  • hStatistics The image statistics context to enable only HSL

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsEnableRgbOnly

spinImageStatisticsEnableRgbOnly (
    spinImageStatistics hStatistics
) 

Disables all channels of an image statistics context except red, blue, and green

See also: spinError

Parameters:

  • hStatistics The image statistics context to enable only RGB

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsGetAll

spinImageStatisticsGetAll (
    spinImageStatistics hStatistics,
    spinStatisticsChannel channel,
    unsigned int * pRangeMin,
    unsigned int * pRangeMax,
    unsigned int * pPixelValueMin,
    unsigned int * pPixelValueMax,
    unsigned int * pNumPixelValues,
    float * pPixelValueMean,
    int ** ppHistogram
) 

Retrieves all available information of an image statistics channel

See also: spinError

Parameters:

  • hStatistics The image statistics context of the channel
  • channel The channel of the information to retrieve
  • pRangeMin The unsigned integer pointer in which the minimum value of the range is returned
  • pRangeMax The unsigned integer pointer in which the maximum value of the range is returned
  • pPixelValueMin The unsigned integer pointer in which the minimum pixel value of the range is returned
  • pPixelValueMax The unsigned integer pointer in which the maximum pixel value of the range is returned
  • pNumPixelValues The unsigned integer pointer in which the number of pixel values is returned
  • pPixelValueMean The float pointer in which the mean pixel value is returned
  • ppiHistogram The pointer to the pointer in which the histogram data is returned

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsGetChannelStatus

spinImageStatisticsGetChannelStatus (
    spinImageStatistics hStatistics,
    spinStatisticsChannel channel,
    bool8_t * pbEnabled
) 

Checks whether an image statistics context is enabled

See also: spinError

Parameters:

  • hStatistics The image statistics context of the channel
  • channel The channel to check
  • pbEnabled The boolean pointer to return whether or not the channel is enabled

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsGetHistogram

spinImageStatisticsGetHistogram (
    spinImageStatistics hStatistics,
    spinStatisticsChannel channel,
    int ** ppHistogram
) 

Retrieves a histogram of an image statistics channel

See also: spinError

Parameters:

  • hStatistics The image statistics context of the channel
  • channel The channel of the histogram to be returned
  • pHistogram The pointer to the integer pointer in which the histogram data is returned

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsGetMean

spinImageStatisticsGetMean (
    spinImageStatistics hStatistics,
    spinStatisticsChannel channel,
    float * pMean
) 

Retrieves the mean of pixel values of an image statistics channel

See also: spinError

Parameters:

  • hStatistics The image statistics context of the channel
  • channel The channel of the mean pixel value to be retrieved
  • pMean The float pointer in which the mean pixel value is returned

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsGetNumPixelValues

spinImageStatisticsGetNumPixelValues (
    spinImageStatistics hStatistics,
    spinStatisticsChannel channel,
    unsigned int * pNumValues
) 

Retrieves the number of pixel values of an image statistics channel

See also: spinError

Parameters:

  • hStatistics The image statistics context of the channel
  • channel The channel where the pixel values to be counted are
  • iNumValues The unsigned integer pointer in which the number of pixel values is returned

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsGetPixelValueRange

spinImageStatisticsGetPixelValueRange (
    spinImageStatistics hStatistics,
    spinStatisticsChannel channel,
    unsigned int * pMin,
    unsigned int * pMax
) 

Retrieves the pixel value range of an image statistics channel

See also: spinError

Parameters:

  • hStatistics The image statistics context of the channel
  • channel The channel of the pixel value range to retrieve
  • pMin The unsigned integer pointer in which the minimum value of the pixel value range is returned
  • pMax The unsigned integer pointer in which the maximum value of the pixel value range is returned

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsGetRange

spinImageStatisticsGetRange (
    spinImageStatistics hStatistics,
    spinStatisticsChannel channel,
    unsigned int * pMin,
    unsigned int * pMax
) 

Retrieves the range of an image statistics channel

See also: spinError

Parameters:

  • hStatistics The image statistics context of the channel
  • channel The channel of the range to retrieve
  • pMin The unsigned integer pointer in which the minimum value of the range is returned
  • pMax The unsigned integer pointer in which the maximum value of the range is returned

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error


function spinImageStatisticsSetChannelStatus

spinImageStatisticsSetChannelStatus (
    spinImageStatistics hStatistics,
    spinStatisticsChannel channel,
    bool8_t bEnable
) 

Sets the status of an image statistics channel

See also: spinError

Parameters:

  • hStatistics The image statistics context of the channel
  • channel The channel to enable/disable
  • bEnable The boolean value to set; true enables, false disables

Returns:

spinError The error code; returns SPINNAKER_ERR_SUCCESS (or 0) for no error