delete include config.h and check HAVE_OPENCV_FACE
Esse commit está contido em:
+20
-19
@@ -118,25 +118,26 @@ result:
|
||||
|
||||
|
||||
## Features
|
||||
- 1.calib3d
|
||||
- 2.contrib
|
||||
- 3.core
|
||||
- 4.imgproc
|
||||
- 5.features2d
|
||||
- 6.flann
|
||||
- 7.gpu
|
||||
- 8.highgui
|
||||
- 9.legacy
|
||||
- 10.ml
|
||||
- 11.nonfree
|
||||
- 12.objdetect
|
||||
- 13.ocl
|
||||
- 14.photo
|
||||
- 15.stitching
|
||||
- 16.superres
|
||||
- 17.ts
|
||||
- 18.video
|
||||
- 19.Videostab
|
||||
- [x]1.[core](http://phpopencv.org/zh-cn/docs/mat.html)
|
||||
- [x]2.[imgproc](http://phpopencv.org/zh-cn/docs/gausian_median_blur_bilateral_filter.html)
|
||||
- [ ]3.highgui
|
||||
- [ ]4.contrib
|
||||
- [ ]5.features2d
|
||||
- [ ]6.flann
|
||||
- [ ]7.gpu
|
||||
- [ ]8.calib3d
|
||||
- [ ]9.legacy
|
||||
- [ ]10.ml
|
||||
- [ ]11.nonfree
|
||||
- [ ]12.objdetect
|
||||
- [ ]13.ocl
|
||||
- [ ]14.photo
|
||||
- [ ]15.stitching
|
||||
- [ ]16.superres
|
||||
- [ ]17.ts
|
||||
- [ ]18.video
|
||||
- [ ]19.Videostab
|
||||
|
||||
|
||||
|
||||
## Contributors
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php_opencv.h"
|
||||
#include "zend_exceptions.h"
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
#include "../../../../php_opencv.h"
|
||||
#include "opencv_interface.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
void opencv_interface_init(int module_number)
|
||||
{
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
#include "../../../php_opencv.h"
|
||||
#include "opencv_base.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
void opencv_border_types_init(int module_number){
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "../../../php_opencv.h"
|
||||
#include "opencv_mat.h"
|
||||
@@ -366,6 +363,7 @@ PHP_METHOD(opencv_mat, copy_to)
|
||||
}
|
||||
|
||||
/**
|
||||
* //todo int,fload,double
|
||||
* CV\Mat->at
|
||||
* @param execute_data
|
||||
* @param return_value
|
||||
@@ -399,10 +397,13 @@ PHP_METHOD(opencv_mat, at)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
//set px value
|
||||
convert_to_long(value_zval);
|
||||
zend_long value = Z_LVAL_P(value_zval);
|
||||
switch(this_object->mat->depth()){
|
||||
case CV_8U:
|
||||
switch (this_object->mat->channels()){
|
||||
case 1:
|
||||
this_object->mat->at<uchar>((int)row,(int)col) = saturate_cast<uchar>(value);
|
||||
@@ -420,6 +421,28 @@ PHP_METHOD(opencv_mat, at)
|
||||
opencv_throw_exception("Get Mat px only channel in 1,2,3,4.");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
switch (this_object->mat->channels()){
|
||||
case 1:
|
||||
this_object->mat->at<uchar>((int)row,(int)col) = saturate_cast<char>(value);
|
||||
break;
|
||||
case 2:
|
||||
this_object->mat->at<Vec2b>((int)row,(int)col)[channel]=saturate_cast<char>(value);
|
||||
break;
|
||||
case 3:
|
||||
this_object->mat->at<Vec3b>((int)row,(int)col)[channel]=saturate_cast<char>(value);
|
||||
break;
|
||||
case 4:
|
||||
this_object->mat->at<Vec4b>((int)row,(int)col)[channel]=saturate_cast<char>(value);
|
||||
break;
|
||||
default:
|
||||
opencv_throw_exception("Get Mat px only channel in 1,2,3,4.");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "../../../php_opencv.h"
|
||||
#include "opencv_type.h"
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "../../../php_opencv.h"
|
||||
#include "opencv_utility.h"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "opencv_facerec.h"
|
||||
#include "../opencv_face.h"
|
||||
#include "../core/opencv_mat.h"
|
||||
|
||||
@@ -16,7 +16,4 @@
|
||||
|
||||
#include "../../../php_opencv.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
#include "../../opencv_exception.h"
|
||||
#include "core/opencv_type.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
zend_class_entry *opencv_formatter_ce;
|
||||
|
||||
|
||||
@@ -15,10 +15,14 @@
|
||||
*/
|
||||
|
||||
#include "opencv_face.h"
|
||||
#include "face/opencv_facerec.h"
|
||||
|
||||
zend_class_entry *opencv_face_recognizer_ce;
|
||||
|
||||
#ifdef HAVE_OPENCV_FACE
|
||||
|
||||
#include "face/opencv_facerec.h"
|
||||
|
||||
|
||||
/**
|
||||
* opencv_face_recognizer_methods[]
|
||||
*/
|
||||
@@ -39,3 +43,12 @@ void opencv_face_init(int module_number){
|
||||
opencv_lbph_face_recognizer_init(module_number);
|
||||
opencv_base_face_recognizer_init(module_number);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void opencv_face_init(int module_number){
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
#include "../../opencv_exception.h"
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* //todo only cli can call this function
|
||||
@@ -134,7 +131,7 @@ opencv_fcall_info_cb * opencv_fcall_info_cb_create(zend_fcall_info *fci_ptr, zen
|
||||
|
||||
memcpy(cb->fci, fci_ptr, sizeof(zend_fcall_info));
|
||||
memcpy(cb->fci_cache, fci_cache_ptr, sizeof(zend_fcall_info_cache));
|
||||
Z_TRY_ADDREF(cb->fci->function_name);
|
||||
Z_TRY_ADDREF(cb->fci->function_name);//todo 滑动调或窗口销毁是释放内存
|
||||
cb->fci->param_count = 0;
|
||||
cb->fci->no_separation = 1;
|
||||
cb->fci->retval = NULL;
|
||||
@@ -178,9 +175,7 @@ PHP_FUNCTION(opencv_create_trackbar){
|
||||
&fci, &fci_cache) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
int *trackbar_value_ptr = new int(value);
|
||||
|
||||
opencv_fcall_info_cb *cb = opencv_fcall_info_cb_create(&fci, &fci_cache);
|
||||
createTrackbar(trackbarname, winname, trackbar_value_ptr, (int)count,opencv_create_trackbar_callback,cb);
|
||||
RETURN_NULL();
|
||||
@@ -207,7 +202,7 @@ PHP_FUNCTION(opencv_get_track_bar_pos){
|
||||
char *trackbarname, *winname;
|
||||
long trackbarname_len, winname_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &trackbarname, &trackbarname_len, &winname, &winname_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &trackbarname, &trackbarname_len, &winname, &winname_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
RETURN_LONG(getTrackbarPos(trackbarname, winname))
|
||||
|
||||
@@ -24,6 +24,13 @@ PHP_FUNCTION(opencv_imshow);
|
||||
PHP_FUNCTION(opencv_wait_key);
|
||||
PHP_FUNCTION(opencv_move_window);
|
||||
PHP_FUNCTION(opencv_named_window);
|
||||
ZEND_BEGIN_ARG_INFO_EX(opencv_create_trackbar_arginfo, 0, 0, 5)
|
||||
ZEND_ARG_INFO(0, trackbarname)
|
||||
ZEND_ARG_INFO(0, winname)
|
||||
ZEND_ARG_INFO(1, value)
|
||||
ZEND_ARG_INFO(0, count)
|
||||
ZEND_ARG_INFO(0, onChange)
|
||||
ZEND_END_ARG_INFO()
|
||||
PHP_FUNCTION(opencv_create_trackbar);
|
||||
PHP_FUNCTION(opencv_destroy_window);
|
||||
PHP_FUNCTION(opencv_get_track_bar_pos);
|
||||
|
||||
@@ -26,6 +26,7 @@ void opencv_imgproc_init(int module_number)
|
||||
{
|
||||
opencv_color_conversion_code_init(module_number);
|
||||
opencv_line_type_init(module_number);
|
||||
opencv_morph_shapes(module_number);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1247,3 +1248,9 @@ void opencv_line_type_init(int module_number){
|
||||
REGISTER_NS_LONG_CONSTANT(OPENCV_NS, "LINE_8", LINE_8, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_NS_LONG_CONSTANT(OPENCV_NS, "LINE_AA", LINE_AA, CONST_CS | CONST_PERSISTENT);
|
||||
}
|
||||
|
||||
void opencv_morph_shapes(int module_number){
|
||||
REGISTER_NS_LONG_CONSTANT(OPENCV_NS, "MORPH_RECT", MORPH_RECT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_NS_LONG_CONSTANT(OPENCV_NS, "MORPH_CROSS", MORPH_CROSS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_NS_LONG_CONSTANT(OPENCV_NS, "MORPH_ELLIPSE", MORPH_ELLIPSE, CONST_CS | CONST_PERSISTENT);
|
||||
}
|
||||
@@ -20,6 +20,7 @@
|
||||
void opencv_imgproc_init(int module_number);
|
||||
void opencv_color_conversion_code_init(int module_number);
|
||||
void opencv_line_type_init(int module_number);
|
||||
void opencv_morph_shapes(int module_number);
|
||||
PHP_FUNCTION(opencv_cv_t_color);
|
||||
PHP_FUNCTION(opencv_ellipse);
|
||||
PHP_FUNCTION(opencv_circle);
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário