OpenCV-for-PHP
OpenCV-for-PHP copied to clipboard
How to use this
Can someone provide guide how to use this
echo "Install OpenCV dependencies" sudo apt-get install build-essential unzip sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
echo "Install OpenCV from source" wget https://github.com/Itseez/opencv/archive/2.4.13.zip unzip opencv-2.4.13.zip cd ./opencv-2.4.13/ mkdir build cd ./build cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. sudo make -j7 sudo make install
echo "Enable PHP extension" sudo echo "extension=opencv.so" >> /etc/php5/mods-available/opencv.ini sudo ln -s /etc/php5/mods-available/opencv.ini /etc/php5/cli/conf.d/20-opencv.ini sudo ln -s /etc/php5/mods-available/opencv.ini /etc/php5/apache2/conf.d/20-opencv.ini
Hello @manti-by Alexander, Should I include this in a .sh file and run ? Also I assume your system has the default LAMP package for Ubuntu and not XAMPP .. please confirm. Thanks in advance!
Regards Miltan
Hi @miltan. You can simply paste this into shell or create sh script. Yes, I'm using Ubuntu 15.10 on my PC and Ubuntu 14.04 on Vagrant. In both cases these commands are working.
Thanks a lot Alexander @manti-by , Really appreciate your prompt reply :+1:
@miltan Here is my bootstrap script for Vagrant https://github.com/manti-by/m2/blob/manti-by-dev/bootstrap.sh.
Thanks @manti-by , can you tell me if I can compare a list of facial images to find out a match using opencv ?
@miltan Maybe yes, but for this purposes I'm using this library https://github.com/jenssegers/imagehash
Hello @manti-by , i follow this installation but i can't use OpenCV in the examples
use OpenCV\Image as Image;
use OpenCV\Histogram as Histogram;
how can i get OpenCV dependencies please
Hi @mouradtritux. Try to use this tutorial https://github.com/manti-by/m2/blob/manti-by-dev/bootstrap.sh#L22, should work on Ubuntu 14.04.
Working example https://github.com/manti-by/m2/blob/manti-by-dev/app/includes/system.php#L599.
thanks @manti-by
I have errors when i excute "make" command
/var/www/html/OpenCV-for-PHP$ make /bin/bash /var/www/html/OpenCV-for-PHP/libtool --mode=compile cc -I. -I/var/www/html/OpenCV-for-PHP -DPHP_ATOM_INC -I/var/www/html/OpenCV-for-PHP/include -I/var/www/html/OpenCV-for-PHP/main -I/var/www/html/OpenCV-for-PHP -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/usr/local/include/opencv -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /var/www/html/OpenCV-for-PHP/opencv_error.c -o opencv_error.lo libtool: compile: cc -I. -I/var/www/html/OpenCV-for-PHP -DPHP_ATOM_INC -I/var/www/html/OpenCV-for-PHP/include -I/var/www/html/OpenCV-for-PHP/main -I/var/www/html/OpenCV-for-PHP -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/usr/local/include/opencv -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /var/www/html/OpenCV-for-PHP/opencv_error.c -fPIC -DPIC -o .libs/opencv_error.o /var/www/html/OpenCV-for-PHP/opencv_error.c: In function 'zm_startup_opencv_error': /var/www/html/OpenCV-for-PHP/opencv_error.c:37:2: error: too many arguments to function 'zend_register_internal_class_ex' opencv_ce_cvexception = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), "Exception" TSRMLS_CC); ^ In file included from /usr/include/php/20151012/main/php.h:40:0, from /var/www/html/OpenCV-for-PHP/opencv_error.c:25: /usr/include/php/20151012/Zend/zend_API.h:290:28: note: declared here ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce); ^ make: *** [opencv_error.lo] Erreur 1
Please show me guild install on mac os. Thanks
@manti-by https://github.com/manti-by/m2/blob/manti-by-dev/bootstrap.sh#L22 and https://github.com/manti-by/m2/blob/manti-by-dev/app/includes/system.php#L599 is not available!
@tomfriwel Try to check master branch