Solución:
// Converting the master image to a bitmap
Bitmap masterImage = (Bitmap) pbxMaster.Image;
// Normalizing it to grayscale
Image<Gray, Byte> normalizedMasterImage = new Image<Gray, Byte>(masterImage);
EmguCV versión 4.2.0.3636 [and forward] funciona con el siguiente código:
using System.Drawing;
using System.Drawing.Imaging;
using Emgu.CV;
using Emgu.CV.Structure;
//inputImage type is System.Drawing.Image
Bitmap bitmapImage = new Bitmap(pictureBox1.Image);
Rectangle rectangle = new Rectangle(0, 0, bitmapImage.Width, bitmapImage.Height);//System.Drawing
BitmapData bmpData = bitmapImage.LockBits(rectangle, ImageLockMode.ReadWrite, bitmapImage.PixelFormat);//System.Drawing.Imaging
Image<Bgr, byte> outputImage = new Image<Bgr, byte>(bitmapImage.Width, bitmapImage.Height, bmpData.Stride, bmpData.Scan0);//(IntPtr)
//outputImage type is Emgu.CV.Image
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)