Hi
i am using the setMouseCallback, same usage as https://answers.opencv.org/question/32888/passing-multiple-parameters-with-the-setmousecallback-function/.it My structure is as follows:
struct cbParams_t { Point pSingle; vector<point> pUpAndpDown; Mat cropped; int count; cbParams_t() : pSingle(), pUpAndpDown(), croppedCloth(), count() {} } ;
But for some reason count seems to not be updated, the code:
cbParams_t cbParams; setMouseCallback( "Img2", onMouseImg2, &cbParams ); //1
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 ) ++;
And painfully, count is still set to 0
Best regards.