Ask Your Question

Revision history [back]

Your functions should not have formal parameters as you have defined. Instead, those should be global to the code. You should define the parameters after Mat src; close to the top as

int iValueForBrightness;
int iValueForContrast;
int *userData;

and remove the local definitions. Then, change the function headers to:

void MyCallbackForBrightness(int, void *)
void MyCallbackForContrast(int, void *)

and this should work. Also, why are you reading the image as IplImage. You can read the Mat straight by:

src = imread ( "D:\\ashish.png" );