引用: ??
http://www.cnblogs.com/oskycar/archive/2009/08/30/1556920.html
VS2013?
在debug模式下編譯cvaux時(shí)會(huì)提示三個(gè)錯(cuò)誤:
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'
error C2039: 'foreground_regions' : is not a member of? 'CvFGDStatModel'
error C2039: 'foreground_regions' : is not a member of? 'CvGaussBGModel'
在網(wǎng)上搜到的解決方法都是這樣寫(xiě)的:
在cvaux.h文件中,
搜索關(guān)鍵字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*/
CvMemStorage* storage; /*storage for 揻oreground_regions ?/ ?\
CvSeq* foreground_regions /*foreground object contours*/
改為如下形式:
CvMemStorage* storage; /*storage for foreground_regions */ ?\
CvSeq* foreground_regions /*foreground object contours*/
具體原因解釋如下:首先f(wàn)oreground_regions 定義在這個(gè)宏里面:
#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*/
??? 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*/
“\”在這里代表續(xù)行的意思。并且注意前面定義的變量后面都有“;”號(hào),而foreground_regions沒(méi)有,因?yàn)樗沁@個(gè)定義的最后一項(xiàng),因?yàn)楹甓x末尾是不加‘;’號(hào)的。
另外要注意的是,千萬(wàn)不要在修改最后兩行時(shí)寫(xiě)成這個(gè)樣子:???
?CvMemStorage*?? storage;????? /*storage for 揻oreground_regions?*/????????????? \
??? CvSeq*????????? foreground_regions /*foreground object contours*/
即不能放入空行,因?yàn)檫@樣一來(lái)foreground_regions就不屬于宏定義中的一份了。而
'CvFGDStatModel'
和
'CvGaussBGModel'
中均包含了改宏,所以錯(cuò)誤會(huì)照舊的。偶剛開(kāi)始就犯了這個(gè)錯(cuò)誤,還以為是各位高手犯錯(cuò)誤了呢。呵呵
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
