convertScaleAbs scales, caclulates the the absolute value of an image, as following:
Then the result is converted to a 8-bit image
Examples
scicv_Init();img=imread(getSampleImage("lena.jpg"),CV_LOAD_IMAGE_GRAYSCALE);// First order derivative on x, kernel size 3img_grad_x=Sobel(img,CV_16S,1,0,3);img_grad_abs_x=convertScaleAbs(img_grad_x);// First order derivative on x, kernel size 3img_grad_y=Sobel(img,CV_16S,0,1,3);img_grad_abs_y=convertScaleAbs(img_grad_y);// Calculates the gradient imageimg_grad=addWeighted(img_grad_abs_x,0.5,img_grad_abs_y,0.5,0);matplot(img_grad);delete_Mat(img);delete_Mat(img_grad_x);delete_Mat(img_grad_abs_x);delete_Mat(img_grad_y);delete_Mat(img_grad_abs_y);delete_Mat(img_grad);