This is a PHP extension wrapping the OpenCV library for image processing. It lets you use the OpenCV library for image recognition and modification tasks.
It requires PHP 5.3, and OpenCV 2.0 or above.
An OpenCV binding for PHP
i have installed open cv in /root/local directory but it gives error as error: Ooops ! no opencv detected in the system
please help provide some instructions on how to use it
Can someone provide guide how to use this
Hello
if I use the use OpenCV\Capture::createCameraCapture(0); on a webserver the, the process did't close the access to /dev/video if it is finished.
So a second call ist not possible in that case the device is busy,
On the CLI the files are all closed.
The OpenCV release function maybe help.
Best Regards
Torsten
Hi..thank you for this great extension. I'm trying to compile it, but failed.
I am using the following command :
and till end I got the following error message.
.....
/usr/home/benpptung/OpenCV-for-PHP/opencv_image.c: In function 'zim_OpenCV_Image_haarDetectObjects':
/usr/home/benpptung/OpenCV-for-PHP/opencv_image.c:766: error: too few arguments to function 'cvHaarDetectObjects'
I am using FreeBSD 8.2, and the OpenCV is 2.3.1, PHP is 5.3.8.
Is there any document how to install the php extension? Any help would be appreciated.
I've managed to install it once, on our internal test server.
But for some reason I can't get it to install on our production server. I have no idea why. It compiles without error, but make test throws the following error:
/usr/bin/php: symbol lookup error: /usr/src/Builds/OpenCV-for-PHP/modules/opencv.so: undefined symbol: cvSetErrMode
Any ideas what might cause this?
Hi,
I am installed last version of OpenCV (2.4.3) and compiled this extention on php 5.3.17, and if I try run php, i'am got this message: '/usr/lib/php/modules/opencv.so: undefined symbol: cvReleaseHist in Unknown on line 0', where is my problem?
I am on php7.0 and OpenCV 3.2.
/bin/bash /home/rumo/OpenCV-for-PHP/libtool --mode=compile g++ -I. -I/home/rumo/OpenCV-for-PHP -DPHP_ATOM_INC -I/home/rumo/OpenCV-for-PHP/include -I/home/rumo/OpenCV-for-PHP/main -I/home/rumo/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 /home/rumo/OpenCV-for-PHP/opencv.cpp -o opencv.lo
libtool: compile: g++ -I. -I/home/rumo/OpenCV-for-PHP -DPHP_ATOM_INC -I/home/rumo/OpenCV-for-PHP/include -I/home/rumo/OpenCV-for-PHP/main -I/home/rumo/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 /home/rumo/OpenCV-for-PHP/opencv.cpp -fPIC -DPIC -o .libs/opencv.o
/home/rumo/OpenCV-for-PHP/libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (ko_KR.UTF-8)
/bin/bash /home/rumo/OpenCV-for-PHP/libtool --mode=compile g++ -I. -I/home/rumo/OpenCV-for-PHP -DPHP_ATOM_INC -I/home/rumo/OpenCV-for-PHP/include -I/home/rumo/OpenCV-for-PHP/main -I/home/rumo/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 /home/rumo/OpenCV-for-PHP/opencv_error.cpp -o opencv_error.lo
libtool: compile: g++ -I. -I/home/rumo/OpenCV-for-PHP -DPHP_ATOM_INC -I/home/rumo/OpenCV-for-PHP/include -I/home/rumo/OpenCV-for-PHP/main -I/home/rumo/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 /home/rumo/OpenCV-for-PHP/opencv_error.cpp -fPIC -DPIC -o .libs/opencv_error.o
/home/rumo/OpenCV-for-PHP/libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (ko_KR.UTF-8)
/home/rumo/OpenCV-for-PHP/opencv_error.cpp: In function 'int zm_startup_opencv_error(int, int)':
/home/rumo/OpenCV-for-PHP/opencv_error.cpp:35:122: error: too many arguments to function 'zend_class_entry* zend_register_internal_class_ex(zend_class_entry*, zend_class_entry*)'
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 /home/rumo/OpenCV-for-PHP/php_opencv.h:25,
from /home/rumo/OpenCV-for-PHP/opencv_error.cpp: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);
^
Makefile:196: recipe for target 'opencv_error.lo' failed
make: *** [opencv_error.lo] Error 1
PHP Warning: PHP Startup: Unable to load dynamic library '/home/web/opencvphp/OpenCV-for-PHP/modules/opencv.so' - /home/web/opencvphp/OpenCV-for-PHP/modules/opencv.so: undefined symbol: cvReleaseHist in Unknown on line 0
running Ubuntu 14.04 x64
sudo apt-get install python-software-properties software-properties-common
(ppa for ffmpeg)
sudo apt-add-repository ppa:mc3man/trusty-media
sudo apt-get update
at this point I installed opencv-2.4.10 using the following method because sudo apt-get install opencv was not working, and I found no ppa that I could add that would make it work
also the below script did not run without issues, so I just ran the lines one at a time so I fould fix issues as I went, like the unzip package not being installed, etc:
https://help.ubuntu.com/community/OpenCV
git clone https://github.com/mgdm/OpenCV-for-PHP.git
cd OpenCV-for-PHP
phpize
./configure && make
make test (this is where I have the error)
opencv-2.4.10
PHP_VERSION : 5.5.9-1ubuntu4.5
ZEND_VERSION: 2.5.0
$ make test
Build complete.
Don't forget to run 'make test'.
PHP Warning: PHP Startup: Unable to load dynamic library '/home/web/opencvphp/OpenCV-for-PHP/modules/opencv.so' - /home/web/opencvphp/OpenCV-for-PHP/modules/opencv.so: undefined symbol: cvReleaseHist in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/home/web/opencvphp/OpenCV-for-PHP/modules/opencv.so' - /home/web/opencvphp/OpenCV-for-PHP/modules/opencv.so: undefined symbol: cvReleaseHist in Unknown on line 0
Could you please guide me how to integrate this into already exists project? Thanks.
Hi
I have built a Dockerfile for PHP-FPM 5.6.28 against OpenCV 2.3.1 here if it is of use to anyone.
Is there any support for windows OS
Hello
when i convert Image color to gray i get this error.
OpenCV Error: Assertion failed (dst.data == dst0.data) in cvCvtColor, file /home/abuild/rpmbuild/BUILD/opencv-2.4.6.1/modules/imgproc/src/color.cpp, line 3912
terminate called after throwing an instance of 'cv::Exception'
what(): /home/abuild/rpmbuild/BUILD/opencv-2.4.6.1/modules/imgproc/src/color.cpp:3912: error: (-215) dst.data == dst0.data in function cvCvtColor
when in run
use OpenCV\Image as Image;
/* Load the sample image */
$i = Image::load("test.jpg", Image::LOAD_IMAGE_COLOR);
$rgb = $i->convertColor(Image::RGB2GRAY);
i got this error
with Image::BGR2Luv,Image::BGR2HSV,Image::RGB2HSV,Image::RGB2YCrCb there is no error
I could load the image directly in gray with
$i = Image::load("test.jpg", Image::LOAD_IMAGE_GRAYSCALE);
but with Image::load("test.jpg", Image::LOAD_IMAGE_ANYDEPTH);
i got Fatal error: Undefined class constant 'LOAD_IMAGE_ANYDEPTH' :
Best Regards
Torsten
I want to use the latest openCV with the latest PHP, should I keep an eye on this extension ?
OpenCV Error: Unknown error code -25 (Bad input roi) in cvInitImageHeader, file
/builddir/build/BUILD/opencv-2.4.5/modules/core/src/array.cpp, line 2918
terminate called after throwing an instance of 'cv::Exception'
what(): /builddir/build/BUILD/opencv-2.4.5/modules/core/src/array.cpp:2918: e
rror: (-25) Bad input roi in function cvInitImageHeader
Hi,
just letting you know I'd like to use OpenCV-for-PHP given support for OpenCV 2.4 (need to use the new cv::FaceRecognizer).
How are chances for an update to OpenCV-for-PHP?
Cheers
Current license is "PHP". This license can't be used by anything but PHP itself.
Can you change the license to something else (Expat is a good candidate, or BSD-2-clause)?
Regards
More info:
how to get picture's and xml's resoure in this project example?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.