Difference between revisions of "Function:Mean"
From CUVI Wiki
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Computes the mean of image pixel values | Computes the mean of image pixel values. Each channel is processed individually. | ||
===Function=== | ===Function=== | ||
{| | {| | ||
|style="font-size:150%;"| | |style="font-size:150%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviStatus mean(CuviImage | CuviStatus mean(const CuviImage& src, | ||
CuviScalar& mean, | |||
CuviStream | const CuviStream& stream = CuviStream()); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 19: | Line 19: | ||
! Description | ! Description | ||
|- | |- | ||
| | | src | ||
| CuviImage | | const CuviImage& | ||
| Input Image | | Input Image | ||
|- | |- | ||
| mean | | mean | ||
| | | CuviScalar& | ||
| Mean of all pixel values in the image | | Mean of all pixel values in the image | ||
|- | |- | ||
| stream | | stream | ||
| CuviStream | | const CuviStream& | ||
| GPU stream ID for execution | | GPU stream ID for execution | ||
Line 41: | Line 41: | ||
|- | |- | ||
| 8uC1 | | 8uC1 | ||
| | | CuviScalar | ||
|- | |- | ||
| 8uC3 | | 8uC3 | ||
| | | CuviScalar | ||
|- | |||
| 16uC1 | |||
| CuviScalar | |||
|- | |||
| 16uC3 | |||
| CuviScalar | |||
|- | |||
| 32fC1 | |||
| CuviScalar | |||
|- | |||
| 32fC3 | |||
| CuviScalar | |||
|} | |} | ||
Line 60: | Line 72: | ||
CuviImage | CuviImage gimg = cuvi::io::loadImage(path); | ||
CuviScalar mean; | |||
//Returns mean of all pixel values in the image | //Returns mean of all pixel values in the image | ||
cuvi:: | cuvi::imageStatistics::mean(gimg, mean); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Revision as of 19:03, 12 June 2014
Computes the mean of image pixel values. Each channel is processed individually.
Function
|
Parameters
Name | Type | Description |
---|---|---|
src | const CuviImage& | Input Image |
mean | CuviScalar& | Mean of all pixel values in the image |
stream | const CuviStream& | GPU stream ID for execution |
Image Type Support
Input | Output |
---|---|
8uC1 | CuviScalar |
8uC3 | CuviScalar |
16uC1 | CuviScalar |
16uC3 | CuviScalar |
32fC1 | CuviScalar |
32fC3 | CuviScalar |
Sample
Error creating thumbnail: Unable to save thumbnail to destination
|
Example
|