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
dc93c219
Commit
dc93c219
authored
Jun 20, 2012
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for #2063 ( Mat(Mat m, Rect roi) returns wrong sub-mat)
parent
43f2682e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
MatTest.java
...s/java/android_test/src/org/opencv/test/core/MatTest.java
+19
-4
core+Mat.java
modules/java/src/java/core+Mat.java
+1
-1
No files found.
modules/java/android_test/src/org/opencv/test/core/MatTest.java
View file @
dc93c219
...
...
@@ -569,12 +569,27 @@ public class MatTest extends OpenCVTestCase {
}
public
void
testMatMatRect
()
{
dst
=
new
Mat
(
gray255_32f
,
new
Rect
(
2
,
2
,
7
,
7
));
truth
=
new
Mat
(
7
,
7
,
CvType
.
CV_32FC1
,
new
Scalar
(
255
));
Mat
m
=
new
Mat
(
7
,
6
,
CvType
.
CV_32SC1
);
m
.
put
(
0
,
0
,
0
,
1
,
2
,
3
,
4
,
5
,
10
,
11
,
12
,
13
,
14
,
15
,
20
,
21
,
22
,
23
,
24
,
25
,
30
,
31
,
32
,
33
,
34
,
35
,
40
,
41
,
42
,
43
,
44
,
45
,
50
,
51
,
52
,
53
,
54
,
55
,
60
,
61
,
62
,
63
,
64
,
65
);
dst
=
new
Mat
(
m
,
new
Rect
(
1
,
2
,
3
,
4
));
truth
=
new
Mat
(
4
,
3
,
CvType
.
CV_32SC1
);
truth
.
put
(
0
,
0
,
21
,
22
,
23
,
31
,
32
,
33
,
41
,
42
,
43
,
51
,
52
,
53
);
assertFalse
(
dst
.
empty
());
assertMatEqual
(
truth
,
dst
,
EPS
);
assertMatEqual
(
truth
,
dst
);
}
public
void
testMatSizeInt
()
{
...
...
modules/java/src/java/core+Mat.java
View file @
dc93c219
...
...
@@ -108,7 +108,7 @@ public class Mat {
public
Mat
(
Mat
m
,
Rect
roi
)
{
nativeObj
=
n_Mat
(
m
.
nativeObj
,
roi
.
x
,
roi
.
x
+
roi
.
width
,
roi
.
y
,
roi
.
y
+
roi
.
height
);
nativeObj
=
n_Mat
(
m
.
nativeObj
,
roi
.
y
,
roi
.
y
+
roi
.
height
,
roi
.
x
,
roi
.
x
+
roi
.
width
);
return
;
}
...
...
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