Mat srcImg = new Mat("input.jpg"); Mat dstImg = new Mat(); double alpha = 1.5; double beta = 0.5; CvInvoke.ConvertScaleAbs(srcImg, dstImg, alpha, beta);
ImageThis example also reads an image "input.jpg" and stores it in an Image object (srcImg). The function then scales the pixel values by a factor of 2 and adds a constant value of 50 to each pixel value. The result is then converted to absolute values and stored in the destination Image object (dstImg). Overall, CvInvoke ConvertScaleAbs is a useful function for scaling and adjusting the pixel values of an image. It is part of the Emgu.CV library, which is a .NET wrapper for OpenCV.srcImg = new Image ("input.jpg"); Image dstImg = new Image (srcImg.Width, srcImg.Height); CvInvoke.ConvertScaleAbs(srcImg, dstImg, 2, 50);