SelectiveSearchCodeIJCV遇到First two input arguments should have the same 2D dimension

SelectiveSearchCodeIJCV遇到First two input arguments should have the same 2D dimension

 

在windows 10+visual studio環境下運行SelectiveSearchCodeIJCV中的demo.m難免會出現下列錯誤

-----------------------

if(~exist('mexFelzenSegmentIndex','var'))

-----------------------


錯誤使用 CountVisualWordsIndex (line 21)
First two input arguments should have the same 2D dimension


出錯 BlobStructColourHist


出錯 Image2HierarchicalGrouping (line 42)
[colourHist blobSizes] = BlobStructColourHist(blobIndIm, colourIm);


出錯 demo (line 61)
[boxes blobIndIm blobBoxes hierarchy] = Image2HierarchicalGrouping(im, sigma, k, minSize, colorType,

simFunctionHandles);

原因是:Dependencies/FelzenSegment/mexFelzenSegmentIndex.cpp

 行149:int* dims = (int*) mxGetDimensions(input[0]); 

中int的問題。

方法一:

把demo.m中mex  Dependencies/FelzenSegment/mexFelzenSegmentIndex.cpp -output mexFelzenSegmentIndex;

改爲

mex -compatibleArrayDims Dependencies/FelzenSegment/mexFelzenSegmentIndex.cpp -output mexFelzenSegmentIndex;

因爲在 mex -compatibleArrayDims下mwSize纔等於C中的int。

方法二:

直接將

int* dims = (int*) mxGetDimensions(input[0]); 

改爲跨平臺使用的數據類型mwSize

mwSize* dims = (mwSize*) mxGetDimensions(input[0]);

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章