如何为PHP安装OpenCV? [英] How do I install OpenCV for PHP?

查看:177
本文介绍了如何为PHP安装OpenCV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为PHP安装OpenCV,但是它不起作用.
https://github.com/mgdm/OpenCV-for-PHP
我做了以下

I'm trying to install OpenCV for PHP but it doesn't work.
https://github.com/mgdm/OpenCV-for-PHP
I did the following

已安装OpenCV

installed OpenCV

$ sudo aptitude安装libcv2.1

$ sudo aptitude install libcv2.1

试图为php安装opencv

tried to install opencv for php

$ sudo phpize&& ./configure&&制作&&进行安装

$ sudo phpize && ./configure && make && make install

试图使用它,但出现错误

tried to uses it and I got an error

$ php examples/test_convert.php

$ php examples/test_convert.php

php: symbol lookup error: /usr/lib/php5/20090626/opencv.so: undefined symbol: cvSetErrMode

我认为PHP的OpenCV需要OpenCV库地址,

I thought the OpenCV for PHP needs the OpenCV libs address,

$ ldd/usr/lib/php5/20090626/opencv.so
linux-vdso.so.1 =>(0x00007fff45de2000)
libc.so.6 =>/lib/x86_64-linux-gnu/libc.so.6(0x00007fd2d74c3000)
/lib64/ld-linux-x86-64.so.2(0x00007fd2d7a8a000)

$ ldd /usr/lib/php5/20090626/opencv.so
linux-vdso.so.1 => (0x00007fff45de2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd2d74c3000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd2d7a8a000)

所以我尝试了这个

$ phpize
$ ./configure
编辑Makefile
< OPENCV_SHARED_LIBADD =
> OPENCV_SHARED_LIBADD =/usr/lib/libcv.so.2.1
$ make
$ sudo make install

$ phpize
$ ./configure
edit Makefile
< OPENCV_SHARED_LIBADD =
> OPENCV_SHARED_LIBADD = /usr/lib/libcv.so.2.1
$ make
$ sudo make install

它仍然不起作用.
我正在使用Ubuntu11.04.
你有什么主意吗?

and it still doesnt work.
I'm using Ubuntu11.04.
Do you have any idea?

推荐答案

http://www .xarg.org/project/php-facedetect/是一个非常好的教程,可以在Linux机器上安装OpenCV,如果您对PHP& Apache Web Server本教程将为您提供很多帮助

http://www.xarg.org/project/php-facedetect/ is a very good tutorial to install OpenCV on linux machine, if you know a little about PHP & Apache Web Server this tutorial will help you a lot

收费

Umair Iqbal

Umair Iqbal

这篇关于如何为PHP安装OpenCV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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