VenushkaT
VenushkaT

Reputation: 1158

Read REF type node of a OpenCV generated YML file

I tried to read node in a YML file. There I checked node type. Which is 4. According to the type chart, It maps into The REF type. I referred this doc, Under that I haven't seen way to read data of REF type node . Any help is appreciated to read my node. Thank you.

import cv2
fs = cv2.FileStorage("ProjectorParameters.yml", cv2.FILE_STORAGE_READ)
fn = fs.getNode("FeaturesValue")
print (fn.type ()) # 4 
print (fn.isSeq ()) # True

The yml file that I wanna read.

%YAML:1.0
---
zThreshold: 40.
FeaturesValue: [ 13, 15, 25, 7, 27, 19, 31, 23, 29, 31, 13, 15, 25, 7 ]

Upvotes: 0

Views: 78

Answers (1)

VenushkaT
VenushkaT

Reputation: 1158

It uses Referencing therefore I used iterative way . Hope it helps to X

for i in range(fn.size()):
   print(fn.at(i).real())

Upvotes: 1

Related Questions