I’m using OpenCV’s highgui include to be able to get mouse click locations on my image. I’ve defined a vector<2f> that I would like to store the points that have been clicked within, but unfortunately, I think I’m doing something wrong:
void on_mouse(int mouseEvent, int x, int y, int flags, void* param)
{
if( mouseEvent == CV_EVENT_LBUTTONDOWN) {
printf("Clicked image at (%d,%d)\n", x, y);
(vector<Point2f>*)param.push_back(Point2f(x,y));
}
}
My compiler gives me an error on param and says Error: Expression must have class type.
Can anyone suggest how else to cast as a vector structure? or what I am doing incorrectly?
Should be: