From 7f12cb91917a2dbb563a122fa2ff7267b253463d Mon Sep 17 00:00:00 2001 From: deadprogram Date: Mon, 4 Dec 2017 20:54:18 +0100 Subject: [PATCH] imgproc: elaborate on HoughLines test to fetch a few individual results Signed-off-by: deadprogram --- imgproc_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/imgproc_test.go b/imgproc_test.go index 1a2c15fe..2ae1c770 100644 --- a/imgproc_test.go +++ b/imgproc_test.go @@ -308,6 +308,22 @@ func TestHoughLines(t *testing.T) { if dest.Cols() != 1 { t.Errorf("Invalid HoughLines test cols: %v", dest.Cols()) } + + if dest.GetFloatAt(0, 0) != 0 && dest.GetFloatAt(0, 1) != 0 { + t.Errorf("Invalid HoughLines first test element: %v, %v", dest.GetFloatAt(0, 0), dest.GetFloatAt(0, 1)) + } + + if dest.GetFloatAt(1, 0) != 0.99483764 && dest.GetFloatAt(1, 1) != 0 { + t.Errorf("Invalid HoughLines second test element: %v, %v", dest.GetFloatAt(1, 0), dest.GetFloatAt(1, 1)) + } + + if dest.GetFloatAt(10409, 0) != -118.246056 && dest.GetFloatAt(10409, 1) != 2 { + t.Errorf("Invalid HoughLines penultimate test element: %v, %v", dest.GetFloatAt(10409, 0), dest.GetFloatAt(10409, 1)) + } + + if dest.GetFloatAt(10410, 0) != -118.246056 && dest.GetFloatAt(10410, 1) != 2 { + t.Errorf("Invalid HoughLines last test element: %v, %v", dest.GetFloatAt(10410, 0), dest.GetFloatAt(10410, 1)) + } } func TestHoughLinesP(t *testing.T) {