|
|
Line 1: |
Line 1: |
| __NOTOC__
| |
| Computes the mean and standard deviation of image pixel values
| |
| ===Function===
| |
| {|
| |
| |style="font-size:150%;"|
| |
| <syntaxhighlight lang="cpp">
| |
| CuviStatus meanStdDev(CuviImage* image,
| |
| Cuvi64f* mean,
| |
| Cuvi64f* stdDev,
| |
| CuviStream* stream = NULL);
| |
| </syntaxhighlight>
| |
| |}
| |
| ===Parameters===
| |
|
| |
|
| {|class="wikitable"
| |
| |-
| |
| ! Name
| |
| ! Type
| |
| ! Description
| |
| |-
| |
| | image
| |
| | CuviImage*
| |
| | Input Image
| |
| |-
| |
| | mean
| |
| | Cuvi64f*
| |
| | Mean of all pixel values in the image
| |
| |-
| |
| | stdDev
| |
| | Cuvi64f*
| |
| | Standard deviation of all pixel values in the image
| |
| |-
| |
| | stream
| |
| | CuviStream*
| |
| | GPU stream ID for execution
| |
|
| |
| |}
| |
|
| |
| ===Image Type Support===
| |
|
| |
| {| class="wikitable"
| |
| |-
| |
| ! Input
| |
| ! Output
| |
| |-
| |
| | 8uC1
| |
| | 2 x Cuvi64f single value
| |
| |-
| |
| | 8uC3
| |
| | 2 x Cuvi64f three values
| |
| |}
| |
|
| |
| ===Sample===
| |
| {|
| |
| |-
| |
| |[[File:Meanstddev.PNG]]
| |
| |}
| |
|
| |
|
| |
| ===Example===
| |
| {|
| |
| |style="font-size:150%;"|
| |
| <syntaxhighlight lang="cpp">
| |
|
| |
|
| |
| CuviImage* gimg = new CuviImage(size, depth, nChannels);
| |
|
| |
| Cuvi64f* mean = new Cuvi64f[nChannels];
| |
| Cuvi64f* std = new Cuvi64f[nChannels];
| |
|
| |
| //Upload input data
| |
| gimg->upload(hostImg->imageData, hostImg->widthStep);
| |
|
| |
|
| |
| //Returns mean as well as standard deviation image pixel values
| |
| cuvi::arithmeticLogical::meanStdDev(gimg, mean, std);
| |
|
| |
| </syntaxhighlight>
| |
| |}
| |