Beispiel #1
0
 /// <summary>
 /// Decode image stored in the buffer
 /// </summary>
 /// <param name="buf">The buffer</param>
 /// <param name="loadType">The image loading type</param>
 /// <param name="dst">The output placeholder for the decoded matrix.</param>
 public static void Imdecode(byte[] buf, CvEnum.LoadImageType loadType, Mat dst)
 {
     using (VectorOfByte vb = new VectorOfByte(buf))
     {
         Imdecode(vb, loadType, dst);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Load the Mat from file
 /// </summary>
 /// <param name="fileName">The name of the file</param>
 /// <param name="loadType">File loading method</param>
 public Mat(String fileName, CvEnum.LoadImageType loadType)
     : this(MatInvoke.cvMatCreate(), true, false)
 {
     using (CvString s = new CvString(fileName))
         CvInvoke.cveImread(s, loadType, this);
 }
Beispiel #3
0
 private static extern void cveImdecode(IntPtr buf, CvEnum.LoadImageType loadType, IntPtr dst);
Beispiel #4
0
 /// <summary>
 /// Decode image stored in the buffer
 /// </summary>
 /// <param name="buf">The buffer</param>
 /// <param name="loadType">The image loading type</param>
 /// <param name="dst">The output placeholder for the decoded matrix.</param>
 public static void Imdecode(IInputArray buf, CvEnum.LoadImageType loadType, Mat dst)
 {
     using (InputArray iaBuffer = buf.GetInputArray())
         cveImdecode(iaBuffer, loadType, dst);
 }
Beispiel #5
0
 internal static extern IntPtr cveImread(
     IntPtr filename,
     CvEnum.LoadImageType loadType,
     IntPtr result);
Beispiel #6
0
 /// <summary>
 /// Loads an image from the specified file and returns the pointer to the loaded image. Currently the following file formats are supported:
 /// Windows bitmaps - BMP, DIB;
 /// JPEG files - JPEG, JPG, JPE;
 /// Portable Network Graphics - PNG;
 /// Portable image format - PBM, PGM, PPM;
 /// Sun rasters - SR, RAS;
 /// TIFF files - TIFF, TIF;
 /// OpenEXR HDR images - EXR;
 /// JPEG 2000 images - jp2.
 /// </summary>
 /// <param name="filename">The name of the file to be loaded</param>
 /// <param name="loadType">The image loading type</param>
 /// <returns>The loaded image</returns>
 public static Mat Imread(String filename, CvEnum.LoadImageType loadType)
 {
     return(new Mat(filename, loadType));
 }