eroor System.NullReferenceException:未将对象引用设置为对象的实例。 [英] eroor System.NullReferenceException: Object reference not set to an instance of an object.

查看:619
本文介绍了eroor System.NullReferenceException:未将对象引用设置为对象的实例。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单击botton时,单击识别它会显示错误,如下所示:CameraCapture.exe中出现未处理的System.NullReferenceException类型的异常附加信息:对象引用未设置为对象的实例



部分:name = recognizer.Recognize(ExtFaces [faceNo])ToString()。; stringOutput [faceNo] = name;



这里是代码部分的链接:C# - Emgu CV - 面部识别代码在EigenObjectRecognizer停止执行并退出而没有错误



请帮助我非常感谢

hi when you click on botton Recognize it display a error as follows: An unhandled exception of type ''System.NullReferenceException'' occurred in CameraCapture.exe Additional information: Object reference not set to an instance of an object

in part: name = recognizer.Recognize (ExtFaces [faceNo]) ToString ().; stringOutput [faceNo] = name;

here is the link the code part: C# - Emgu CV - Face Recognition code stops execution at EigenObjectRecognizer and exit without error

please help me thank you very much

推荐答案

您知道错误信息的含义吗?这意味着当你调用Recognizer.Recognize(ExtFaces [faceNo])时,识别器为null,因此无法调用它。您应该阅读有关如何使用调试器的信息,以及通常关于此错误的含义,对象如何工作以及当对象为空时会发生什么,这是非常基本的编程内容。



现在,请确保您的对象不为空,或插入检查以确定它是否为,并相应地处理它。
Do you know what the error message means ? It means that when you call recognizer.Recognize (ExtFaces [faceNo]), recognizer is null and so no method can be called on it. You should read up on how to use the debugger, and also in general on what this error means, how objects work, and what happens when an object is null, this is very basic programming stuff.

For now, make sure your object is not null, or insert a check to see if it is, and deal with it accordingly.


这篇关于eroor System.NullReferenceException:未将对象引用设置为对象的实例。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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