alanlukezic / csr-dcf

Discriminative Correlation Filter with Channel and Spatial Reliability
226 stars 73 forks source link

Compile failure #9

Closed gby208127 closed 6 years ago

gby208127 commented 6 years ago

Hello Mr.Alan Lukežič, When i compiled the Compile.m function ,something wrong like this happened Building with 'Microsoft Visual C++ 2015'. Error using mex gradientMex.cpp C:\Users\Administrator\Desktop\csr-dcf-master\mex_src\hog\gradientMex.cpp(329): error C2664: “int mxSetDimensions_730(mxArray ,const size_t ,std::size_t)”: cannot convert from“const int [3]”to“const size_t ” C:\Users\Administrator\Desktop\csr-dcf-master\mex_src\hog\gradientMex.cpp(329): note: Irrelevant to the type of direction;Conversion requires reinterpret_cast, C style conversion, or function style conversion C:\Users\Administrator\Desktop\csr-dcf-master\mex_src\hog\gradientMex.cpp(339): warning C4267: “=”: From "size_t" to "int", may lose data C:\Users\Administrator\Desktop\csr-dcf-master\mex_src\hog\gradientMex.cpp(339): error C2440: “=”: cannot convert from“const size_t ”to“const int *” C:\Users\Administrator\Desktop\csr-dcf-master\mex_src\hog\gradientMex.cpp(339): note: Irrelevant to the type of direction;Conversion requires reinterpret_cast, C style conversion, or function style conversion

Error in compile (line 9) mex gradientMex.cpp the platform is MATLAB 2017b + VS2015+Opencv 2.4.13 so what should i do to fix it? thank you in advance

TobiasBoettger commented 6 years ago

change line 336 to

const unsigned __int64 *dims; int nDims;

and line 322 to

const unsigned __int64 dims[3]={h,w,d}, n=hwd; int b; mxArray* M;

and it should work.

gby208127 commented 6 years ago

it works, thanks for your reply!