mirror of
https://github.com/opencv/opencv.git
synced 2026-07-28 23:03:03 +04:00
Merge pull request #28482 from satyam102006:core/yaml-1-2-support
core: add YAML 1.2 support for FileStorage #28482 Fixes: #26363 CI Update: https://github.com/opencv/ci-gha-workflow/pull/306 Summary: - Bool true/false literals support - Header-less YAMLs support for Python YAML module compatibility. Header-less files are parsed as YAMLs by default - Added FORMAT_YAML_1_0 flag to FileStorage for fallback. - New YAML1.2 header Testing: - Added Core_InputOutput.YAML_1_2_Compatibility test case in test_io.cpp. - Added YAML interop test in Python
This commit is contained in:
@@ -61,7 +61,7 @@ public class MSERFeatureDetectorTest extends OpenCVTestCase {
|
||||
|
||||
detector.write(filename);
|
||||
|
||||
String truth = "%YAML:1.0\n---\nname: \"Feature2D.MSER\"\ndelta: 5\nminArea: 60\nmaxArea: 14400\nmaxVariation: 0.25\nminDiversity: 0.20000000000000001\nmaxEvolution: 200\nareaThreshold: 1.01\nminMargin: 0.0030000000000000001\nedgeBlurSize: 5\npass2Only: 0\n";
|
||||
String truth = "%YAML 1.2\n---\nname: \"Feature2D.MSER\"\ndelta: 5\nminArea: 60\nmaxArea: 14400\nmaxVariation: 0.25\nminDiversity: 0.20000000000000001\nmaxEvolution: 200\nareaThreshold: 1.01\nminMargin: 0.0030000000000000001\nedgeBlurSize: 5\npass2Only: false\n";
|
||||
String actual = readFile(filename);
|
||||
actual = actual.replaceAll("e([+-])0(\\d\\d)", "e$1$2"); // NOTE: workaround for different platforms double representation
|
||||
assertEquals(truth, actual);
|
||||
|
||||
Reference in New Issue
Block a user