delete include config.h and check HAVE_OPENCV_FACE
Esse commit está contido em:
+20
-19
@@ -118,25 +118,26 @@ result:
|
|||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- 1.calib3d
|
- [x]1.[core](http://phpopencv.org/zh-cn/docs/mat.html)
|
||||||
- 2.contrib
|
- [x]2.[imgproc](http://phpopencv.org/zh-cn/docs/gausian_median_blur_bilateral_filter.html)
|
||||||
- 3.core
|
- [ ]3.highgui
|
||||||
- 4.imgproc
|
- [ ]4.contrib
|
||||||
- 5.features2d
|
- [ ]5.features2d
|
||||||
- 6.flann
|
- [ ]6.flann
|
||||||
- 7.gpu
|
- [ ]7.gpu
|
||||||
- 8.highgui
|
- [ ]8.calib3d
|
||||||
- 9.legacy
|
- [ ]9.legacy
|
||||||
- 10.ml
|
- [ ]10.ml
|
||||||
- 11.nonfree
|
- [ ]11.nonfree
|
||||||
- 12.objdetect
|
- [ ]12.objdetect
|
||||||
- 13.ocl
|
- [ ]13.ocl
|
||||||
- 14.photo
|
- [ ]14.photo
|
||||||
- 15.stitching
|
- [ ]15.stitching
|
||||||
- 16.superres
|
- [ ]16.superres
|
||||||
- 17.ts
|
- [ ]17.ts
|
||||||
- 18.video
|
- [ ]18.video
|
||||||
- 19.Videostab
|
- [ ]19.Videostab
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|||||||
@@ -17,9 +17,6 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "php_opencv.h"
|
#include "php_opencv.h"
|
||||||
#include "zend_exceptions.h"
|
#include "zend_exceptions.h"
|
||||||
|
|||||||
@@ -17,10 +17,6 @@
|
|||||||
#include "../../../../php_opencv.h"
|
#include "../../../../php_opencv.h"
|
||||||
#include "opencv_interface.h"
|
#include "opencv_interface.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void opencv_interface_init(int module_number)
|
void opencv_interface_init(int module_number)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,9 +17,6 @@
|
|||||||
#include "../../../php_opencv.h"
|
#include "../../../php_opencv.h"
|
||||||
#include "opencv_base.h"
|
#include "opencv_base.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void opencv_border_types_init(int module_number){
|
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 "../../../php_opencv.h"
|
||||||
#include "opencv_mat.h"
|
#include "opencv_mat.h"
|
||||||
@@ -366,6 +363,7 @@ PHP_METHOD(opencv_mat, copy_to)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* //todo int,fload,double
|
||||||
* CV\Mat->at
|
* CV\Mat->at
|
||||||
* @param execute_data
|
* @param execute_data
|
||||||
* @param return_value
|
* @param return_value
|
||||||
@@ -386,10 +384,10 @@ PHP_METHOD(opencv_mat, at)
|
|||||||
this_object->mat->at<uchar>((int)row,(int)col);
|
this_object->mat->at<uchar>((int)row,(int)col);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
RETURN_LONG(this_object->mat->at<Vec2b>((int)row,(int)col)[channel]);
|
RETURN_LONG(this_object->mat->at<Vec2b>((int)row,(int)col)[channel]);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
RETURN_LONG(this_object->mat->at<Vec3b>((int)row,(int)col)[channel]);
|
RETURN_LONG(this_object->mat->at<Vec3b>((int)row,(int)col)[channel]);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
RETURN_LONG(this_object->mat->at<Vec4b>((int)row,(int)col)[channel]);
|
RETURN_LONG(this_object->mat->at<Vec4b>((int)row,(int)col)[channel]);
|
||||||
@@ -399,27 +397,52 @@ PHP_METHOD(opencv_mat, at)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
//set px value
|
//set px value
|
||||||
convert_to_long(value_zval);
|
convert_to_long(value_zval);
|
||||||
zend_long value = Z_LVAL_P(value_zval);
|
zend_long value = Z_LVAL_P(value_zval);
|
||||||
switch (this_object->mat->channels()){
|
switch(this_object->mat->depth()){
|
||||||
case 1:
|
case CV_8U:
|
||||||
this_object->mat->at<uchar>((int)row,(int)col) = saturate_cast<uchar>(value);
|
switch (this_object->mat->channels()){
|
||||||
break;
|
case 1:
|
||||||
case 2:
|
this_object->mat->at<uchar>((int)row,(int)col) = saturate_cast<uchar>(value);
|
||||||
this_object->mat->at<Vec2b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
|
break;
|
||||||
break;
|
case 2:
|
||||||
case 3:
|
this_object->mat->at<Vec2b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
|
||||||
this_object->mat->at<Vec3b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
|
break;
|
||||||
break;
|
case 3:
|
||||||
case 4:
|
this_object->mat->at<Vec3b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
|
||||||
this_object->mat->at<Vec4b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
|
break;
|
||||||
|
case 4:
|
||||||
|
this_object->mat->at<Vec4b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
opencv_throw_exception("Get Mat px only channel in 1,2,3,4.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
opencv_throw_exception("Get Mat px only channel in 1,2,3,4.");
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
RETURN_NULL();
|
RETURN_NULL();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
+----------------------------------------------------------------------+
|
+----------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../../../php_opencv.h"
|
#include "../../../php_opencv.h"
|
||||||
#include "opencv_type.h"
|
#include "opencv_type.h"
|
||||||
|
|||||||
@@ -15,9 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../../../php_opencv.h"
|
#include "../../../php_opencv.h"
|
||||||
#include "opencv_utility.h"
|
#include "opencv_utility.h"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "opencv_facerec.h"
|
#include "opencv_facerec.h"
|
||||||
#include "../opencv_face.h"
|
#include "../opencv_face.h"
|
||||||
#include "../core/opencv_mat.h"
|
#include "../core/opencv_mat.h"
|
||||||
|
|||||||
@@ -16,7 +16,4 @@
|
|||||||
|
|
||||||
#include "../../../php_opencv.h"
|
#include "../../../php_opencv.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#include "../../opencv_exception.h"
|
#include "../../opencv_exception.h"
|
||||||
#include "core/opencv_type.h"
|
#include "core/opencv_type.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
zend_class_entry *opencv_formatter_ce;
|
zend_class_entry *opencv_formatter_ce;
|
||||||
|
|
||||||
|
|||||||
@@ -15,10 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opencv_face.h"
|
#include "opencv_face.h"
|
||||||
#include "face/opencv_facerec.h"
|
|
||||||
|
|
||||||
zend_class_entry *opencv_face_recognizer_ce;
|
zend_class_entry *opencv_face_recognizer_ce;
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCV_FACE
|
||||||
|
|
||||||
|
#include "face/opencv_facerec.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* opencv_face_recognizer_methods[]
|
* opencv_face_recognizer_methods[]
|
||||||
*/
|
*/
|
||||||
@@ -38,4 +42,13 @@ void opencv_face_init(int module_number){
|
|||||||
opencv_face_recognizer_init(module_number);
|
opencv_face_recognizer_init(module_number);
|
||||||
opencv_lbph_face_recognizer_init(module_number);
|
opencv_lbph_face_recognizer_init(module_number);
|
||||||
opencv_base_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"
|
#include "../../opencv_exception.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* //todo only cli can call this function
|
* //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, fci_ptr, sizeof(zend_fcall_info));
|
||||||
memcpy(cb->fci_cache, fci_cache_ptr, sizeof(zend_fcall_info_cache));
|
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->param_count = 0;
|
||||||
cb->fci->no_separation = 1;
|
cb->fci->no_separation = 1;
|
||||||
cb->fci->retval = NULL;
|
cb->fci->retval = NULL;
|
||||||
@@ -178,9 +175,7 @@ PHP_FUNCTION(opencv_create_trackbar){
|
|||||||
&fci, &fci_cache) == FAILURE) {
|
&fci, &fci_cache) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int *trackbar_value_ptr = new int(value);
|
int *trackbar_value_ptr = new int(value);
|
||||||
|
|
||||||
opencv_fcall_info_cb *cb = opencv_fcall_info_cb_create(&fci, &fci_cache);
|
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);
|
createTrackbar(trackbarname, winname, trackbar_value_ptr, (int)count,opencv_create_trackbar_callback,cb);
|
||||||
RETURN_NULL();
|
RETURN_NULL();
|
||||||
@@ -207,7 +202,7 @@ PHP_FUNCTION(opencv_get_track_bar_pos){
|
|||||||
char *trackbarname, *winname;
|
char *trackbarname, *winname;
|
||||||
long trackbarname_len, winname_len;
|
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;
|
||||||
}
|
}
|
||||||
RETURN_LONG(getTrackbarPos(trackbarname, winname))
|
RETURN_LONG(getTrackbarPos(trackbarname, winname))
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ PHP_FUNCTION(opencv_imshow);
|
|||||||
PHP_FUNCTION(opencv_wait_key);
|
PHP_FUNCTION(opencv_wait_key);
|
||||||
PHP_FUNCTION(opencv_move_window);
|
PHP_FUNCTION(opencv_move_window);
|
||||||
PHP_FUNCTION(opencv_named_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_create_trackbar);
|
||||||
PHP_FUNCTION(opencv_destroy_window);
|
PHP_FUNCTION(opencv_destroy_window);
|
||||||
PHP_FUNCTION(opencv_get_track_bar_pos);
|
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_color_conversion_code_init(module_number);
|
||||||
opencv_line_type_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_8", LINE_8, CONST_CS | CONST_PERSISTENT);
|
||||||
REGISTER_NS_LONG_CONSTANT(OPENCV_NS, "LINE_AA", LINE_AA, 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_imgproc_init(int module_number);
|
||||||
void opencv_color_conversion_code_init(int module_number);
|
void opencv_color_conversion_code_init(int module_number);
|
||||||
void opencv_line_type_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_cv_t_color);
|
||||||
PHP_FUNCTION(opencv_ellipse);
|
PHP_FUNCTION(opencv_ellipse);
|
||||||
PHP_FUNCTION(opencv_circle);
|
PHP_FUNCTION(opencv_circle);
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário