How do I remove duplicate rows in cv::Mat?
I have four n x 2
matrices and I want to concatenate them, but removing the duplicate rows. I tried to use std::set
std::set<cv::Mat> nonDuplicatedPairs;
for (int i = 0; i < drPairs.rows; ++i) {
nonDuplicatedPairs.insert( deltasMat.row(i) );
nonDuplicatedPairs.insert( drPairs.row(i) );
nonDuplicatedPairs.insert( dlPairs.row(i) );
nonDuplicatedPairs.insert( ulPairs.row(i) );
}
but it gives the following compilation error:
error C2440: 'return' : cannot convert from 'cv::MatExpr' to 'bool'
These matrices are of type CV_32SC
and have only one channel.
i bet the culprit is the overloaded == operator, like Mat c = (a==b);
It's true, @berak! The
operator==
is returning to me aMatExpr
. How can I get only the boolean value?