Skip to content

Commit b6289db

Browse files
MaleicAcidMaleicAcid
authored andcommitted
add get_structuring_element.phpt
Signed-off-by: MaleicAcid <CS_MaleicAcid@163.com>
1 parent 4a613a4 commit b6289db

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/get_structuring_element.phpt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
get_structuring_element function test
3+
--SKIPIF--
4+
<?php if (!extension_loaded("opencv")) print "skip"; ?>
5+
--FILE--
6+
<?php
7+
namespace CV;
8+
9+
$morph_elem = 2;
10+
$morph_size = 3;
11+
$element = getStructuringElement( $morph_elem, new Size( 2*$morph_size + 1, 2*$morph_size+1 ), new Point( $morph_size, $morph_size ));
12+
13+
var_dump($element);
14+
$element->print();
15+
16+
--EXPECT--
17+
object(CV\Mat)#3 (4) {
18+
["type":"CV\Mat":private]=>
19+
int(0)
20+
["rows"]=>
21+
int(7)
22+
["cols"]=>
23+
int(7)
24+
["dims"]=>
25+
int(2)
26+
}
27+
[ 0, 0, 0, 1, 0, 0, 0;
28+
0, 1, 1, 1, 1, 1, 0;
29+
1, 1, 1, 1, 1, 1, 1;
30+
1, 1, 1, 1, 1, 1, 1;
31+
1, 1, 1, 1, 1, 1, 1;
32+
0, 1, 1, 1, 1, 1, 0;
33+
0, 0, 0, 1, 0, 0, 0]

0 commit comments

Comments
 (0)