I'm using EmguCV 3.4.1 and the eBUS SDK. I have video coming in over GigE and I would like to convert the PvBuffer to a MAT so I can use OpenCV to create a display a histogram.
Asked
Active
Viewed 758 times
1
-
Please show the code you have so far and narrow the question down to what exactly seems to be the problem. So far your "question" doesn't have a question mark in it and *looks* like you're waiting for someone to just write code for you for free. – Nick Slavsky Jun 04 '18 at 22:41
1 Answers
2
I followed a similar style to how you create a Mat in C++. Unfortunately this solution requires marking the project as unsafe.
unsafe private Mat convertPvBufferToMat(PvBuffer aBuffer)
{
PvImage lImage = aBuffer.Image;
lImage.Alloc(lImage.Width, lImage.Height, PvPixelType.Mono16);
int[] sizes = new int[2] { (int)lImage.Height, (int)lImage.Width };
Mat aMat = new Mat(sizes, DepthType.Cv16U, (IntPtr)lImage.DataPointer);
return aMat;
}
I'm taking images from an infared camera outputing 16 bit grayscale images.

Jace
- 41
- 7