Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
6fbcb283
Commit
6fbcb283
authored
Dec 18, 2018
by
Dmitry Kurtaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to fix "enum struct" wrapping for Java
parent
e058feba
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
4 deletions
+37
-4
Features2dTest.java
modules/features2d/misc/java/test/Features2dTest.java
+28
-0
gen_java.py
modules/java/generator/gen_java.py
+5
-2
hdr_parser.py
modules/python/src2/hdr_parser.py
+2
-0
SURFFLANNMatchingDemo.java
...atures2D/feature_flann_matcher/SURFFLANNMatchingDemo.java
+1
-1
SURFFLANNMatchingHomographyDemo.java
...D/feature_homography/SURFFLANNMatchingHomographyDemo.java
+1
-1
No files found.
modules/features2d/misc/java/test/Features2dTest.java
View file @
6fbcb283
...
...
@@ -7,11 +7,13 @@ import java.util.List;
import
org.opencv.calib3d.Calib3d
;
import
org.opencv.core.CvType
;
import
org.opencv.core.Mat
;
import
org.opencv.core.MatOfInt
;
import
org.opencv.core.MatOfDMatch
;
import
org.opencv.core.MatOfKeyPoint
;
import
org.opencv.core.MatOfPoint2f
;
import
org.opencv.core.Point
;
import
org.opencv.core.Range
;
import
org.opencv.core.Scalar
;
import
org.opencv.core.DMatch
;
import
org.opencv.features2d.DescriptorMatcher
;
import
org.opencv.features2d.Features2d
;
...
...
@@ -141,4 +143,30 @@ public class Features2dTest extends OpenCVTestCase {
Imgcodecs
.
imwrite
(
outputPath
,
outimg
);
// OpenCVTestRunner.Log("Output image is saved to: " + outputPath);
}
public
void
testDrawKeypoints
()
{
Mat
outImg
=
Mat
.
ones
(
11
,
11
,
CvType
.
CV_8U
);
MatOfKeyPoint
kps
=
new
MatOfKeyPoint
(
new
KeyPoint
(
5
,
5
,
1
));
// x, y, size
Features2d
.
drawKeypoints
(
new
Mat
(),
kps
,
outImg
,
new
Scalar
(
255
),
Features2d
.
DrawMatchesFlags_DRAW_OVER_OUTIMG
);
Mat
ref
=
new
MatOfInt
(
new
int
[]
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
15
,
54
,
15
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
76
,
217
,
217
,
221
,
81
,
1
,
1
,
1
,
1
,
1
,
100
,
224
,
111
,
57
,
115
,
225
,
101
,
1
,
1
,
1
,
44
,
215
,
100
,
1
,
1
,
1
,
101
,
214
,
44
,
1
,
1
,
54
,
212
,
57
,
1
,
1
,
1
,
55
,
212
,
55
,
1
,
1
,
40
,
215
,
104
,
1
,
1
,
1
,
105
,
215
,
40
,
1
,
1
,
1
,
102
,
221
,
111
,
55
,
115
,
222
,
103
,
1
,
1
,
1
,
1
,
1
,
76
,
218
,
217
,
220
,
81
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
15
,
55
,
15
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
}).
reshape
(
1
,
11
);
ref
.
convertTo
(
ref
,
CvType
.
CV_8U
);
assertMatEqual
(
ref
,
outImg
);
}
}
modules/java/generator/gen_java.py
View file @
6fbcb283
...
...
@@ -427,9 +427,12 @@ class JavaWrapperGenerator(object):
constinfo
=
ConstInfo
(
decl
,
namespaces
=
self
.
namespaces
,
enumType
=
enumType
)
if
constinfo
.
isIgnored
():
logging
.
info
(
'ignored:
%
s'
,
constinfo
)
elif
not
self
.
isWrapped
(
constinfo
.
classname
):
logging
.
info
(
'class not found:
%
s'
,
constinfo
)
else
:
if
not
self
.
isWrapped
(
constinfo
.
classname
):
logging
.
info
(
'class not found:
%
s'
,
constinfo
)
constinfo
.
name
=
constinfo
.
classname
+
'_'
+
constinfo
.
name
constinfo
.
classname
=
''
ci
=
self
.
getClass
(
constinfo
.
classname
)
duplicate
=
ci
.
getConst
(
constinfo
.
name
)
if
duplicate
:
...
...
modules/python/src2/hdr_parser.py
View file @
6fbcb283
...
...
@@ -634,6 +634,8 @@ class CppHeaderParser(object):
block_type
,
block_name
=
b
[
self
.
BLOCK_TYPE
],
b
[
self
.
BLOCK_NAME
]
if
block_type
in
[
"file"
,
"enum"
]:
continue
if
block_type
in
[
"enum struct"
,
"enum class"
]
and
block_name
==
name
:
continue
if
block_type
not
in
[
"struct"
,
"class"
,
"namespace"
,
"enum struct"
,
"enum class"
]:
print
(
"Error at
%
d: there are non-valid entries in the current block stack
%
s"
%
(
self
.
lineno
,
self
.
block_stack
))
sys
.
exit
(
-
1
)
...
...
samples/java/tutorial_code/features2D/feature_flann_matcher/SURFFLANNMatchingDemo.java
View file @
6fbcb283
...
...
@@ -58,7 +58,7 @@ class SURFFLANNMatching {
//-- Draw matches
Mat
imgMatches
=
new
Mat
();
Features2d
.
drawMatches
(
img1
,
keypoints1
,
img2
,
keypoints2
,
goodMatches
,
imgMatches
,
Scalar
.
all
(-
1
),
Scalar
.
all
(-
1
),
new
MatOfByte
(),
Features2d
.
NOT_DRAW_SINGLE_POINTS
);
Scalar
.
all
(-
1
),
new
MatOfByte
(),
Features2d
.
DrawMatchesFlags_
NOT_DRAW_SINGLE_POINTS
);
//-- Show detected matches
HighGui
.
imshow
(
"Good Matches"
,
imgMatches
);
...
...
samples/java/tutorial_code/features2D/feature_homography/SURFFLANNMatchingHomographyDemo.java
View file @
6fbcb283
...
...
@@ -64,7 +64,7 @@ class SURFFLANNMatchingHomography {
//-- Draw matches
Mat
imgMatches
=
new
Mat
();
Features2d
.
drawMatches
(
imgObject
,
keypointsObject
,
imgScene
,
keypointsScene
,
goodMatches
,
imgMatches
,
Scalar
.
all
(-
1
),
Scalar
.
all
(-
1
),
new
MatOfByte
(),
Features2d
.
NOT_DRAW_SINGLE_POINTS
);
Scalar
.
all
(-
1
),
new
MatOfByte
(),
Features2d
.
DrawMatchesFlags_
NOT_DRAW_SINGLE_POINTS
);
//-- Localize the object
List
<
Point
>
obj
=
new
ArrayList
<>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment