问题
I have to use Face-eye detection algorithm by Zhu Ramanan in a web application. They have provided the code in Matlab and main computation is done in C++. Since I am new to image processing and matlab, i am not able to understand how to proceed on making it run with my web app.
I found that Matlab code can be ported to c++ by using coder function. So I tried using coder function in matlab which opened a Build menu wherein I selected C/C++ executable. But the build gets stuck when the code is loading a .mat file. It gives following error -
Function 'load' implicitly resolved in the MATLAB workspace. Implicit evaluation
in MATLAB is not supported. Please declare this function extrinsic using
coder.extrinsic('load'), or call it using feval.
But both coder.extrinsic and feval are not compatible with C++.
I also read about a possibility of executing matlab file from php but that would be a very slow process (please correct me if i am wrong).
Can anyone please suggest whether I am going wrong and/or how should I proceed.
回答1:
The code by Zhu and Ramanan uses a learned model to detect faces and fiducial points on them. The learned parameters are stored in a binary file of format mat
used by Matlab. It appears as if the coder cannot port the load
command that reads this file.
In order to fix this I'm afraid you'll have to get your hands a bit dirty. You'll need to replace the mat
file with a different format and change the code accordingly.
Read the mat
file in matlab using load
and convert it into a different format of your choosing. Change the code to read the new file using more basic commands (e.g., fopen
, fread
and the liking) then use the coder to port the modified code.
来源:https://stackoverflow.com/questions/20088797/use-zhu-ramanan-code-in-a-web-application