<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImage/ConvolutionKernel2D",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate6vImageO19ConvolutionKernel2DV"
  },
  "title" : "vImage.ConvolutionKernel2D"
}
-->

# vImage.ConvolutionKernel2D

A 2D matrix that represents a convolution kernel.

```
struct ConvolutionKernel2D<ComponentType>
```

## Topics

### Initializers

[`init(values: [ComponentType], size: vImage.Size)`](/documentation/Accelerate/vImage/ConvolutionKernel2D/init(values:size:))

Returns a new convolution kernel structure with the size you specify.

[`init(values: [ComponentType], width: Int, height: Int)`](/documentation/Accelerate/vImage/ConvolutionKernel2D/init(values:width:height:))

Returns a new convolution kernel structure with the width and height you specify.

### Instance Properties

[`let width: vImagePixelCount`](/documentation/Accelerate/vImage/ConvolutionKernel2D/width)

The width of the kernel that must be a positive, odd number.

[`let height: vImagePixelCount`](/documentation/Accelerate/vImage/ConvolutionKernel2D/height)

The height of the kernel that must be a positive, odd number.

[`let values: [ComponentType]`](/documentation/Accelerate/vImage/ConvolutionKernel2D/values)

The kernel weights or structuring element values that must contain `height * width` elements.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)