XML/YAML Persistence

Load

Comments from the Wiki

Load(filename, storage=NULL, name=NULL) → generic

Loads an object from a file.

Parameters:
  • filename (str) – File name
  • storage (CvMemStorage) – Memory storage for dynamic structures, such as CvSeq or CvGraph . It is not used for matrices or images.
  • name (str) – Optional object name. If it is NULL, the first top-level object in the storage will be loaded.

The function loads an object from a file. It provides a simple interface to Read . After the object is loaded, the file storage is closed and all the temporary buffers are deleted. Thus, to load a dynamic structure, such as a sequence, contour, or graph, one should pass a valid memory storage destination to the function.

Save

Comments from the Wiki

Save(filename, structPtr, name=NULL, comment=NULL) → None

Saves an object to a file.

Parameters:
  • filename (str) – File name
  • structPtr (generic) – Object to save
  • name (str) – Optional object name. If it is NULL, the name will be formed from filename .
  • comment (str) – Optional comment to put in the beginning of the file

The function saves an object to a file. It provides a simple interface to Write .

Table Of Contents

Previous topic

Drawing Functions

Next topic

Clustering

This Page