在Web应用程序中使用Zhu Ramanan代码 [英] Use Zhu Ramanan code in a web application

查看:302
本文介绍了在Web应用程序中使用Zhu Ramanan代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在 Zhu Ramanan 使用人脸检测算法web应用程序。他们在Matlab中提供了代码,主要的计算在C ++中完成。由于我是新的图像处理和matlab,我不能理解如何继续使其与我的网络应用程序运行。



我发现Matlab代码可以通过使用编码器功能移植到c ++。所以我试着在Matlab中使用编码器函数,打开一个Build菜单,其中我选择了C / C ++可执行文件。但是当代码加载.mat文件时,构建会被阻塞。它给出以下错误 -

 在MATLAB工作空间中隐式解析函数'load'。不支持在MATLAB中隐式求值
。请使用
coder.extrinsic('load')声明这个外部函数,或者使用feval调用它。

但是coder.extrinsic和feval都不兼容C ++。



我也读过关于从php执行matlab文件的可能性,但这将是一个非常缓慢的过程(如果我错了,请纠正我)。


解决方案

任何人都可以建议我是否会出错和/或我应该如何处理。使用学习的 模型来检测面部和它们上的基准点。学习的参数存储在Matlab使用的格式 mat 的二进制文件中。看起来好像编码器不能移植读取此文件的 load 命令。



为了解决这个问题恐怕你得把你的手弄脏了。您需要使用不同的格式替换 mat 文件,并相应地更改代码。

阅读 mat 文件在matlab中使用加载并将其转换为您选择的不同格式。使用更基本的命令(例如, fopen fread 和喜欢)更改代码以读取新文件,然后使用编码器端口修改的代码。


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.

解决方案

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.

这篇关于在Web应用程序中使用Zhu Ramanan代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆