s-gupta / rcnn-depth

Learning Rich Features from RGB-D Images for Object Detection and Segmentation
BSD 2-Clause "Simplified" License
365 stars 150 forks source link

Problem with joint_bilateral_mex.cpp #33

Closed manyaafonso closed 7 years ago

manyaafonso commented 7 years ago

I am trying to run the demo on Matlab 2017a on Linux Mint 18.

First while trying to build Imagestack, by running: cd eccv14-code/rgbdutils/imagestack/ , make all -j 16 I got the following error: /home/mafonso/rcnn-depth/eccv14-code/rgbdutils/imagestack/matlab/joint_bilateral_mex.cpp: In function ‘ImageStack::Image fromMat(const mxArray)’: /home/mafonso/rcnn-depth/eccv14-code/rgbdutils/imagestack/matlab/joint_bilateral_mex.cpp:25:43: error: cannot convert ‘const size_t {aka const long unsigned int}’ to ‘const int’ in initialization const int dims = mxGetDimensions(mxfeat); ^ /home/mafonso/rcnn-depth/eccv14-code/rgbdutils/imagestack/matlab/joint_bilateral_mex.cpp: In function ‘mxArray toMat(ImageStack::Window)’: /home/mafonso/rcnn-depth/eccv14-code/rgbdutils/imagestack/matlab/joint_bilateral_mex.cpp:55:72: error: cannot convert ‘int’ to ‘const size_t {aka const long unsigned int}’ for argument ‘2’ to ‘mxArray mxCreateNumericArray(size_t, const size_t, mxClassID, mxComplexity)’ mxArray mxfeat = mxCreateNumericArray(4, out, mxSINGLE_CLASS, mxREAL); ^ Makefile.common:113: recipe for target 'joint_bilateral_mex' failed make: *** [joint_bilateral_mex] Error 255

I manually changed the typecasting like this: const int dims = (int)mxGetDimensions(mxfeat); and then it got built. However, when I tried to run demo() I got the following error:

Unexpected unknown exception from MEX file..

Error in jointBilateral (line 16) aa = joint_bilateral_mex(single(II), single(refII), sigma1, sigma2);

Error in computeNormals>filterItChopOffIS (line 65) fFilt = jointBilateral(sp, f, 1, 1000);

Error in computeNormals (line 34) AtA = filterItChopOffIS(cat(3, AtARaw, AtbRaw), superpixels, disparity, sigmaSupport, sigmaSuperpixel, sigmaDisparity);

Error in wrapperComputeNormals (line 39) [N b] = computeNormals(X, Y, Z, disparity, missingMask, superpixels, sigmaSupport, sigmaDisparity, sigmaSuperpixel);

Error in yCues (line 11) [N, b, pc] = wrapperComputeNormals(double(D)./100, false(size(D)), 3, s, C);

Error in getAllCues (line 14) [y1, y2, y3, angl1, angl2] = yCues(D, C, 1);

Error in detectEdge (line 17) cues = getAllCues(Iin, Din, C, colorModel, opts.rgbd3opts.vars, cacheFile);

Error in run_all (line 13) [E, Es, O] = detectEdge(I, D, [], C, model, sc, [], []);

Error in demo (line 6) run_all(I, D, RD, C, out_file);

Has anyone else faced this problem?

manyaafonso commented 7 years ago

The solution is to use a flag for 32 bit compatibility while building the mex files.