public void SumPixelsByte() { var p1 = new Point(0, 0); var p2 = new Point(9, 9); using (Mat mat = new Mat(10, 10, MatType.CV_8UC1, 2)) using (var lineIterator = new LineIterator(mat, p1, p2)) { var sum = lineIterator.Sum(pixel => pixel.GetValue <byte>()); Assert.Equal(10 * 2, sum); } }