Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What means "Returns the specified element of the top-level mapping"?

In the camera calibration tutorial there is the line:

fs["Settings"] >> s;

which I don't understand. In the reference to the class FileStorage, of which fs is a member, [] is overloaded by:

FileNode    operator[] (const String &nodename) const

which is described by

Returns the specified element of the top-level mapping.

What does this mean? and why in the definition of the overloading, there is a "const" after "...&nodename)" ?

And what is the operator >> doing? By default it's the bitwhise shifting, right? What would bitwise shifting do here?

Thank you in advance for your answers.

What means "Returns the specified element of the top-level mapping"?

In the camera calibration tutorial (link: http:// docs.opencv.org/2.4/doc/tutorials/calib3d/ camera_calibration/camera_calibration.html# ), in part 1. Read the Settings) there is the line:

fs["Settings"] >> s;

which I don't understand. In the reference to the class FileStorage, of which fs fs is a member, [] [ ] is overloaded by:

FileNode    operator[] (const String &nodename) const

which is described by

Returns the specified element of the top-level mapping.

  1. What does this description mean? and why
  2. Why in the definition of the overloading, there is a "const" after "...&nodename)" ?

  3. And what

  4. What is the operator >> doing? By default it's the bitwhise shifting, right? What would bitwise shifting do here?

Thank you in advance for your answers.