KudanCV
KudanUtilities Class Reference

#include <KudanCV.h>

Static Public Member Functions

static KudanVector3 getAverageImageColour (const unsigned char *imageData, int width, int height, int channels, int padding, int targetWidth, int targetHeight)
 

Detailed Description

Contains various utility functions which the Kudan interface also provides. These are various computer vision and image processing routines not specifically linked to any of the core features (tracking, mapping etc) but which could be useful for related tasks

Member Function Documentation

◆ getAverageImageColour()

KudanVector3 KudanUtilities::getAverageImageColour ( const unsigned char *  imageData,
int  width,
int  height,
int  channels,
int  padding,
int  targetWidth,
int  targetHeight 
)
static

Get the average colour from a BGR image. Given an image represented by a pointer to unsigned char data, with specified dimensions and channels, this computes the average BGR colour (after down-sampling to a given size for efficienty)

Parameters
imageDataPointer to the data expressed as a contiguous array of unsigned chars
width,heightSize of the image data
channelsThe number of channels in the data
paddingPadding of the data at the end of each row (?)
targetWidth,targetHeightSize to which the image is resized in order to accelerate computation of the mean
Returns
A vector representing the mean colour as BGR in the range [0,255]^3
Exceptions
KudanExceptionis thrown if the data pointer is null or if the number of channels is not valid

The documentation for this class was generated from the following files: