/// <summary>
/// Create a custome shape Structuring Element
/// </summary>
/// <param name="values">The structuring element data, a plane array, representing row-by-row scanning of the element matrix. Non-zero values indicate points that belong to the element.</param>
/// <param name="anchorX">Relative horizontal offset of the anchor point</param>
/// <param name="anchorY">Relative vertical offset of the anchor point</param>
public StructuringElementEx(int[,] values, int anchorX, int anchorY)
{
_values = values;
_handle = GCHandle.Alloc(_values, GCHandleType.Pinned);
_ptr = CvInvoke.cvCreateStructuringElementEx(
values.GetLength(1),
values.GetLength(0),
anchorX,
anchorY,
CvEnum.CV_ELEMENT_SHAPE.CV_SHAPE_CUSTOM,
_handle.AddrOfPinnedObject());
}