opencv - How to store cv::Scalar objects in a Map in c++ -
i want store randomly generated scalar values in map. following attempt gives me compile error. rng rng(0xffffffff); std::map<scalar, int> segmentcolors; scalar randomcolortemp1 = randomcolor(rng); scalar randomcolortemp2 = randomcolor(rng); segmentcolors.insert(pair<scalar, int>(randomcolortemp1, 1)); segmentcolors.insert(pair<scalar, int>(randomcolortemp1, 1)); error report follows. 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xstddef(193): error c2678: binary '<' : no operator found takes left-hand operand of type 'const cv::scalar' (or there no acceptable conversion) 1> e:\opencv\build\include\opencv2\core\operations.hpp(3193): 'bool cv::operator <(const cv::filenodeiterator &,const cv::filenodeiterator &)' [found using argument-dependent lookup] 1> e:\opencv\build\include\opencv2\core\mat.hpp(1303): or 'cv::matexpr cv::operator <(const cv::mat &