So, it seems there is no longer a "distance" member in
std::vector<std::vector<cv::DMatch>> matches;
When looking at the definition of DMatch in "types.hpp":
class CV_EXPORTS_W_SIMPLE DMatch
{
public:
CV_WRAP DMatch();
CV_WRAP DMatch(int _queryIdx, int _trainIdx, float _distance);
CV_WRAP DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance);
CV_PROP_RW int queryIdx; // query descriptor index
CV_PROP_RW int trainIdx; // train descriptor index
CV_PROP_RW int imgIdx; // train image index
CV_PROP_RW float distance;
// less is better
bool operator<(const DMatch &m) const;
};
/*!
traits
*/
template<> class DataType<DMatch>
{
public:
typedef DMatch value_type;
typedef int work_type;
typedef int channel_type;
enum { generic_type = 0,
depth = DataType<channel_type>::depth,
channels = (int)(sizeof(value_type)/sizeof(channel_type)), // 4
fmt = DataType<channel_type>::fmt + ((channels - 1) << 8),
type = CV_MAKETYPE(depth, channels)
};
typedef Vec<channel_type, channels> vec_type;
};
I am doing FLANN matching. At some point, after computing the matches, an error appears:
double dist = matches[i].distance; //Distance is underlined, class has no member "Distance"
Which is kind of true when you look at the definition.
Has anyone found some way to get around this?