Added make_point_list kernel
[profile/ivi/opencv.git] / modules / imgproc / test / ocl / test_houghlines.cpp
1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
4
5 // Copyright (C) 2014, Itseez, Inc., all rights reserved.
6 // Third party copyrights are property of their respective owners.
7
8 #include "../test_precomp.hpp"
9 #include "opencv2/ts/ocl_test.hpp"
10
11 #ifdef HAVE_OPENCL
12
13 namespace cvtest {
14 namespace ocl {
15
16 PARAM_TEST_CASE(HoughLinesTestBase, bool)
17 {
18     double rhoStep;
19     double thetaStep;
20     int threshold;
21     bool useRoi;
22
23     Mat src, dst;
24     UMat usrc, udst;
25
26     virtual void SetUp()
27     {
28         rhoStep = 10;
29         thetaStep = 0.1;
30         threshold = 80;
31         useRoi = false;
32     }
33
34     virtual void generateTestData()
35     {
36         //Mat image = readImage("shared/pic1.png", IMREAD_GRAYSCALE);
37         
38         Mat image = randomMat(Size(100, 100), CV_8UC1, 0, 255, false);
39         
40         cv::threshold(image, src, 127, 255, THRESH_BINARY);
41         //Canny(image, src, 100, 150, 3);
42         src.copyTo(usrc);
43     }
44 };
45
46 typedef HoughLinesTestBase HoughLines;
47
48 OCL_TEST_P(HoughLines, RealImage)
49 {
50     generateTestData();
51
52     //std::cout << src << std::endl;
53
54     OCL_OFF(cv::HoughLines(src, dst, rhoStep, thetaStep, threshold, 0, 0));
55     OCL_ON(cv::HoughLines(usrc, udst, rhoStep, thetaStep, threshold, 0, 0));
56 }
57
58 OCL_INSTANTIATE_TEST_CASE_P(Imgproc, HoughLines, Values(true, false));
59
60 } } // namespace cvtest::ocl
61
62 #endif // HAVE_OPENCL