Giter Site home page Giter Site logo

infusion / php-facedetect Goto Github PK

View Code? Open in Web Editor NEW
265.0 19.0 87.0 32 KB

A simple OpenCV wrapper for PHP to detect faces on images

Home Page: http://www.xarg.org/project/php-facedetect/

License: BSD 3-Clause "New" or "Revised" License

C 18.53% M4 13.58% JavaScript 6.39% C++ 61.50%

php-facedetect's Introduction

PHP-Facedetect

A simple OpenCV wrapper for PHP to detect faces on images

OpenCV 3 Support

See Details

php-facedetect's People

Contributors

denischatelain avatar infusion avatar jszanto avatar kwizart avatar reawebcrawlerplayer avatar remicollet avatar sathieu avatar tishotm avatar weltling 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

php-facedetect's Issues

Fail to install : undeclared identifier 'CV_VERSION'

Hello,

I try to install PHP-Facedetect on my Mac (OSX 10.11.1) but it fails.

I did install opencv3 using homebrew :

$ brew install opencv3 --with-contrib
$ brew link opencv3

Then tried to build the PHP-Facedetect extension

$ phpize && ./configure && make && make install
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/build/mkdep.awk: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/build/scan_makefile_in.awk: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/build/shtool: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/build/libtool.m4: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/acinclude.m4: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/Makefile.global: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/config.sub: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/config.guess: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/ltmain.sh: Permission denied
cp: /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/run-tests.php: Permission denied
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin15.0.0
checking host system type... x86_64-apple-darwin15.0.0
checking target system type... x86_64-apple-darwin15.0.0
checking for PHP prefix... /usr/local/Cellar/php56/5.6.15
checking for PHP includes... -I/usr/local/Cellar/php56/5.6.15/include/php -I/usr/local/Cellar/php56/5.6.15/include/php/main -I/usr/local/Cellar/php56/5.6.15/include/php/TSRM -I/usr/local/Cellar/php56/5.6.15/include/php/Zend -I/usr/local/Cellar/php56/5.6.15/include/php/ext -I/usr/local/Cellar/php56/5.6.15/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php56/5.6.15/lib/php/extensions/no-debug-non-zts-20131226
checking for PHP installed headers prefix... /usr/local/Cellar/php56/5.6.15/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for facedetect support... yes, shared
checking for facedetect in default path... found in /usr/local
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking /usr/local/include/opencv/cv.h usability... yes
checking /usr/local/include/opencv/cv.h presence... yes
checking for /usr/local/include/opencv/cv.h... yes
checking /usr/local/include/opencv/highgui.h usability... yes
checking /usr/local/include/opencv/highgui.h presence... yes
checking for /usr/local/include/opencv/highgui.h... yes
checking for cvLoad in -lopencv_core... yes
checking for cvHaarDetectObjects in -lopencv_objdetect... yes
./configure: line 4785: ,: command not found
checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
/bin/sh /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/libtool --mode=compile cc  -I. -I/Users/loranger/Developer/projects/automask/public/PHP-Facedetect -DPHP_ATOM_INC -I/Users/loranger/Developer/projects/automask/public/PHP-Facedetect/include -I/Users/loranger/Developer/projects/automask/public/PHP-Facedetect/main -I/Users/loranger/Developer/projects/automask/public/PHP-Facedetect -I/usr/local/Cellar/php56/5.6.15/include/php -I/usr/local/Cellar/php56/5.6.15/include/php/main -I/usr/local/Cellar/php56/5.6.15/include/php/TSRM -I/usr/local/Cellar/php56/5.6.15/include/php/Zend -I/usr/local/Cellar/php56/5.6.15/include/php/ext -I/usr/local/Cellar/php56/5.6.15/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/facedetect.c -o facedetect.lo
mkdir .libs
 cc -I. -I/Users/loranger/Developer/projects/automask/public/PHP-Facedetect -DPHP_ATOM_INC -I/Users/loranger/Developer/projects/automask/public/PHP-Facedetect/include -I/Users/loranger/Developer/projects/automask/public/PHP-Facedetect/main -I/Users/loranger/Developer/projects/automask/public/PHP-Facedetect -I/usr/local/Cellar/php56/5.6.15/include/php -I/usr/local/Cellar/php56/5.6.15/include/php/main -I/usr/local/Cellar/php56/5.6.15/include/php/TSRM -I/usr/local/Cellar/php56/5.6.15/include/php/Zend -I/usr/local/Cellar/php56/5.6.15/include/php/ext -I/usr/local/Cellar/php56/5.6.15/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/loranger/Developer/projects/automask/public/PHP-Facedetect/facedetect.c  -fno-common -DPIC -o .libs/facedetect.o
/Users/loranger/Developer/projects/automask/public/PHP-Facedetect/facedetect.c:69:48: error: use of
      undeclared identifier 'CV_VERSION'; did you mean 'CV_MEDIAN'?
        php_info_print_table_row(2, "OpenCV version", CV_VERSION);
                                                      ^~~~~~~~~~
                                                      CV_MEDIAN
/usr/local/include/opencv2/imgproc/types_c.h:80:5: note: 'CV_MEDIAN' declared here
    CV_MEDIAN =3,
    ^
1 error generated.
make: *** [facedetect.lo] Error 1

Did I miss something important ?
Do you have any clue for me ?

Thanks

missing tags and versions

could you please tag and version your extension. i'm trying to package it into distribution

i.e git tag and push it to github, so tagged release tarballs could be downloaded

Error 500 when trying to detect a face

Hi,

after some couple of hours I managed to install everything on my Debian Wheezy.
But I receive following error, no matter which cascade I'm trying to load

OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file /root/opencv-2.4.9/modules/core/src/persistence.cpp, line 4991
terminate called after throwing an instance of 'cv::Exception'
  what():  /root/opencv-2.4.9/modules/core/src/persistence.cpp:4991: error: (-2) The node does not represent a user object (unknown type?) in function cvRead

Do you have any idea whats going on? There are hundreds of poeple with this issue but only workarounds for java - not php. Any idea? PHP 5.4 on Debian Wheezy, (fgci)

face_count & face_detect not working

Hi,

i have installed all like you wrote and the facedetect class is also in my php.ini but if I want to try it with

var_dump(face_count('1_1.jpeg', 'haarcascade_frontalface_alt.xml'));
var_dump(face_detect('1_1.jpeg', 'haarcascade_frontalface_alt.xml'));

I only see bool(false) bool(false) nothing else. I have tried it with several pictures.
I don't know where mistake is.

PHP.ini shows:
facedetect
facedetect support enabled
facedetect version 1.1.0
OpenCV version 2.4.3

execution time

i have the problem that "haarcascade_profileface" runs sometimes very long...

is there a way to limit the execution time of a call?

Face recognition support

It would be nice to have a face recognition feature after face detection so we can compare faces between images (detect / train / recognize).

configure: error: wrong OpenCV version or OpenCV not found

I had installed the latest version from the repository

but yet when i run ./configure i get this error

checking /usr/local/include/opencv/cv.h usability... yes
checking /usr/local/include/opencv/cv.h presence... yes
checking for /usr/local/include/opencv/cv.h... yes
checking /usr/local/include/opencv/highgui.h usability... yes
checking /usr/local/include/opencv/highgui.h presence... yes
checking for /usr/local/include/opencv/highgui.h... yes
checking for cvLoad in -lopencv_objdetect... no
configure: error: wrong OpenCV version or OpenCV not found

Any solutions?

feature request: OpenCV 3

They say OpenCV 3 has great improvements regarding face recognition. It would be great to see how it works with OpenCV 3.

./configure failed

hi,

i have install the latest version of OpenCV but i cant complete ./configure ...

checking /usr/include/opencv/cv.h usability... yes
checking /usr/include/opencv/cv.h presence... yes
checking for /usr/include/opencv/cv.h... yes
checking /usr/include/opencv/highgui.h usability... yes
checking /usr/include/opencv/highgui.h presence... yes
checking for /usr/include/opencv/highgui.h... yes
checking for cvLoad in -lopencv_objdetect... no
configure: error: wrong OpenCV version or OpenCV not found

root@severnaya> ls -l /usr/lib | grep opencv_objdetect 2
lrwxrwxrwx 1 root root 26 Dec 20 20:14 libopencv_objdetect.so -> libopencv_objdetect.so.2.3
lrwxrwxrwx 1 root root 28 Dec 20 20:14 libopencv_objdetect.so.2.3 -> libopencv_objdetect.so.2.3.1
-rwxr-xr-x 1 root root 366K Dec 20 20:14 libopencv_objdetect.so.2.3.1

checking for opencv... configure: error: Please reinstall opencv

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

Ubuntu 16.04 / PHP 7.2 / Python 2.7.12 / OpenCV 3.4.0

Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20170718
checking for PHP installed headers prefix... /usr/include/php/20170718
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... gawk
checking for facedetect support... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for pkg-config... no
checking for opencv... configure: error: Please reinstall opencv

FreeBSD 10 Segmentation fault

After installation when i have include facedetect.so into php.ini and reboot php-fpm:

Starting php_fpm.
Segmentation fault (core dumped)
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm

OpenCV 4.1.2 and PHP-Facedetect

Hello.

this problem is happening. Has anyone managed to make it work? I am using debian testing (pureOS byzantium). on debian buster (pureOS amber) it is 100%. debian testing upgraded from version 3.2 to version 4.1.2 of OpenCV and facedetect broke.

Thanks.

Captura de tela de 2020-01-28 07-42-53

Compile error with PHP 7.2

Hello,

I'm currently running CentOS 7, OpenCV 3.4.3, and PHP 7.2 (remi). configure goes through no issues but it fails to build the module. Any suggestions?

[root@raiden PHP-Facedetect]# ./configure --with-php-config=/opt/remi/php72/root/usr/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/remi/php72/root/usr
checking for PHP includes... -I/opt/remi/php72/root/usr/include/php -I/opt/remi/php72/root/usr/include/php/main -I/opt/remi/php72/root/usr/include/php/TSRM -I/opt/remi/php72/root/usr/include/php/Zend -I/opt/remi/php72/root/usr/include/php/ext -I/opt/remi/php72/root/usr/include/php/ext/date/lib
checking for PHP extension directory... /opt/remi/php72/root/usr/lib64/php/modules
checking for PHP installed headers prefix... /opt/remi/php72/root/usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for facedetect support... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for pkg-config... /usr/bin/pkg-config
checking for opencv... 3.4.3
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
[root@raiden PHP-Facedetect]# make
/bin/sh /usr/local/src/PHP-Facedetect/libtool --mode=compile g++  -I. -I/usr/local/src/PHP-Facedetect -DPHP_ATOM_INC -I/usr/local/src/PHP-Facedetect/include -I/usr/local/src/PHP-Facedetect/main -I/usr/local/src/PHP-Facedetect -I/opt/remi/php72/root/usr/include/php -I/opt/remi/php72/root/usr/include/php/main -I/opt/remi/php72/root/usr/include/php/TSRM -I/opt/remi/php72/root/usr/include/php/Zend -I/opt/remi/php72/root/usr/include/php/ext -I/opt/remi/php72/root/usr/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/PHP-Facedetect/facedetect.cc -o facedetect.lo 
libtool: compile:  g++ -I. -I/usr/local/src/PHP-Facedetect -DPHP_ATOM_INC -I/usr/local/src/PHP-Facedetect/include -I/usr/local/src/PHP-Facedetect/main -I/usr/local/src/PHP-Facedetect -I/opt/remi/php72/root/usr/include/php -I/opt/remi/php72/root/usr/include/php/main -I/opt/remi/php72/root/usr/include/php/TSRM -I/opt/remi/php72/root/usr/include/php/Zend -I/opt/remi/php72/root/usr/include/php/ext -I/opt/remi/php72/root/usr/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/PHP-Facedetect/facedetect.cc  -fPIC -DPIC -o .libs/facedetect.o
In file included from /opt/remi/php72/root/usr/include/php/Zend/zend_types.h:27:0,
                 from /opt/remi/php72/root/usr/include/php/Zend/zend.h:29,
                 from /opt/remi/php72/root/usr/include/php/main/php.h:35,
                 from /usr/local/src/PHP-Facedetect/facedetect.cc:24:
/opt/remi/php72/root/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_increment_function(zval*)':
/opt/remi/php72/root/usr/include/php/Zend/zend_operators.h:446:68: error: '__builtin_saddl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
                                                                    ^
/opt/remi/php72/root/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/opt/remi/php72/root/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_decrement_function(zval*)':
/opt/remi/php72/root/usr/include/php/Zend/zend_operators.h:500:68: error: '__builtin_ssubl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
                                                                    ^
/opt/remi/php72/root/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/opt/remi/php72/root/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_add_function(zval*, zval*, zval*)':
/opt/remi/php72/root/usr/include/php/Zend/zend_operators.h:554:80: error: '__builtin_saddl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
                                                                                ^
/opt/remi/php72/root/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/opt/remi/php72/root/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_sub_function(zval*, zval*, zval*)':
/opt/remi/php72/root/usr/include/php/Zend/zend_operators.h:657:80: error: '__builtin_ssubl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
                                                                                ^
/opt/remi/php72/root/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
make: *** [facedetect.lo] Error 1
[root@raiden PHP-Facedetect]# 

OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead

OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file /home/work/env/cv/opencv/modules/core/src/persistence.cpp, line 4976
terminate called after throwing an instance of 'cv::Exception'
what(): /home/work/env/cv/opencv/modules/core/src/persistence.cpp:4976: error: (-2) The node does not represent a user object (unknown type?) in function cvRead

Magick: abort due to signal 6 (SIGABRT) "Abort"...
Aborted

test code:

$detect_result = face_detect('./lena512color.jpg', './haarcascade_frontalcatface_extended.xml');
var_dump($detect_result);

@TishoTM @weltling @infusion thanks~!

PHP Startup: Unable to load dynamic library !

Whenever I try to restart apache now I get the following error:

  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/facedetect.so' - /usr/lib/php5/20131226/facedetect.so: undefined symbol: cvLoadImage in Unknown on line 0

  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/facedetect.so' - /usr/lib/php5/20131226/facedetect.so: undefined symbol: cvLoadImage in Unknown on line 0

  AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2e configured -- resuming normal operations

An ofcourse it won't work since it wasn't loaded !! Any clue what went wrong ?

PHP Version 5.6.17
OpenCV Verison 3.1.0

PHP7

Hello,

I was able to compile this extension for PHP 7 using opencv3 on osx and debian jessie.
I had to

wget https://github.com/Itseez/opencv/raw/master/modules/objdetect/include/opencv2/objdetect/objdetect_c.h -O /usr/local/include/opencv2/objdetect/objdetect_c.h

in order to pass the ./configure step, and then the facedetect.so compiled, but I cannot use it :

As soon as I try to face_detect I get this fatal error :

symbol lookup error: /usr/lib/php/20151012/facedetect.so: undefined symbol: MAKE_STD_ZVAL

Is this a “normal” bug related to PHP7 and PHP-Facdetect ?

configure: error: 'opencv/objdetect/objdetect_c.h' header not found

i have install the 2.4.5-3.e17 of OpenCV and 2.4.5-3.e17 of OpenCV-devel but i cant complete ./configure ...
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking /usr/include/opencv2/core/core_c.h usability... yes
checking /usr/include/opencv2/core/core_c.h presence... yes
checking for /usr/include/opencv2/core/core_c.h... yes
checking /usr/include/opencv2/imgproc/imgproc_c.h usability... yes
checking /usr/include/opencv2/imgproc/imgproc_c.h presence... yes
checking for /usr/include/opencv2/imgproc/imgproc_c.h... yes
checking /usr/include/opencv2/photo/photo_c.h usability... yes
checking /usr/include/opencv2/photo/photo_c.h presence... yes
checking for /usr/include/opencv2/photo/photo_c.h... yes
checking /usr/include/opencv2/objdetect/objdetect_c.h usability... no
checking /usr/include/opencv2/objdetect/objdetect_c.h presence... no
checking for /usr/include/opencv2/objdetect/objdetect_c.h... no
configure: error: 'opencv/objdetect/objdetect_c.h' header not found

I use centos7

checking for cvLoad in -lopencv_objdetect... no || configure: error: wrong OpenCV version or OpenCV not found

I had installed the latest version from the repository

but yet when i run ./configure i get this error

checking /usr/local/include/opencv/cv.h usability... yes
checking /usr/local/include/opencv/cv.h presence... yes
checking for /usr/local/include/opencv/cv.h... yes
checking /usr/local/include/opencv/highgui.h usability... yes
checking /usr/local/include/opencv/highgui.h presence... yes
checking for /usr/local/include/opencv/highgui.h... yes
checking for cvLoad in -lopencv_objdetect... no
configure: error: wrong OpenCV version or OpenCV not found

Any solutions?

Error ./configure php 7.2 opencv 3.4.3

#include "php.h"

Giving a list of zend errors.

from /home/vagrant/PHP-Facedetect/facedetect.cc:24:
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_increment_function(zval*)':
/usr/include/php/Zend/zend_operators.h:446:68: error: '__builtin_saddl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
                                                                    ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_decrement_function(zval*)':
/usr/include/php/Zend/zend_operators.h:500:68: error: '__builtin_ssubl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
                                                                    ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_add_function(zval*, zval*, zval*)':
/usr/include/php/Zend/zend_operators.h:554:80: error: '__builtin_saddl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
                                                                                ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_sub_function(zval*, zval*, zval*)':
/usr/include/php/Zend/zend_operators.h:657:80: error: '__builtin_ssubl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
                                                                                ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)

OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?))

Ubuntu 18
PHP 7.2
Nginx: 1.15
Python: 3.6.5
OpenCV 3.2.0 : python3-opencv : https://packages.ubuntu.com/bionic/python3-opencv
OpenCV 3.2.0 data: https://packages.ubuntu.com/bionic/opencv-data
PHP facedetect: https://packages.ubuntu.com/bionic/php-facedetect

face_detect('image.jpg', '/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml');

generates 502 Bad Gateway with the following logs.

[07-Oct-2018 09:53:28] WARNING: [pool www] child 16390 said into stderr: "OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/persistence.cpp, line 6628"
[07-Oct-2018 09:53:28] WARNING: [pool www] child 16390 said into stderr: "terminate called after throwing an instance of '"
[07-Oct-2018 09:53:28] WARNING: [pool www] child 16390 said into stderr: "cv::Exception"
[07-Oct-2018 09:53:28] WARNING: [pool www] child 16390 said into stderr: "'"
[07-Oct-2018 09:53:28] WARNING: [pool www] child 16390 said into stderr: "  what():  "
[07-Oct-2018 09:53:28] WARNING: [pool www] child 16390 said into stderr: "/build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/persistence.cpp:6628: error: (-2) The node does not represent a user object (unknown type?) in function cvRead"
[07-Oct-2018 09:53:28] WARNING: [pool www] child 16390 said into stderr: ""
[07-Oct-2018 09:53:28] WARNING: [pool www] child 16390 exited on signal 6 (SIGABRT - core dumped) after 1472.259994 seconds from start
[07-Oct-2018 09:53:28] NOTICE: [pool www] child 17184 started

error message while ./configure

Hi..today, I'm trying to compile this great extension, but got the following error message

checking /usr/local/include/opencv/cv.h usability... no
checking /usr/local/include/opencv/cv.h presence... no
checking for /usr/local/include/opencv/cv.h... no
configure: error: 'opencv/cv.h' header not found

I've installed opencv 2.3.1 on my FreeBSD 8.2 box by using FreeBSD port tree, while checking /usr/local/include/opencv/cv.h, the header is exist there. I have no idea what's wrong, do you have any advice?

thank you / Ben

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.