Callback parameters not being updated
Hi
i am using the setMouseCallback, same usage as https://answers.opencv.org/question/3... But for some reason one of the fields is not updated inside the callback The code:
struct cbParams_t
{
Point pSingle;
vector<Point> pUpAndpDown;
Mat croppedCloth;
int count;
cbParams_t() : pSingle(), pUpAndpDown(), croppedCloth(), count() {}
} ;
// registering the callback:
cbParams_t cbParams;
setMouseCallback( "Img2", onMouseImg2, &cbParams )
// inside the callback:
static void onMouseImg2(int event, int i, int j, int flags, void* param)
{
cbParams_t * pCbParams = (cbParams_t *) param ;
int * pCount = &(pCbParams->count);
(* pCount ) ++;
...
}
// but when i come back inside the callback count is not incremented
Best regards.
your example is somewhat incomplete. how / where do you invoke / call this piece of code ?