Skip to content

Commit 98ff72b

Browse files
committed
delete include config.h and check HAVE_OPENCV_FACE
1 parent 9b09e31 commit 98ff72b

15 files changed

+94
-68
lines changed

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,26 @@ result:
118118

119119

120120
## Features
121-
- 1.calib3d
122-
- 2.contrib
123-
- 3.core
124-
- 4.imgproc
125-
- 5.features2d
126-
- 6.flann
127-
- 7.gpu
128-
- 8.highgui
129-
- 9.legacy
130-
- 10.ml
131-
- 11.nonfree
132-
- 12.objdetect
133-
- 13.ocl
134-
- 14.photo
135-
- 15.stitching
136-
- 16.superres
137-
- 17.ts
138-
- 18.video
139-
- 19.Videostab
121+
- [x]1.[core](http://phpopencv.org/zh-cn/docs/mat.html)
122+
- [x]2.[imgproc](http://phpopencv.org/zh-cn/docs/gausian_median_blur_bilateral_filter.html)
123+
- [ ]3.highgui
124+
- [ ]4.contrib
125+
- [ ]5.features2d
126+
- [ ]6.flann
127+
- [ ]7.gpu
128+
- [ ]8.calib3d
129+
- [ ]9.legacy
130+
- [ ]10.ml
131+
- [ ]11.nonfree
132+
- [ ]12.objdetect
133+
- [ ]13.ocl
134+
- [ ]14.photo
135+
- [ ]15.stitching
136+
- [ ]16.superres
137+
- [ ]17.ts
138+
- [ ]18.video
139+
- [ ]19.Videostab
140+
140141

141142

142143
## Contributors

opencv_exception.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717

1818
/* $Id$ */
1919

20-
#ifdef HAVE_CONFIG_H
21-
#include "config.h"
22-
#endif
2320

2421
#include "php_opencv.h"
2522
#include "zend_exceptions.h"

source/opencv2/core/hal/opencv_interface.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
#include "../../../../php_opencv.h"
1818
#include "opencv_interface.h"
1919

20-
#ifdef HAVE_CONFIG_H
21-
#include "config.h"
22-
#endif
23-
2420

2521
void opencv_interface_init(int module_number)
2622
{

source/opencv2/core/opencv_base.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
#include "../../../php_opencv.h"
1818
#include "opencv_base.h"
1919

20-
#ifdef HAVE_CONFIG_H
21-
#include "config.h"
22-
#endif
2320

2421

2522
void opencv_border_types_init(int module_number){

source/opencv2/core/opencv_mat.cc

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
19-
#endif
2017

2118
#include "../../../php_opencv.h"
2219
#include "opencv_mat.h"
@@ -366,6 +363,7 @@ PHP_METHOD(opencv_mat, copy_to)
366363
}
367364

368365
/**
366+
* //todo int,fload,double
369367
* CV\Mat->at
370368
* @param execute_data
371369
* @param return_value
@@ -386,10 +384,10 @@ PHP_METHOD(opencv_mat, at)
386384
this_object->mat->at<uchar>((int)row,(int)col);
387385
break;
388386
case 2:
389-
RETURN_LONG(this_object->mat->at<Vec2b>((int)row,(int)col)[channel]);
387+
RETURN_LONG(this_object->mat->at<Vec2b>((int)row,(int)col)[channel]);
390388
break;
391389
case 3:
392-
RETURN_LONG(this_object->mat->at<Vec3b>((int)row,(int)col)[channel]);
390+
RETURN_LONG(this_object->mat->at<Vec3b>((int)row,(int)col)[channel]);
393391
break;
394392
case 4:
395393
RETURN_LONG(this_object->mat->at<Vec4b>((int)row,(int)col)[channel]);
@@ -399,27 +397,52 @@ PHP_METHOD(opencv_mat, at)
399397
break;
400398
}
401399

400+
402401
}else{
403402
//set px value
404403
convert_to_long(value_zval);
405404
zend_long value = Z_LVAL_P(value_zval);
406-
switch (this_object->mat->channels()){
407-
case 1:
408-
this_object->mat->at<uchar>((int)row,(int)col) = saturate_cast<uchar>(value);
409-
break;
410-
case 2:
411-
this_object->mat->at<Vec2b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
412-
break;
413-
case 3:
414-
this_object->mat->at<Vec3b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
415-
break;
416-
case 4:
417-
this_object->mat->at<Vec4b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
405+
switch(this_object->mat->depth()){
406+
case CV_8U:
407+
switch (this_object->mat->channels()){
408+
case 1:
409+
this_object->mat->at<uchar>((int)row,(int)col) = saturate_cast<uchar>(value);
410+
break;
411+
case 2:
412+
this_object->mat->at<Vec2b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
413+
break;
414+
case 3:
415+
this_object->mat->at<Vec3b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
416+
break;
417+
case 4:
418+
this_object->mat->at<Vec4b>((int)row,(int)col)[channel]=saturate_cast<uchar>(value);
419+
break;
420+
default:
421+
opencv_throw_exception("Get Mat px only channel in 1,2,3,4.");
422+
break;
423+
}
418424
break;
419425
default:
420-
opencv_throw_exception("Get Mat px only channel in 1,2,3,4.");
426+
switch (this_object->mat->channels()){
427+
case 1:
428+
this_object->mat->at<uchar>((int)row,(int)col) = saturate_cast<char>(value);
429+
break;
430+
case 2:
431+
this_object->mat->at<Vec2b>((int)row,(int)col)[channel]=saturate_cast<char>(value);
432+
break;
433+
case 3:
434+
this_object->mat->at<Vec3b>((int)row,(int)col)[channel]=saturate_cast<char>(value);
435+
break;
436+
case 4:
437+
this_object->mat->at<Vec4b>((int)row,(int)col)[channel]=saturate_cast<char>(value);
438+
break;
439+
default:
440+
opencv_throw_exception("Get Mat px only channel in 1,2,3,4.");
441+
break;
442+
}
421443
break;
422444
}
445+
423446
}
424447
RETURN_NULL();
425448
}

source/opencv2/core/opencv_type.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
#ifdef HAVE_CONFIG_H
18-
#include "config.h"
19-
#endif
2017

2118
#include "../../../php_opencv.h"
2219
#include "opencv_type.h"

source/opencv2/core/opencv_utility.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
*/
1616

1717

18-
#ifdef HAVE_CONFIG_H
19-
#include "config.h"
20-
#endif
2118

2219
#include "../../../php_opencv.h"
2320
#include "opencv_utility.h"

source/opencv2/face/opencv_facerec.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717

18+
1819
#include "opencv_facerec.h"
1920
#include "../opencv_face.h"
2021
#include "../core/opencv_mat.h"

source/opencv2/imgcodecs/opencv_imgcodecs_c.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,4 @@
1616

1717
#include "../../../php_opencv.h"
1818

19-
#ifdef HAVE_CONFIG_H
20-
#include "config.h"
21-
#endif
2219

source/opencv2/opencv_core.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
#include "../../opencv_exception.h"
2222
#include "core/opencv_type.h"
2323

24-
#ifdef HAVE_CONFIG_H
25-
#include "config.h"
26-
#endif
2724

2825
zend_class_entry *opencv_formatter_ce;
2926

0 commit comments

Comments
 (0)