1 | initial version |

i bet the culprit is the overloaded == operator, like Mat c = (a==b);

maybe overloading the comparison like this works:

```
bool compareMats( const Mat & a, const Mat & b ) {
return sum(a-b)[0]==0;
}
std::set<Mat, compareMats> nonDuplicatedPairs;
```

2 | No.2 Revision |

(found out, that it's 'less', not 'equal')
i bet the culprit is the overloaded ~~== ~~< operator, like Mat c = ~~(a==b);~~(a<b);< p="">

maybe overloading the comparison like this works:

```
bool compareMats( const Mat & a, const Mat & b ) {
return
```~~sum(a-b)[0]==0;
~~sum(a-b)[0] < 0; // less
}
std::set<Mat, compareMats> nonDuplicatedPairs;

3 | No.3 Revision |

(found out, that it's 'less', not 'equal') i bet the culprit is the overloaded < operator, like Mat c = (a<b);< p="">

maybe overloading the comparison like this works:

```
struct compareMats
{
bool
```~~ compareMats( const ~~operator()(const Mat & a, const Mat & ~~b ) ~~b) const
{
return ~~sum(a-b)[0] < ~~sum(b-a)[0] > 0; ~~// less
~~ }
};
std::set<Mat, compareMats> nonDuplicatedPairs;

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.