I am using cvSetMouseCallback to track mouse clicks. However I need to pass in more than one argument to the function that is passed in to cvSetMouseCallback. However cvSetMouseCallback only accepts one parameter to pass in data to the function it calls. How I would I do this with more than one argument?
For example:
cvSetMouseCallback ("Window", function, argumentPassedintofunction);
void function (int event, int x, int y, int flags, void* param, CvRect *drawnRect, IplImage *skinSegment, IplImage *colourSpaceImg, CvHistogram *skin, IplImage *planes [])
{
}
So as you see, I need to pass in more than one parameter to function () but cvSetMouseCallback only allows one argument to be passed in.
I DO NOT WANT TO ACCESS THE OS FOR MOUSE CALLS (so not handles and any of that, I strictly want to stick to opencv)
Also making the arguments global variables isn’t an option.
You can make function take in a struct which contains all the parameters.