How to multiply a Mat and a scalar with EmguCV in Visual Basic?
Asked Answered
C

1

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?

Cedeno answered 9/11, 2015 at 19:59 Comment(0)
C
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

Cottle answered 17/1, 2020 at 15:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.