zoukankan      html  css  js  c++  java
  • Emgu.CV怎么加载Bitmap

     EmguCV 在4.0.1版本之后没办法用Bitmap创建Image了。 我给大家说下 EmguCV怎么加载Bitmap

    下边是 EmguCV 官方文档写的,意思是从4.0.1以后的版本不能直接Bitmap创建Image跟Mat了,bitmap被移到了Emgu.CV.UI拓展方法里。

    我们首先要用nuget安装Emgu.CV.UI,然后就能使用拓展方法了。

    废话不说 直接上代码了!

    Bitmap bitmap = null;//声明你的bitmap
    Image<Gray, byte> grayimage = BitmapExtension.ToImage<Gray, byte>(bitmap);

    哈哈,就是这样两句就能用 Bitmap创建Emgu的Image了,是不是很简单!

     

    • 4.2.0 is based on the Open CV 4.2.0 release
    • The Emgu.CV dll is now targeting .NetStandard 2.0 instead of .Net 3.5
    • The Emgu.CV.UI dll is now targeting .Net 4.6.1 instead of .Net 3.5
    • The nuget package structures has been changed. Emgu.CV nuget package < 4.2.0 contains both the .Net 3.5 dll and the native dll for Windows. Starting from 4.2.0, Emgu.CV nuget package will contain only the .NetStandard 2.0 profile dll. The native dll comes in separate packages for different platforms. e.g. The Emgu.CV.runtime.windows package contains the native dll for Windows as well as the Emgu.CV.UI dll for Windows when targeting .netframework 4.6.1+. The Emgu.CV-CUDA nuget package has been replaced with Emgu.CV.runtime.windows.cuda nuget package.
    • Open CV CUDA DNN module required Compute 5.3 and higher. Our cuda build not longer build with cuda compute bin option < 5.3.
    • Conversion between Mat, UMat, GpuMat and Image<,> and Bitmap objects requires code changes. The constructors of the Mat, UMat, GpuMat and Image<,> that accepts Bitmap has been removed. It has been added to the Emgu.CV.UI.dll file as an extension method. The dll is part of the Emgu.CV.runtime.windows (or the similar Emgu.CV.runtime.windows.cuda) nuget pacakge. Prior to v4.2.0 this code can be use to create a Mat from Bitmap
    每天进步一点点。
  • 相关阅读:
    团队项目第二阶段冲刺第六天
    团队项目冲刺第二阶段第五天
    团队项目冲刺第二阶段第四天
    团队项目冲刺第二阶段第三天
    大道至简阅读笔记1
    团队项目冲刺第二阶段第二天
    团队项目第二阶段冲刺第一天
    团队项目冲刺第九天
    团队项目冲刺第八天
    团队项目冲刺第七天
  • 原文地址:https://www.cnblogs.com/snow-zhang/p/13763029.html
Copyright © 2011-2022 走看看