---
title: MPSImageStatisticsMeanAndVariance
framework: metalperformanceshaders
role: symbol
role_heading: Class
path: metalperformanceshaders/mpsimagestatisticsmeanandvariance
---

# MPSImageStatisticsMeanAndVariance

A kernel that computes the mean and variance for a given region of an image.

## Declaration

```swift
class MPSImageStatisticsMeanAndVariance
```

## Overview

Overview The mean and variance values are written to the destination image at the following pixel locations: Mean value is written at pixel location (0, 0) Variance value is written at pixel location (1, 0)

## Topics

### Initializers

- [init(coder:device:)](metalperformanceshaders/mpsimagestatisticsmeanandvariance/init(coder:device:).md)
- [init(device:)](metalperformanceshaders/mpsimagestatisticsmeanandvariance/init(device:).md)

### Instance Properties

- [clipRectSource](metalperformanceshaders/mpsimagestatisticsmeanandvariance/cliprectsource.md)

## Relationships

### Inherits From

- [MPSUnaryImageKernel](metalperformanceshaders/mpsunaryimagekernel.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Image Statistics Filters

- [MPSImageStatisticsMean](metalperformanceshaders/mpsimagestatisticsmean.md)
- [MPSImageStatisticsMinAndMax](metalperformanceshaders/mpsimagestatisticsminandmax.md)
