'OpenCV cannot read manually edited YAML parameters

I manually add a custom matrix to a YAML file for openCV parameters, the problem is it cannot read the matrix and so OpenCV returns none-type. I do not know what is happening here as I tried editing both in notepad and visual studio code.

%YAML:1.0
---
test_matrix: !!opencv-matrix
   rows: 2
   cols: 2
   dt: i
   data: [ 1, 1, 1, 1 ]


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source