|
发表于 2010-9-28 09:44:14
|
显示全部楼层
EMCV cvCopy调用出错
程序部分代码
printf("the grayImg width= %d, height = %d\\n", grayImg->width, grayImg->height);
printf("the tmpImg width= %d, height = %d\\n", tmpImg->width, tmpImg->height);
printf("copy begin\\n");
cvCopy(grayImg, tmpImg, NULL);
printf("copy end\\n");
交叉编译通过
在DSP上运行输出:
the grayImg width= 360, height = 288
the tmpImg width= 360, height = 288
copy begin
OpenCV ERROR: Formats of input arguments do not match ()
in function cvCopy, ./cxcopy.cpp(89)
Terminating the application...
jiance: ./cxerror.cpp:318: void cvError(int, const char*, const char*, const char*, int).
Killed
通过源码查看cxcopy.cpp(89)如下:
75 /* dst = src */
76 CV_IMPL void
77 cvCopy( const void* srcarr, void* dstarr, const void* maskarr )
78 {
79 CV_FUNCNAME( "cvCopy" );
80
81 __BEGIN__;
82
83 int pix_size;
84 CvMat *src = (CvMat*)srcarr;
85 CvMat *dst = (CvMat*)dstarr;
86 CvSize size;
87
88 if( !CV_IS_MAT(src) || !CV_IS_MAT(dst) ) //这里出错,但是我给的两个参数都相同啊,为什么?
89 CV_ERROR_FROM_CODE( CV_StsUnmatchedFormats );
90
91 if( !CV_ARE_TYPES_EQ( src, dst ))
92 CV_ERROR_FROM_CODE( CV_StsUnmatchedFormats );
93
94 if( !CV_ARE_SIZES_EQ( src, dst ))
95 CV_ERROR_FROM_CODE( CV_StsUnmatchedSizes );
96
97 size = cvGetMatSize( src );
98 pix_size = CV_ELEM_SIZE(src->type);
谢谢各位大虾相助。
排版!!! |
|