Skip to content

Commit f95d5cc

Browse files
committed
fix CV\adaptiveThreshold bug
1 parent 7eded74 commit f95d5cc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

source/opencv2/opencv_imgproc.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,6 @@ PHP_FUNCTION(opencv_find_contours_without_hierarchy){
11021102
&offset_zval) == FAILURE) {
11031103
RETURN_NULL();
11041104
}
1105-
11061105
opencv_mat_object *image_object = Z_PHP_MAT_OBJ_P(image_zval);
11071106
zval *contours_real_zval = Z_REFVAL_P(contours_zval);
11081107
zval *offset_real_zval;
@@ -1137,17 +1136,17 @@ PHP_FUNCTION(opencv_find_contours_without_hierarchy){
11371136
array_init(contours_real_zval);
11381137
int point_count = 0;
11391138
for(unsigned long i=0; i < contours.size(); i++){
1140-
zval *OPENCV_CONNECT(zval_arr,i);
1141-
array_init(OPENCV_CONNECT(zval_arr,i));
1139+
zval OPENCV_CONNECT(zval_arr,i);
1140+
array_init(&OPENCV_CONNECT(zval_arr,i));
11421141
for(unsigned long j=0; j < contours.at(i).size(); j++){
11431142
zval OPENCV_CONNECT(zval_point,point_count);
11441143
object_init_ex(&OPENCV_CONNECT(zval_point,point_count), opencv_point_ce);
11451144
Z_PHP_POINT_OBJ_P(&OPENCV_CONNECT(zval_point,point_count))->point=new Point(contours.at(i).at(j));
11461145
opencv_point_update_property_by_c_point(&OPENCV_CONNECT(zval_point,point_count), Z_PHP_POINT_OBJ_P(&OPENCV_CONNECT(zval_point,point_count))->point);
1147-
add_next_index_zval(OPENCV_CONNECT(zval_arr,i),&OPENCV_CONNECT(zval_point,point_count));
1146+
add_next_index_zval(&OPENCV_CONNECT(zval_arr,i),&OPENCV_CONNECT(zval_point,point_count));
11481147
point_count++;
11491148
}
1150-
add_next_index_zval(contours_real_zval,OPENCV_CONNECT(zval_arr,i));
1149+
add_next_index_zval(contours_real_zval,&OPENCV_CONNECT(zval_arr,i));
11511150

11521151
}
11531152
RETURN_NULL();

0 commit comments

Comments
 (0)