6

I've been trying to re-scale an Emgu.CV.Mat with depth 32F and value range [0,1] (a grayscale image) to range [0,255] in order to visualize it in a ImageBox object contained in a Visual Basic form, using the code line

ibSuave.Image = imgSuave * 255

However, Emgu.Cv.Mat doesn't have a Multiply method nor a defined * operator. I'd like to avoid converting the matrix to an Image. How else can I do it?

berak
  • 39,159
  • 9
  • 91
  • 89

1 Answers1

0

Try to use:

CvInvoke.Multiply(mat, New ScalarArray(255), mat);

This will multiply each value in mat by 255 and stores result in mat again. I used EmguCV 3.4.1

Quergo
  • 888
  • 1
  • 8
  • 21