1

I tried the following :

typedef std::tr1::unordered_map <Point2f,int> hash;
hash ht;
Point2f points;
points.x = ......
points.y = ......
.
.
.
ht.insert(hash::value_type(points,frame_num));

but I get the following error :

error: undefined reference to `std::tr1::hash<cv::Point_<float> >::operator()(cv::Point_<float>) const'

The whole reason for doing this is storing the place (coordinates as keys of the hash table) and the time (or frame number as values) of mass centers (points) as they happen! any help or suggestion is appreciated.

S J
  • 57
  • 10
  • 2
    Assuming you're using a current compiler, try just `std::unordered_map`, without the `tr1` part. – Jerry Coffin Aug 23 '13 at 05:25
  • I am using the compiler on linux and it does not recognize the "#include ! – S J Aug 23 '13 at 05:30
  • You should not call your map type `hash`. Call it something else. Then, either implement `std::tr1::hash` for `Point2f` or provide a custom hash functor as template parameter. – juanchopanza Aug 23 '13 at 05:33
  • @juanchopanza how do you implement hash struct ?could you please write the implementation for me ? – S J Aug 23 '13 at 05:45

0 Answers0