有没有办法将 OpenCV 与 PHP 集成?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5002895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:30:54  来源:igfitidea点击:

Is there any way to integrate OpenCV with PHP?

phpopencvintegrationintegrate

提问by Gustavo

I am trying to develop an application with PHP.

我正在尝试使用 PHP 开发应用程序。

There are two possible ways this application will be developed. The first one is to try to do something like www.picnik.com, image processing directly on the browser. The other is to develop CBIR (content-bases image retrieval) algorithms.

有两种可能的方式来开发这个应用程序。第一个是尝试做类似www.picnik.com 的事情,直接在浏览器上进行图像处理。另一种是开发CBIR(基于内容的图像检索)算法。

So, is it possible to send an image from a PHP script to an OpenCV program? Or even display the image being manipulated in real time?

那么,是否可以将图像从 PHP 脚本发送到 OpenCV 程序?或者甚至实时显示正在处理的图像?

Thanks.

谢谢。

回答by Brian

Doing a google search for 'php opencv' suggests - yes you can :)

谷歌搜索“php opencv”建议 - 是的,你可以:)

This one looks decent. http://www.xarg.org/project/php-facedetect/(I know it's specific to face detaction, but could be a good start-point for you).

这个看起来不错。http://www.xarg.org/project/php-facedetect/(我知道它特定于面部检测,但对您来说可能是一个很好的起点)。

Will only be doable if you're using your own server as needs lots of additional core stuff added.

只有在您使用自己的服务器时才可行,因为需要添加大量额外的核心内容。

回答by h0tw1r3

OpenCV for PHPis a new pecl module. Needs a little work to be complete, but a lot of work is already done.

OpenCV for PHP是一个新的 pecl 模块。需要做一点工作才能完成,但很多工作已经完成。

回答by TheCarver

there is another PHP face detection class here:

还有另外一个PHP的人脸检测类在这里

Apparently it doesn't work 100% on every photo, probably to do with the angle of the face etc, but I've heard good reports on it. I'm thinking about using it on my next project.

显然它在每张照片上都不是 100% 有效,可能与脸部角度等有关,但我听说过关于它的很好的报道。我正在考虑在我的下一个项目中使用它。

回答by binaryLV

Depends on both server restrictions and the target program. If server allows, you can run external programs and pass arguments to them.

取决于服务器限制和目标程序。如果服务器允许,您可以运行外部程序并将参数传递给它们。

These external programs are usually CLI programs, i.e., without GUI. Image would be passed as a path to an image file (rather than data about pixels), i.e., my_opencv_program -resize 1024x768 -infile /tmp/input.jpg -outfile /tmp/output.jpg.

这些外部程序通常是 CLI 程序,即没有 GUI。图像将作为图像文件的路径(而不是有关像素的数据)传递,即my_opencv_program -resize 1024x768 -infile /tmp/input.jpg -outfile /tmp/output.jpg.