rgbConvertMex change the 3rd dimesion from 3 to 48512332255694123 values
HamzaKhribi opened this issue · 6 comments
i'm having this error:
Error using convConst
A must be a 4x4 or bigger 2D or 3D float array.
while debugging the code i found out that I=160903 after calling rgbConvertMex become 160901277669775489321 and this is why Convcost show me this error.
how can i fix this error please
I got this error either.
Same here.
This problem is in recent version of Matlab. I managed to fix a similar problem but I don't remember the details. Is something related to the size of integers and matrix dimensions in the mex. The problem is in the types used (int instead of mwSize matlab defined type).
Finally found the change I did:
171,172c171
< const mwSize *dims; int nDims, n, d; void *I; void *J; int flag;
< mwSize dims1[3];
---
> const int *dims; int nDims, n, d, dims1[3]; void *I; void *J; int flag;
178c177
< dims = (const mwSize*) mxGetDimensions(pr[0]); n=dims[0]*dims[1];
---
> dims = (const int*) mxGetDimensions(pr[0]); n=dims[0]*dims[1];
Yo have to change other C/C++ files with the same idea. In my linux 64 bits the int is no longer valid in Matlab 2017b to represent a Matlab matrix and it should be changed by mwSize in several mex files in the toolbox.
You can find the changes I did in order to fix this issue to my own version of the toolbox here (a lot of .cpp files need to be changed):
https://github.com/jmbuena/toolbox.badacost.public
In this version we have added the detection with our BAdaCost algorithm (Cost-sensitive multi-class Boosting) from our Pattern Recognition 2018 paper.
Hope it will be useful.
Thanks, jmbuena
PR without BAdaCost #38