I'm currently working with mex matlab and OpenCV libraries. I'm using the results of the computation of HOG features, which is of type std::vector<float>, and need it as an output of the mex function.
I'm therefore trying to use the ocvMxArrayFromVector function, which is supposed to conver a vector of a given type to the required mxArray data type output.
The part of code I'm using is:
hog->compute(croppedImg, descriptorValues, Size(0,0), Size(0,0), locations);
plhs = ocvMxArrayFromVector(descriptorValues);
But when compiling it returns the following error:
Error using mexOpenCV (line 122)
/tmp/mex_1394440023880_2588/HOGDescriptorOCV.o: In function `computeHOGFeatures(int, mxArray_tag**, mxArray_tag
HOGDescriptorOCV.cpp:(.text+0xb24): undefined reference to `ocvMxArrayFromVector(std::vector<float,
std::allocator<float> > const&)'
collect2: error: ld returned 1 exit status
I'm compiling using g++ on an Ubuntu, matlab version R2016b.
I would be very thankful for your help.