简体   繁体   English

OpenCV错误:cvGetSize中的参数错误(数组应为CvMat或IplImage)

[英]OpenCV Error: Bad argument (Array should be CvMat or IplImage) in cvGetSize

I have successfully written a video processing program. 我已经成功编写了一个视频处理程序。 I used ubuntu and Netbeans for programming. 我使用ubuntu和Netbeans进行编程。 When I run this program on netbeans it runs perfectly and gives expected output. 当我在netbeans上运行该程序时,它可以完美运行并提供预期的输出。

I built executable file of this program both in debug and release mode and tried to run them in the command line. 我在调试和发布模式下都构建了该程序的可执行文件,并尝试在命令行中运行它们。 Now I get the following error. 现在,我收到以下错误。 But Netbeans doesn't complain about this. 但是Netbeans对此并不抱怨。 Could someone point out what might be the problem? 有人可以指出是什么问题吗?

OpenCV Error: Bad argument (Array should be CvMat or IplImage) in cvGetSize, file /home/<user>/trunk/opencv/modules/core/src/array.cpp, line 1238
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/<user>/trunk/opencv/modules/core/src/array.cpp:1238: error: (-5) Array should be CvMat or IplImage in function cvGetSize

thank you in advance 先感谢您

Can you check if the input argument to cvGetSize is: 您可以检查cvGetSize的输入参数是否为:

  1. a NULL pointer? 空指针? What is the result of querying/retrieving the frame? 查询/检索框架的结果是什么?
  2. a CvSeq? CvSeq?
  3. a 1- or 3-dimensional array? 一维或三维数组?

Usually it is the first. 通常它是第一个。

That's the way OpenCV talks to you - it's more often the runtime exception than a compiler error. 这就是OpenCV与您交谈的方式-它是运行时异常,而不是编译器错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM