'Emgu.CV.CvInvoke'的类型初始值设定项引发了异常。 [英] The type initializer for 'Emgu.CV.CvInvoke' threw an exception.

查看:149
本文介绍了'Emgu.CV.CvInvoke'的类型初始值设定项引发了异常。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在行' image = new Image< bgr,byte>(OF.FileName)'中得到此异常'如何解决此异常?我已将 opencv dll 添加到项目中并且所有引用都是必需的但仍然出错。



< pre lang =xml> private void button1_Click(object sender,EventArgs e)
{
Image < Bgr, 字节 > img;
OpenFileDialog OF = new OpenFileDialog();

if(OF.ShowDialog()== System.Windows.Forms.DialogResult.OK)
{

img = new Image < Bgr, byte > (OF.FileName);
位图位=新位图(pictureBox2.Image);

解决方案

您一定要查看此例外的官方文档。



'Emgu.CV.CvInvoke'的类型初始值设定项引发了异常。 [ ^ ]


I am getting this exception in the line 'image=new Image<bgr,byte>(OF.FileName)' How to solve this exception? I have added the opencv dlls to the project and all the references required but still getting the error.

private void button1_Click(object sender, EventArgs e)
       {
           Image<Bgr, Byte> img;
           OpenFileDialog OF = new OpenFileDialog();

           if (OF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
           {

                   img = new Image<Bgr, byte>(OF.FileName);
                   Bitmap bit = new Bitmap(pictureBox2.Image);

解决方案

You should definitely check the official documentation on this Exception.

The type initializer for 'Emgu.CV.CvInvoke' threw an exception.[^]


这篇关于'Emgu.CV.CvInvoke'的类型初始值设定项引发了异常。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆