GithubHelp home page GithubHelp logo

opencv-for-php's Introduction

OpenCV for PHP

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.

opencv-for-php's People

Contributors

mgdm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencv-for-php's Issues

What's the latest version of OpenCV that will work? 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

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)

sudo make install (not ran this line yet)

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

Feature Request Capture::release

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

examples/test_template.php error

image

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

Error during make test of opencv.so

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?

undefined symbol: cvReleaseHist

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?

How to compile this extension?

Hi..thank you for this great extension. I'm trying to compile it, but failed.

I am using the following command :

phpize && ./configure && make && make install

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.

OpenCV 2.4 support

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

OpenCV Error: Assertion failed when use RGB2GRAY

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

OpenCV 3.2 , PHP7.0 support

image

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.