If there's no operator to compare two cv::Scalar
elements you can define it:
#include "OpenCVStuff.h"
// Custom operator to compare cv::Scalar class...
bool operator >(const cv::Scalar &a, const cv::Scalar &b)
{
bool Result = false;
// Do whatever you think a Scalar comparison must be.
return Result;
}
int main(int argc, char **argv)
{
cv::Scalar myValue;
// Assuming myClass (i,j) returns a cv::Scalar
for ( myValue > myClass (i,j) )
{
// Do something...
}
return 0;
}
Doing this you can define the way two cv::Scalar
are compared without bothering the cv::Scalar
class itself.
I've put it into the main.cpp
just as an example, but you can define the operator wherever you want as long it is visible where the comparison is performed.