|
发表于 2010-2-4 15:20:58
|
显示全部楼层
EMCV:可在DSP上运行的OpenCV
由 chenjun0420 » 2008-07-02 19:36
大家好 我把这个opencv函数可以在我的板子上运行了(瑞泰公司的一款ICETEK-DM642-B的开发板)
首先感谢于老师和chai2010 的帮助
我总结一下错误 一共我遇到的有三处:
1 cxmisc.h的第 233行
CvSize cvGetMatSize(const CvMat* mat)
{
CvSize size = {mat->width,mat->height};
return size;
}出现 这个错误 error: expression must have a constant value
我把mat->width,mat->height用 mat->cols,mat->rows;代替就好了
2在cxtypes.h 的第192行
CV_INLINE int cvFloor( double value )
{
return int(floor(value));
}
出现这个错误 error: expected an expression
改正如下
CV_INLINE int cvFloor( double value )
{
int a = floor(value);
return a;
}
3在cxmisc.h中 line 219
CV_INLINE void* cvAlignPtr( const void* ptr, int align=32)
{
assert( (align & (align-1)) == 0 );
return (void*)(((size_t)ptr + align - 1) & (~(size_t)(align-1)) );
}
函数名那块是 219行 出现了个这样的错误error: expected a ")",
把那个 align 的缺省值 删掉就正确了。
以上是我在用到过程中的3个问题的解决方法,希望对用到的人有用。
另外我要做的是在dsp上进行人脸检测,用cv的adaboost算法,就是用cv的检测目标函数,请问于老师你也在做这个吗?我也会努力的,若果你有更新请及时发到论坛上,谢谢于老师!
因为cvCanny是在cv.h声明的,所以我在.C文件#include "cv.h",然后在下面调用cvCanny函数。工程里添加定义cvCanny的C++源文件:cvcanny.cpp(这个是从opencv直接拷过来的)。编译也遇到了上面的三个问题,后两个问题按照chenjun提到的修改方法,都改过来了。就是第一个错误,没改之前是:- --------------------------- canny_emcv.pjt - Debug ---------------------------
- [cvcanny.cpp] "C:\\CCStudio_v3.3\\C6000\\cgtools\\bin\\cl6x" -g -fr"C:/CCStudio_v3.3/MyProjects/canny_emcv/Debug" -i"C:/dvevm_1_20/xdais_5_10/packages/ti/xdais/dm" -i"C:/dvevm_1_20/xdais_5_10/packages/ti/xdais" -i"C:/dvevm_1_20/codec_engine_1_10_01/packages/ti/sdo/ce/trace" -i"C:/dvevm_1_20/dvevm_1_20/cg6x_6_0_14/include" -d"_DEBUG" -mv6400 -@"Debug.lkf" "cvcanny.cpp"
- [vidpro.c] "C:\\CCStudio_v3.3\\C6000\\cgtools\\bin\\cl6x" -g -fr"C:/CCStudio_v3.3/MyProjects/canny_emcv/Debug" -i"C:/dvevm_1_20/xdais_5_10/packages/ti/xdais/dm" -i"C:/dvevm_1_20/xdais_5_10/packages/ti/xdais" -i"C:/dvevm_1_20/codec_engine_1_10_01/packages/ti/sdo/ce/trace" -i"C:/dvevm_1_20/dvevm_1_20/cg6x_6_0_14/include" -d"_DEBUG" -mv6400 -@"Debug.lkf" "vidpro.c"
- "cxmisc.h", line 235: error: expression must have a constant value
- "cxmisc.h", line 235: error: expression must have a constant value
- "cxmisc.h", line 724: warning: typedef name has already been declared (with same type)
- "cxmisc.h", line 755: warning: typedef name has already been declared (with same type)
- "vidpro.c", line 310: warning: variable "ce" was set but never used
- 2 errors detected in the compilation of "vidpro.c".
- >> Compilation failure
- Build Complete,
- 2 Errors, 3 Warnings, 0 Remarks.
复制代码
按照chenjun改完之后还有错误:- [cvcanny.cpp] "C:\\CCStudio_v3.3\\C6000\\cgtools\\bin\\cl6x" -g -fr"C:/CCStudio_v3.3/MyProjects/canny_emcv/Debug" -i"C:/dvevm_1_20/xdais_5_10/packages/ti/xdais/dm" -i"C:/dvevm_1_20/xdais_5_10/packages/ti/xdais" -i"C:/dvevm_1_20/codec_engine_1_10_01/packages/ti/sdo/ce/trace" -i"C:/dvevm_1_20/dvevm_1_20/cg6x_6_0_14/include" -d"_DEBUG" -mv6400 -@"Debug.lkf" "cvcanny.cpp"
- [vidpro.c] "C:\\CCStudio_v3.3\\C6000\\cgtools\\bin\\cl6x" -g -fr"C:/CCStudio_v3.3/MyProjects/canny_emcv/Debug" -i"C:/dvevm_1_20/xdais_5_10/packages/ti/xdais/dm" -i"C:/dvevm_1_20/xdais_5_10/packages/ti/xdais" -i"C:/dvevm_1_20/codec_engine_1_10_01/packages/ti/sdo/ce/trace" -i"C:/dvevm_1_20/dvevm_1_20/cg6x_6_0_14/include" -d"_DEBUG" -mv6400 -@"Debug.lkf" "vidpro.c"
- "cxmisc.h", line 236: error: expression must have a constant value
- "cxmisc.h", line 236: error: expression must have a constant value
- "cxmisc.h", line 725: warning: typedef name has already been declared (with same type)
- "cxmisc.h", line 756: warning: typedef name has already been declared (with same type)
- "vidpro.c", line 310: warning: variable "ce" was set but never used
- 2 errors detected in the compilation of "vidpro.c".
- >> Compilation failure
- Build Complete,
- 2 Errors, 3 Warnings, 0 Remarks.
复制代码 cxmisc.h相应代码如下:- 233 CV_INLINE CvSize cvGetMatSize( const CvMat* mat )
- 234 {
- 235 // CvSize size = { mat->width, mat->height };
- 236 CvSize size = { mat->cols, mat->rows };
- 237 // CvSize size = {mat->rows,mat->cols};
- 238 return size;
- 239 }
复制代码
请各位老师、同学、高手指教! |
|