簡體   English   中英

Emgu CV bitmap 到圖像不再有效

[英]Emgu CV bitmap to image no longer working

我經常使用 emguCV。 但是現在,我為.Net 下載了最新的 CV3 庫,並且在將 bitmap 轉換為圖像時從未遇到過問題。 現在我的代碼不再工作,構造函數 Image 不再將 bitmap 作為參數。

        Bitmap bitmap = Sources.GetBitmap();
        Image<Bgr, byte> source = new Image<Bgr, byte>(bitmap);

有什么解決方法嗎?

從 Emgu 版本 4.2.0 開始,沒有以位圖作為參數的 Image 構造函數。

現在,根據變更日志( http://www.emgu.com/wiki/index.php/Version_History )有位圖的擴展方法。 所以現在,你必須像這樣將位圖轉換為圖像:

    Bitmap bitmap = Sources.GetBitmap();
    var Image = bitmap.ToImage<Bgr, byte>();

您需要參考單獨的 package Emgu.CV.Bitmap,然后 110mat110 的答案才有效。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM