0f3b194a2f97e4373241bbb94a00ac73de9f7e63
[platform/upstream/opencv.git] / modules / gapi / misc / python / test / test_gapi_types.py
1 #!/usr/bin/env python
2
3 import numpy as np
4 import cv2 as cv
5 import os
6
7 from tests_common import NewOpenCVTests
8
9 class gapi_types_test(NewOpenCVTests):
10
11     def test_garray_type(self):
12         types = [cv.gapi.CV_BOOL  , cv.gapi.CV_INT   , cv.gapi.CV_DOUBLE , cv.gapi.CV_FLOAT,
13                  cv.gapi.CV_STRING, cv.gapi.CV_POINT , cv.gapi.CV_POINT2F, cv.gapi.CV_SIZE ,
14                  cv.gapi.CV_RECT  , cv.gapi.CV_SCALAR, cv.gapi.CV_MAT    , cv.gapi.CV_GMAT]
15
16         for t in types:
17             g_array = cv.GArrayT(t)
18             self.assertEqual(t, g_array.type())
19
20
21     def test_gopaque_type(self):
22         types = [cv.gapi.CV_BOOL  , cv.gapi.CV_INT   , cv.gapi.CV_DOUBLE , cv.gapi.CV_FLOAT,
23                  cv.gapi.CV_STRING, cv.gapi.CV_POINT , cv.gapi.CV_POINT2F, cv.gapi.CV_SIZE ,
24                  cv.gapi.CV_RECT]
25
26         for t in types:
27             g_opaque = cv.GOpaqueT(t)
28             self.assertEqual(t, g_opaque.type())
29
30
31 if __name__ == '__main__':
32     NewOpenCVTests.bootstrap()