Every other type in the C++ interface so far I have seen is a class. Why is DMatch here still listed as a struct, when the documentation says that it is a class here:
"Class for matching keypoint descriptors: query descriptor index, train descriptor index, train image index, and distance between descriptors."
or is that reference to class an ambiguous one. Just looking for info on why OpenCV is still using structs in its C++ interface.
Also in the file /opencv-master/modules/core/doc/basic_structures.rst
DMatch seems to be documented as a class e.g.
DMatch
------
.. ocv:class:: DMatch
Class for matching keypoint descriptors: query descriptor index,
train descriptor index, train image index, and distance between descriptors. ::
class DMatch
{
public:
DMatch() : queryIdx(-1), trainIdx(-1), imgIdx(-1),
distance(std::numeric_limits<float>::max()) {}
DMatch( int _queryIdx, int _trainIdx, float _distance ) :
queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(-1),
distance(_distance) {}
DMatch( int _queryIdx, int _trainIdx, int _imgIdx, float _distance ) :
queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(_imgIdx),
distance(_distance) {}
int queryIdx; // query descriptor index
int trainIdx; // train descriptor index
int imgIdx; // train image index
float distance;
// less is better
bool operator<( const DMatch &m ) const;
};
class X { public:
is pretty much the same asstruct X{
, just asstruct X { private:
is the same asclass X {
. No real question here. – MSalters