分享

VC++ 6.0 编译 opencv1.0 中 cvaux.dll的3个错误原因

 启蒙彩魂 2011-03-26

VC++ 6.0 编译 opencv1.0 中 cvaux.dll的3个错误原因

默认分类 2010-02-25 06:03:15 阅读36 评论0   字号: 订阅

在debug模式下编译cvaux时会提示三个错误:
error C2039: 'foreground_regions' : is not a member of 'CvFGDStatModel'

error C2039: 'foreground_regions' : is not a member of 'CvFGDStatModel'

error C2039: 'foreground_regions' : is not a member of 'CvGaussBGModel'
在网上搜到的解决方法都是这样写的:
在cvaux.h文件中,
搜索关键字foreground_regions,

CvMemStorage* storage; /*storage for 揻oreground_regions?/ \
CvSeq* foreground_regions /*foreground object contours*/

改为如下形式:

CvMemStorage* storage; /*storage for foreground_regions*/ \
CvSeq* foreground_regions /*foreground object contours*/
具体原因解释如下:首先foreground_regions 定义在这个宏里面:
#define CV_BG_STAT_MODEL_FIELDS()                                                   \
    int             type; /*type of BG model*/                                      \
    CvReleaseBGStatModel release;                                                   \
    CvUpdateBGStatModel update;                                                     \
    IplImage*       background;   /*8UC3 reference background image*/               \
    IplImage*       foreground;   /*8UC1 foreground image*/                         \
    IplImage**      layers;       /*8UC3 reference background image, can be null */ \
    int             layer_count; /* can be zero */                                 \
    CvMemStorage*   storage;      /*storage for 揻oreground_regions?*/              \
    CvSeq*          foreground_regions /*foreground object contours*/
“\”在这里代表续行的意思。并且注意前面定义的变量后面都有“;”号,而foreground_regions没有,因为它是这个定义的最后一项,因为宏定义末尾是不加‘;’号的。
另外要注意的是,千万不要在修改最后两行时写成这个样子:   
CvMemStorage*   storage;      /*storage for 揻oreground_regions?*/              \

    CvSeq*          foreground_regions /*foreground object contours*/
即不能放入空行,因为这样一来foreground_regions就不属于宏定义中的一份了。而'CvFGDStatModel''CvGaussBGModel'中均包含了改宏,所以错误会照旧的。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多