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.

4
  • 2
    Assuming you're using a current compiler, try just std::unordered_map, without the tr1 part. Commented Aug 23, 2013 at 5:25
  • I am using the compiler on linux and it does not recognize the "#include <unordered_map> ! Commented Aug 23, 2013 at 5: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. Commented Aug 23, 2013 at 5:33
  • @juanchopanza how do you implement hash struct ?could you please write the implementation for me ? Commented Aug 23, 2013 at 5:45

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.