1 | initial version |
Find a solution, don't know if is the best aproach but this work perfectly
CvInvoke.Erode(dst, erode, kernel, anchor, borderSize, BorderType.Default, default);
CvInvoke.Subtract(dst, erode, diff);
CvInvoke.Repeat(evenPattern, dst.Rows / evenPattern.Rows + 1, dst.Cols / evenPattern.Cols + 1, mask);
using (var maskReshape = new Mat(mask, new Rectangle(0, 0, dst.Width, dst.Height)))
{
CvInvoke.BitwiseAnd(erode, maskReshape, dst);
}
CvInvoke.Add(dst, diff, dst);