1 | initial version |
yes mouse cursor is invisible on gray ( Scalar( 127, 127, 127)
)
i think you will understand the reason if you try the code below and move mouse on the gradient image.
Cursor becomes white over dark pixels and becomes black over light pixels. the algorithm fails on gray pixels.
#include "highgui.hpp"
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
vector<uchar> testVector;
for( int i = 0; i < 65536; i++)
{
testVector.push_back( i % 256 );
}
Mat testMat = Mat( testVector ).reshape( 0, 256 );
imshow("Black to White Gradient",testMat);
waitKey();
}
2 | No.2 Revision |
yes mouse cursor is invisible on gray ( Scalar( 127, 127, 127)
)
i think you will understand the reason if you try the code below and move mouse on the gradient image.
representative image
Cursor becomes white over dark pixels and becomes black over light pixels. the algorithm fails on gray pixels.
#include "highgui.hpp"
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
vector<uchar> testVector;
for( int i = 0; i < 65536; i++)
{
testVector.push_back( i % 256 );
}
Mat testMat = Mat( testVector ).reshape( 0, 256 );
imshow("Black to White Gradient",testMat);
waitKey();
}