From 3c795a0dabb1c6bea6ad44c40937bdebaf523bb0 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Fri, 4 Aug 2017 17:12:20 +0200 Subject: [PATCH] add test_algorithm_rw using AKAZE --- modules/python/test/test_algorithm_rw.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 modules/python/test/test_algorithm_rw.py diff --git a/modules/python/test/test_algorithm_rw.py b/modules/python/test/test_algorithm_rw.py new file mode 100644 index 0000000..788fa22 --- /dev/null +++ b/modules/python/test/test_algorithm_rw.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +''' +Algorithm serializaion test +''' +import cv2 + +from tests_common import NewOpenCVTests + +class algorithm_rw_test(NewOpenCVTests): + def test_algorithm_rw(self): + # some arbitrary non-default parameters + gold = cv2.AKAZE_create(descriptor_size=1, descriptor_channels=2, nOctaves=3, threshold=4.0) + gold.write(cv2.FileStorage("params.yml", 1), "AKAZE") + + fs = cv2.FileStorage("params.yml", 0) + algorithm = cv2.AKAZE_create() + algorithm.read(fs.getNode("AKAZE")) + + self.assertEqual(algorithm.getDescriptorSize(), 1) + self.assertEqual(algorithm.getDescriptorChannels(), 2) + self.assertEqual(algorithm.getNOctaves(), 3) + self.assertEqual(algorithm.getThreshold(), 4.0) -- 2.7.4