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
79f593a4
Commit
79f593a4
authored
Sep 11, 2014
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3198 from mshabunin:java_test_fix
parents
71edf1b5
39874ef7
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
87 additions
and
53 deletions
+87
-53
OpenCVDetectPython.cmake
cmake/OpenCVDetectPython.cmake
+1
-1
CMakeLists.txt
modules/java/CMakeLists.txt
+1
-1
CMakeLists.txt
modules/java/android_test/CMakeLists.txt
+2
-0
Calib3dTest.java
...android_test/src/org/opencv/test/calib3d/Calib3dTest.java
+4
-3
CoreTest.java
.../java/android_test/src/org/opencv/test/core/CoreTest.java
+11
-10
BRIEFDescriptorExtractorTest.java
.../opencv/test/features2d/BRIEFDescriptorExtractorTest.java
+1
-0
BruteForceDescriptorMatcherTest.java
...encv/test/features2d/BruteForceDescriptorMatcherTest.java
+1
-0
BruteForceHammingDescriptorMatcherTest.java
...st/features2d/BruteForceHammingDescriptorMatcherTest.java
+1
-0
BruteForceHammingLUTDescriptorMatcherTest.java
...features2d/BruteForceHammingLUTDescriptorMatcherTest.java
+1
-0
BruteForceL1DescriptorMatcherTest.java
...cv/test/features2d/BruteForceL1DescriptorMatcherTest.java
+1
-0
BruteForceSL2DescriptorMatcherTest.java
...v/test/features2d/BruteForceSL2DescriptorMatcherTest.java
+1
-0
FASTFeatureDetectorTest.java
...c/org/opencv/test/features2d/FASTFeatureDetectorTest.java
+1
-0
FlannBasedDescriptorMatcherTest.java
...encv/test/features2d/FlannBasedDescriptorMatcherTest.java
+1
-0
ORBDescriptorExtractorTest.java
...rg/opencv/test/features2d/ORBDescriptorExtractorTest.java
+1
-0
SIFTDescriptorExtractorTest.java
...g/opencv/test/features2d/SIFTDescriptorExtractorTest.java
+1
-0
STARFeatureDetectorTest.java
...c/org/opencv/test/features2d/STARFeatureDetectorTest.java
+6
-5
SURFDescriptorExtractorTest.java
...g/opencv/test/features2d/SURFDescriptorExtractorTest.java
+1
-0
SURFFeatureDetectorTest.java
...c/org/opencv/test/features2d/SURFFeatureDetectorTest.java
+1
-0
ImgprocTest.java
...android_test/src/org/opencv/test/imgproc/ImgprocTest.java
+20
-20
PhotoTest.java
...ava/android_test/src/org/opencv/test/photo/PhotoTest.java
+3
-2
gen_java.py
modules/java/generator/gen_java.py
+9
-6
CMakeLists.txt
modules/java/test/CMakeLists.txt
+2
-0
build.xml
modules/java/test/build.xml
+11
-3
OpenCVTestCase.java
modules/java/test/src/org/opencv/test/OpenCVTestCase.java
+1
-1
Puzzle15Processor.java
...le/src/org/opencv/samples/puzzle15/Puzzle15Processor.java
+1
-0
CameraCalibrator.java
...rg/opencv/samples/cameracalibration/CameraCalibrator.java
+1
-0
ColorBlobDetectionActivity.java
...v/samples/colorblobdetect/ColorBlobDetectionActivity.java
+1
-1
FdActivity.java
...tection/src/org/opencv/samples/facedetect/FdActivity.java
+1
-0
No files found.
cmake/OpenCVDetectPython.cmake
View file @
79f593a4
...
...
@@ -233,7 +233,7 @@ find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
PYTHON3_NUMPY_INCLUDE_DIRS PYTHON3_NUMPY_VERSION
)
# Use Python 2 as default Python interpreter
if
(
PYTHON2
LIBS
_FOUND
)
if
(
PYTHON2
INTERP
_FOUND
)
set
(
PYTHON_DEFAULT_AVAILABLE
"TRUE"
)
set
(
PYTHON_DEFAULT_EXECUTABLE
"
${
PYTHON2_EXECUTABLE
}
"
)
endif
()
...
...
modules/java/CMakeLists.txt
View file @
79f593a4
...
...
@@ -8,7 +8,7 @@ if(IOS OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE OR NOT (JNI_FOUND O
endif
()
set
(
the_description
"The java bindings"
)
ocv_add_module
(
java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo
opencv_xfeatures2d
)
ocv_add_module
(
java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo
)
ocv_module_include_directories
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/generator/src/cpp"
)
if
(
NOT ANDROID
)
...
...
modules/java/android_test/CMakeLists.txt
View file @
79f593a4
...
...
@@ -11,6 +11,8 @@ set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build")
# get project sources
file
(
GLOB_RECURSE opencv_test_java_files RELATIVE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/res/*"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/*"
)
ocv_list_filterout
(
opencv_test_java_files
".svn"
)
# opencv_ml is broken
ocv_list_filterout
(
opencv_test_java_files
"/ml/"
)
# copy sources out from the build tree
set
(
opencv_test_java_file_deps
""
)
...
...
modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java
View file @
79f593a4
...
...
@@ -11,6 +11,7 @@ import org.opencv.core.Point;
import
org.opencv.core.Scalar
;
import
org.opencv.core.Size
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.imgproc.Imgproc
;
public
class
Calib3dTest
extends
OpenCVTestCase
{
...
...
@@ -162,7 +163,7 @@ public class Calib3dTest extends OpenCVTestCase {
public
void
testFilterSpecklesMatDoubleIntDouble
()
{
gray_16s_1024
.
copyTo
(
dst
);
Point
center
=
new
Point
(
gray_16s_1024
.
rows
()
/
2
.,
gray_16s_1024
.
cols
()
/
2
.);
Core
.
circle
(
dst
,
center
,
1
,
Scalar
.
all
(
4096
));
Imgproc
.
circle
(
dst
,
center
,
1
,
Scalar
.
all
(
4096
));
assertMatNotEqual
(
gray_16s_1024
,
dst
);
Calib3d
.
filterSpeckles
(
dst
,
1024.0
,
100
,
0
.);
...
...
@@ -199,7 +200,7 @@ public class Calib3dTest extends OpenCVTestCase {
for
(
int
i
=
0
;
i
<
5
;
i
++)
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
Point
pt
=
new
Point
(
size
*
(
2
*
i
+
1
)
/
10
,
size
*
(
2
*
j
+
1
)
/
10
);
Core
.
circle
(
img
,
pt
,
10
,
new
Scalar
(
0
),
-
1
);
Imgproc
.
circle
(
img
,
pt
,
10
,
new
Scalar
(
0
),
-
1
);
}
assertTrue
(
Calib3d
.
findCirclesGrid
(
img
,
new
Size
(
5
,
5
),
centers
));
...
...
@@ -224,7 +225,7 @@ public class Calib3dTest extends OpenCVTestCase {
for
(
int
i
=
0
;
i
<
3
;
i
++)
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
Point
pt
=
new
Point
(
offsetx
+
(
2
*
i
+
j
%
2
)
*
step
,
offsety
+
step
*
j
);
Core
.
circle
(
img
,
pt
,
10
,
new
Scalar
(
0
),
-
1
);
Imgproc
.
circle
(
img
,
pt
,
10
,
new
Scalar
(
0
),
-
1
);
}
assertTrue
(
Calib3d
.
findCirclesGrid
(
img
,
new
Size
(
3
,
5
),
centers
,
Calib3d
.
CALIB_CB_CLUSTERING
...
...
modules/java/android_test/src/org/opencv/test/core/CoreTest.java
View file @
79f593a4
...
...
@@ -19,6 +19,7 @@ import org.opencv.core.Scalar;
import
org.opencv.core.Size
;
import
org.opencv.core.TermCriteria
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.imgproc.Imgproc
;
public
class
CoreTest
extends
OpenCVTestCase
{
...
...
@@ -455,12 +456,12 @@ public class CoreTest extends OpenCVTestCase {
// current implementation of fixed-point version of fillConvexPoly
// requires image to be at least 2-pixel wider in each direction than
// contour
Imgproc
.
fillConvexPoly
(
gray0
,
polyline1
,
colorWhite
,
Imgproc
.
line
_8
,
0
);
Imgproc
.
fillConvexPoly
(
gray0
,
polyline1
,
colorWhite
,
Imgproc
.
LINE
_8
,
0
);
assertTrue
(
0
<
Core
.
countNonZero
(
gray0
));
assertTrue
(
gray0
.
total
()
>
Core
.
countNonZero
(
gray0
));
Imgproc
.
fillConvexPoly
(
gray0
,
polyline2
,
colorBlack
,
Imgproc
.
line
_8
,
1
);
Imgproc
.
fillConvexPoly
(
gray0
,
polyline2
,
colorBlack
,
Imgproc
.
LINE
_8
,
1
);
assertEquals
(
"see http://code.opencv.org/issues/1284"
,
0
,
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -503,11 +504,11 @@ public class CoreTest extends OpenCVTestCase {
List
<
MatOfPoint
>
polylines2
=
new
ArrayList
<
MatOfPoint
>();
polylines2
.
add
(
polyline2
);
Imgproc
.
fillPoly
(
gray0
,
polylines1
,
new
Scalar
(
1
),
Imgproc
.
line
_8
,
0
,
new
Point
(
0
,
0
));
Imgproc
.
fillPoly
(
gray0
,
polylines1
,
new
Scalar
(
1
),
Imgproc
.
LINE
_8
,
0
,
new
Point
(
0
,
0
));
assertTrue
(
0
<
Core
.
countNonZero
(
gray0
));
Imgproc
.
fillPoly
(
gray0
,
polylines2
,
new
Scalar
(
0
),
Imgproc
.
line
_8
,
0
,
new
Point
(
1
,
1
));
Imgproc
.
fillPoly
(
gray0
,
polylines2
,
new
Scalar
(
0
),
Imgproc
.
LINE
_8
,
0
,
new
Point
(
1
,
1
));
assertEquals
(
0
,
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -877,11 +878,11 @@ public class CoreTest extends OpenCVTestCase {
Point
point1_4
=
new
Point
(
3
*
4
,
4
*
4
);
Point
point2_4
=
new
Point
(
nPoints
*
4
,
nPoints
*
4
);
Imgproc
.
line
(
gray0
,
point2
,
point1
,
colorWhite
,
2
,
Imgproc
.
line
_8
,
0
);
Imgproc
.
line
(
gray0
,
point2
,
point1
,
colorWhite
,
2
,
Imgproc
.
LINE
_8
,
0
);
assertFalse
(
0
==
Core
.
countNonZero
(
gray0
));
Imgproc
.
line
(
gray0
,
point2_4
,
point1_4
,
colorBlack
,
2
,
Imgproc
.
line
_8
,
2
);
Imgproc
.
line
(
gray0
,
point2_4
,
point1_4
,
colorBlack
,
2
,
Imgproc
.
LINE
_8
,
2
);
assertEquals
(
0
,
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -1616,8 +1617,8 @@ public class CoreTest extends OpenCVTestCase {
Point
topLeft
=
new
Point
(
0
,
0
);
Scalar
color
=
new
Scalar
(
128
);
Imgproc
.
rectangle
(
gray0
,
bottomRight
,
topLeft
,
color
,
2
,
Imgproc
.
line
_AA
,
0
);
Imgproc
.
rectangle
(
gray0
,
bottomRight
,
topLeft
,
colorBlack
,
2
,
Imgproc
.
line
_4
,
0
);
Imgproc
.
rectangle
(
gray0
,
bottomRight
,
topLeft
,
color
,
2
,
Imgproc
.
LINE
_AA
,
0
);
Imgproc
.
rectangle
(
gray0
,
bottomRight
,
topLeft
,
colorBlack
,
2
,
Imgproc
.
LINE
_4
,
0
);
assertTrue
(
0
!=
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -1628,11 +1629,11 @@ public class CoreTest extends OpenCVTestCase {
Point
topLeft
=
new
Point
(
0
,
0
);
Scalar
color
=
new
Scalar
(
128
);
Imgproc
.
rectangle
(
gray0
,
bottomRight1
,
topLeft
,
color
,
2
,
Imgproc
.
line
_8
,
1
);
Imgproc
.
rectangle
(
gray0
,
bottomRight1
,
topLeft
,
color
,
2
,
Imgproc
.
LINE
_8
,
1
);
assertTrue
(
0
!=
Core
.
countNonZero
(
gray0
));
Imgproc
.
rectangle
(
gray0
,
bottomRight2
,
topLeft
,
colorBlack
,
2
,
Imgproc
.
line
_8
,
0
);
Imgproc
.
rectangle
(
gray0
,
bottomRight2
,
topLeft
,
colorBlack
,
2
,
Imgproc
.
LINE
_8
,
0
);
assertEquals
(
0
,
Core
.
countNonZero
(
gray0
));
}
...
...
modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java
View file @
79f593a4
...
...
@@ -10,6 +10,7 @@ import org.opencv.features2d.DescriptorExtractor;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
BRIEFDescriptorExtractorTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java
View file @
79f593a4
...
...
@@ -18,6 +18,7 @@ import org.opencv.features2d.FeatureDetector;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
BruteForceDescriptorMatcherTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java
View file @
79f593a4
...
...
@@ -17,6 +17,7 @@ import org.opencv.features2d.DescriptorMatcher;
import
org.opencv.features2d.FeatureDetector
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
BruteForceHammingDescriptorMatcherTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java
View file @
79f593a4
...
...
@@ -16,6 +16,7 @@ import org.opencv.features2d.DescriptorMatcher;
import
org.opencv.features2d.FeatureDetector
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
BruteForceHammingLUTDescriptorMatcherTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java
View file @
79f593a4
...
...
@@ -17,6 +17,7 @@ import org.opencv.features2d.FeatureDetector;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
BruteForceL1DescriptorMatcherTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java
View file @
79f593a4
...
...
@@ -17,6 +17,7 @@ import org.opencv.features2d.FeatureDetector;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
BruteForceSL2DescriptorMatcherTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java
View file @
79f593a4
...
...
@@ -12,6 +12,7 @@ import org.opencv.features2d.FeatureDetector;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
FASTFeatureDetectorTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java
View file @
79f593a4
...
...
@@ -18,6 +18,7 @@ import org.opencv.features2d.FeatureDetector;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
FlannBasedDescriptorMatcherTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java
View file @
79f593a4
...
...
@@ -10,6 +10,7 @@ import org.opencv.features2d.DescriptorExtractor;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
ORBDescriptorExtractorTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java
View file @
79f593a4
...
...
@@ -10,6 +10,7 @@ import org.opencv.features2d.DescriptorExtractor;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
SIFTDescriptorExtractorTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java
View file @
79f593a4
...
...
@@ -12,6 +12,7 @@ import org.opencv.features2d.FeatureDetector;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
STARFeatureDetectorTest
extends
OpenCVTestCase
{
...
...
@@ -33,11 +34,11 @@ public class STARFeatureDetectorTest extends OpenCVTestCase {
int
offset
=
40
;
Mat
img
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
255
));
Core
.
circle
(
img
,
new
Point
(
center
-
offset
,
center
),
radius
,
color
,
-
1
);
Core
.
circle
(
img
,
new
Point
(
center
+
offset
,
center
),
radius
,
color
,
-
1
);
Core
.
circle
(
img
,
new
Point
(
center
,
center
-
offset
),
radius
,
color
,
-
1
);
Core
.
circle
(
img
,
new
Point
(
center
,
center
+
offset
),
radius
,
color
,
-
1
);
Core
.
circle
(
img
,
new
Point
(
center
,
center
),
radius
,
color
,
-
1
);
Imgproc
.
circle
(
img
,
new
Point
(
center
-
offset
,
center
),
radius
,
color
,
-
1
);
Imgproc
.
circle
(
img
,
new
Point
(
center
+
offset
,
center
),
radius
,
color
,
-
1
);
Imgproc
.
circle
(
img
,
new
Point
(
center
,
center
-
offset
),
radius
,
color
,
-
1
);
Imgproc
.
circle
(
img
,
new
Point
(
center
,
center
+
offset
),
radius
,
color
,
-
1
);
Imgproc
.
circle
(
img
,
new
Point
(
center
,
center
),
radius
,
color
,
-
1
);
return
img
;
}
...
...
modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java
View file @
79f593a4
...
...
@@ -10,6 +10,7 @@ import org.opencv.features2d.DescriptorExtractor;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
SURFDescriptorExtractorTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java
View file @
79f593a4
...
...
@@ -16,6 +16,7 @@ import org.opencv.features2d.FeatureDetector;
import
org.opencv.core.KeyPoint
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
org.opencv.imgproc.Imgproc
;
public
class
SURFFeatureDetectorTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java
View file @
79f593a4
...
...
@@ -647,7 +647,7 @@ public class ImgprocTest extends OpenCVTestCase {
List
<
MatOfPoint
>
contours
=
new
ArrayList
<
MatOfPoint
>();
Imgproc
.
findContours
(
gray0
,
contours
,
new
Mat
(),
Imgproc
.
RETR_EXTERNAL
,
Imgproc
.
CHAIN_APPROX_SIMPLE
);
Core
.
drawContours
(
gray0
,
contours
,
-
1
,
new
Scalar
(
0
));
Imgproc
.
drawContours
(
gray0
,
contours
,
-
1
,
new
Scalar
(
0
));
assertEquals
(
0
,
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -657,7 +657,7 @@ public class ImgprocTest extends OpenCVTestCase {
List
<
MatOfPoint
>
contours
=
new
ArrayList
<
MatOfPoint
>();
Imgproc
.
findContours
(
gray0
,
contours
,
new
Mat
(),
Imgproc
.
RETR_EXTERNAL
,
Imgproc
.
CHAIN_APPROX_SIMPLE
);
Core
.
drawContours
(
gray0
,
contours
,
-
1
,
new
Scalar
(
0
),
Core
.
FILLED
);
Imgproc
.
drawContours
(
gray0
,
contours
,
-
1
,
new
Scalar
(
0
),
Core
.
FILLED
);
assertEquals
(
0
,
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -758,7 +758,7 @@ public class ImgprocTest extends OpenCVTestCase {
assertEquals
(
contours
.
size
(),
0
);
assertEquals
(
contours
.
size
(),
hierarchy
.
total
());
Imgproc
.
rectangle
(
img
,
new
Point
(
10
,
20
),
new
Point
(
20
,
30
),
new
Scalar
(
100
),
3
,
Imgproc
.
line
_AA
,
0
);
Imgproc
.
rectangle
(
img
,
new
Point
(
10
,
20
),
new
Point
(
20
,
30
),
new
Scalar
(
100
),
3
,
Imgproc
.
LINE
_AA
,
0
);
Imgproc
.
rectangle
(
img
,
new
Point
(
30
,
35
),
new
Point
(
40
,
45
),
new
Scalar
(
200
));
Imgproc
.
findContours
(
img
,
contours
,
hierarchy
,
Imgproc
.
RETR_EXTERNAL
,
Imgproc
.
CHAIN_APPROX_SIMPLE
);
...
...
@@ -775,7 +775,7 @@ public class ImgprocTest extends OpenCVTestCase {
List
<
MatOfPoint
>
contours2
=
new
ArrayList
<
MatOfPoint
>();
Mat
hierarchy
=
new
Mat
();
Imgproc
.
rectangle
(
img
,
new
Point
(
10
,
20
),
new
Point
(
20
,
30
),
new
Scalar
(
100
),
3
,
Imgproc
.
line
_AA
,
0
);
Imgproc
.
rectangle
(
img
,
new
Point
(
10
,
20
),
new
Point
(
20
,
30
),
new
Scalar
(
100
),
3
,
Imgproc
.
LINE
_AA
,
0
);
Imgproc
.
rectangle
(
img
,
new
Point
(
30
,
35
),
new
Point
(
40
,
45
),
new
Scalar
(
200
));
Imgproc
.
findContours
(
img
,
contours
,
hierarchy
,
Imgproc
.
RETR_EXTERNAL
,
Imgproc
.
CHAIN_APPROX_SIMPLE
);
...
...
@@ -817,24 +817,24 @@ public class ImgprocTest extends OpenCVTestCase {
public
void
testFloodFillMatMatPointScalar
()
{
Mat
mask
=
new
Mat
(
matSize
+
2
,
matSize
+
2
,
CvType
.
CV_8U
,
new
Scalar
(
0
));
Mat
img
=
gray0
;
Core
.
circle
(
mask
,
new
Point
(
matSize
/
2
+
1
,
matSize
/
2
+
1
),
3
,
new
Scalar
(
2
));
Imgproc
.
circle
(
mask
,
new
Point
(
matSize
/
2
+
1
,
matSize
/
2
+
1
),
3
,
new
Scalar
(
2
));
int
retval
=
Imgproc
.
floodFill
(
img
,
mask
,
new
Point
(
matSize
/
2
,
matSize
/
2
),
new
Scalar
(
1
));
assertEquals
(
Core
.
countNonZero
(
img
),
retval
);
Core
.
circle
(
mask
,
new
Point
(
matSize
/
2
+
1
,
matSize
/
2
+
1
),
3
,
new
Scalar
(
0
));
Imgproc
.
circle
(
mask
,
new
Point
(
matSize
/
2
+
1
,
matSize
/
2
+
1
),
3
,
new
Scalar
(
0
));
assertEquals
(
retval
+
4
*
(
matSize
+
1
),
Core
.
countNonZero
(
mask
));
assertMatEqual
(
mask
.
submat
(
1
,
matSize
+
1
,
1
,
matSize
+
1
),
img
);
}
public
void
testFloodFillMatMatPointScalar_WithoutMask
()
{
Mat
img
=
gray0
;
Core
.
circle
(
img
,
new
Point
(
matSize
/
2
,
matSize
/
2
),
3
,
new
Scalar
(
2
));
Imgproc
.
circle
(
img
,
new
Point
(
matSize
/
2
,
matSize
/
2
),
3
,
new
Scalar
(
2
));
// TODO: ideally we should pass null instead of "new Mat()"
int
retval
=
Imgproc
.
floodFill
(
img
,
new
Mat
(),
new
Point
(
matSize
/
2
,
matSize
/
2
),
new
Scalar
(
1
));
Core
.
circle
(
img
,
new
Point
(
matSize
/
2
,
matSize
/
2
),
3
,
new
Scalar
(
0
));
Imgproc
.
circle
(
img
,
new
Point
(
matSize
/
2
,
matSize
/
2
),
3
,
new
Scalar
(
0
));
assertEquals
(
Core
.
countNonZero
(
img
),
retval
);
}
...
...
@@ -1063,7 +1063,7 @@ public class ImgprocTest extends OpenCVTestCase {
Point
center
=
new
Point
(
img
.
cols
()
/
2
,
img
.
rows
()
/
2
);
int
radius
=
Math
.
min
(
img
.
cols
()
/
4
,
img
.
rows
()
/
4
);
Core
.
circle
(
img
,
center
,
radius
,
colorBlack
,
3
);
Imgproc
.
circle
(
img
,
center
,
radius
,
colorBlack
,
3
);
Imgproc
.
HoughCircles
(
img
,
circles
,
Imgproc
.
CV_HOUGH_GRADIENT
,
2
,
img
.
rows
()
/
4
);
...
...
@@ -1973,7 +1973,7 @@ public class ImgprocTest extends OpenCVTestCase {
Scalar
color128
=
new
Scalar
(
128
);
Scalar
color0
=
new
Scalar
(
0
);
Imgproc
.
circle
(
gray0
,
center2
,
radius
*
2
,
color128
,
2
,
Imgproc
.
line
_4
,
1
/*
Imgproc
.
circle
(
gray0
,
center2
,
radius
*
2
,
color128
,
2
,
Imgproc
.
LINE
_4
,
1
/*
* Number
* of
* fractional
...
...
@@ -1981,7 +1981,7 @@ public class ImgprocTest extends OpenCVTestCase {
*/
);
assertFalse
(
0
==
Core
.
countNonZero
(
gray0
));
Imgproc
.
circle
(
gray0
,
center
,
radius
,
color0
,
2
,
Imgproc
.
line
_4
,
0
);
Imgproc
.
circle
(
gray0
,
center
,
radius
,
color0
,
2
,
Imgproc
.
LINE
_4
,
0
);
assertTrue
(
0
==
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -1991,7 +1991,7 @@ public class ImgprocTest extends OpenCVTestCase {
Point
pt1
=
new
Point
(
5.0
,
15.0
);
Point
pt2
=
new
Point
(
25.0
,
15.0
);
assertTrue
(
Core
.
clipLine
(
r
,
pt1
,
pt2
));
assertTrue
(
Imgproc
.
clipLine
(
r
,
pt1
,
pt2
));
Point
pt1Clipped
=
new
Point
(
10.0
,
15.0
);
Point
pt2Clipped
=
new
Point
(
19.0
,
15.0
);
...
...
@@ -2003,7 +2003,7 @@ public class ImgprocTest extends OpenCVTestCase {
pt1Clipped
=
new
Point
(
5.0
,
5.0
);
pt2Clipped
=
new
Point
(
25.0
,
5.0
);
assertFalse
(
Core
.
clipLine
(
r
,
pt1
,
pt2
));
assertFalse
(
Imgproc
.
clipLine
(
r
,
pt1
,
pt2
));
assertEquals
(
pt1Clipped
,
pt1
);
assertEquals
(
pt2Clipped
,
pt2
);
...
...
@@ -2054,11 +2054,11 @@ public class ImgprocTest extends OpenCVTestCase {
Size
axes2
=
new
Size
(
4
,
4
);
double
angle
=
30
,
startAngle
=
0
,
endAngle
=
30
;
Imgproc
.
ellipse
(
gray0
,
center
,
axes
,
angle
,
startAngle
,
endAngle
,
colorWhite
,
Core
.
FILLED
,
Imgproc
.
line
_4
,
0
);
Imgproc
.
ellipse
(
gray0
,
center
,
axes
,
angle
,
startAngle
,
endAngle
,
colorWhite
,
Core
.
FILLED
,
Imgproc
.
LINE
_4
,
0
);
assertTrue
(
0
!=
Core
.
countNonZero
(
gray0
));
Imgproc
.
ellipse
(
gray0
,
center2
,
axes2
,
angle
,
startAngle
,
endAngle
,
colorBlack
,
Core
.
FILLED
,
Imgproc
.
line
_4
,
1
);
Imgproc
.
ellipse
(
gray0
,
center2
,
axes2
,
angle
,
startAngle
,
endAngle
,
colorBlack
,
Core
.
FILLED
,
Imgproc
.
LINE
_4
,
1
);
assertEquals
(
0
,
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -2107,8 +2107,8 @@ public class ImgprocTest extends OpenCVTestCase {
Size
size
=
new
Size
(
2
,
matSize
*
2
/
3
);
RotatedRect
box
=
new
RotatedRect
(
center
,
size
,
20
);
Imgproc
.
ellipse
(
gray0
,
box
,
new
Scalar
(
9
),
1
,
Imgproc
.
line
_AA
);
Imgproc
.
ellipse
(
gray0
,
box
,
new
Scalar
(
0
),
1
,
Imgproc
.
line
_4
);
Imgproc
.
ellipse
(
gray0
,
box
,
new
Scalar
(
9
),
1
,
Imgproc
.
LINE
_AA
);
Imgproc
.
ellipse
(
gray0
,
box
,
new
Scalar
(
0
),
1
,
Imgproc
.
LINE
_4
);
assertTrue
(
0
<
Core
.
countNonZero
(
gray0
));
}
...
...
@@ -2144,11 +2144,11 @@ public class ImgprocTest extends OpenCVTestCase {
List
<
MatOfPoint
>
polyline2
=
new
ArrayList
<
MatOfPoint
>();
polyline2
.
add
(
new
MatOfPoint
(
new
Point
(
2
,
2
),
new
Point
(
14
,
2
),
new
Point
(
14
,
12
),
new
Point
(
2
,
12
)));
Imgproc
.
polylines
(
img
,
polyline1
,
true
,
new
Scalar
(
100
),
2
,
Imgproc
.
line
_8
,
0
);
Imgproc
.
polylines
(
img
,
polyline1
,
true
,
new
Scalar
(
100
),
2
,
Imgproc
.
LINE
_8
,
0
);
assertTrue
(
Core
.
countNonZero
(
img
)
>
0
);
Imgproc
.
polylines
(
img
,
polyline2
,
true
,
new
Scalar
(
0
),
2
,
Imgproc
.
line
_8
,
1
);
Imgproc
.
polylines
(
img
,
polyline2
,
true
,
new
Scalar
(
0
),
2
,
Imgproc
.
LINE
_8
,
1
);
assertEquals
(
0
,
Core
.
countNonZero
(
img
));
}
...
...
@@ -2188,7 +2188,7 @@ public class ImgprocTest extends OpenCVTestCase {
Mat
img
=
new
Mat
(
20
+
(
int
)
labelSize
.
height
,
20
+
(
int
)
labelSize
.
width
,
CvType
.
CV_8U
,
colorBlack
);
Point
origin
=
new
Point
(
10
,
10
);
Imgproc
.
putText
(
img
,
text
,
origin
,
Core
.
FONT_HERSHEY_SIMPLEX
,
1.0
,
colorWhite
,
1
,
Imgproc
.
line
_8
,
true
);
Imgproc
.
putText
(
img
,
text
,
origin
,
Core
.
FONT_HERSHEY_SIMPLEX
,
1.0
,
colorWhite
,
1
,
Imgproc
.
LINE
_8
,
true
);
assertTrue
(
Core
.
countNonZero
(
img
)
>
0
);
// check that border is not corrupted
...
...
modules/java/android_test/src/org/opencv/test/photo/PhotoTest.java
View file @
79f593a4
...
...
@@ -5,13 +5,14 @@ import org.opencv.core.CvType;
import
org.opencv.core.Point
;
import
org.opencv.photo.Photo
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.imgproc.Imgproc
;
public
class
PhotoTest
extends
OpenCVTestCase
{
public
void
testInpaint
()
{
Point
p
=
new
Point
(
matSize
/
2
,
matSize
/
2
);
Core
.
circle
(
gray255
,
p
,
2
,
colorBlack
,
Core
.
FILLED
);
Core
.
circle
(
gray0
,
p
,
2
,
colorWhite
,
Core
.
FILLED
);
Imgproc
.
circle
(
gray255
,
p
,
2
,
colorBlack
,
Core
.
FILLED
);
Imgproc
.
circle
(
gray0
,
p
,
2
,
colorWhite
,
Core
.
FILLED
);
Photo
.
inpaint
(
gray255
,
gray0
,
dst
,
3
,
Photo
.
INPAINT_TELEA
);
...
...
modules/java/generator/gen_java.py
View file @
79f593a4
...
...
@@ -127,7 +127,6 @@ missing_consts = \
(
(
'SVD_MODIFY_A'
,
1
),
(
'SVD_NO_UV'
,
2
),
(
'SVD_FULL_UV'
,
4
),
(
'FILLED'
,
-
1
),
(
'LINE_AA'
,
16
),
(
'LINE_8'
,
8
),
(
'LINE_4'
,
4
),
(
'REDUCE_SUM'
,
0
),
(
'REDUCE_AVG'
,
1
),
(
'REDUCE_MAX'
,
2
),
(
'REDUCE_MIN'
,
3
),
)
#public
},
# Core
...
...
@@ -142,7 +141,11 @@ missing_consts = \
(
'IPL_BORDER_WRAP'
,
3
),
(
'IPL_BORDER_REFLECT_101'
,
4
),
(
'IPL_BORDER_TRANSPARENT'
,
5
),
)
# private
),
# private
'public'
:
(
(
'LINE_AA'
,
16
),
(
'LINE_8'
,
8
),
(
'LINE_4'
,
4
),
)
#public
},
# Imgproc
"Calib3d"
:
...
...
@@ -445,9 +448,9 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual
'cpp_code'
:
"""
// C++: Size getTextSize(const String& text, int fontFace, double fontScale, int thickness, int* baseLine);
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_
core_Core
_n_1getTextSize (JNIEnv*, jclass, jstring, jint, jdouble, jint, jintArray);
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_
imgproc_Imgproc
_n_1getTextSize (JNIEnv*, jclass, jstring, jint, jdouble, jint, jintArray);
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_
core_Core
_n_1getTextSize
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_
imgproc_Imgproc
_n_1getTextSize
(JNIEnv* env, jclass, jstring text, jint fontFace, jdouble fontScale, jint thickness, jintArray baseLine)
{
try {
...
...
@@ -484,13 +487,13 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual
return result;
} catch(const cv::Exception& e) {
LOGD("
Core
::n_1getTextSize() catched cv::Exception:
%
s", e.what());
LOGD("
Imgproc
::n_1getTextSize() catched cv::Exception:
%
s", e.what());
jclass je = env->FindClass("org/opencv/core/CvException");
if(!je) je = env->FindClass("java/lang/Exception");
env->ThrowNew(je, e.what());
return NULL;
} catch (...) {
LOGD("
Core
::n_1getTextSize() catched unknown exception (...)");
LOGD("
Imgproc
::n_1getTextSize() catched unknown exception (...)");
jclass je = env->FindClass("java/lang/Exception");
env->ThrowNew(je, "Unknown exception in JNI code {core::getTextSize()}");
return NULL;
...
...
modules/java/test/CMakeLists.txt
View file @
79f593a4
...
...
@@ -19,6 +19,8 @@ file(GLOB_RECURSE opencv_test_java_files RELATIVE "${android_source_dir}" "${and
ocv_list_filterout
(
opencv_test_java_files
"OpenCVTest(Case|Runner).java"
)
# These files aren't for desktop Java.
ocv_list_filterout
(
opencv_test_java_files
"/android/"
)
# opencv_ml is broken
ocv_list_filterout
(
opencv_test_java_files
"/ml/"
)
# These are files updated for pure Java.
file
(
GLOB_RECURSE modified_files RELATIVE
"
${
java_source_dir
}
"
"
${
java_source_dir
}
/src/*"
)
...
...
modules/java/test/build.xml
View file @
79f593a4
<project>
<property
file=
"ant-${opencv.build.type}.properties"
/>
<property
name=
"test.dir"
value=
"testResults"
/>
<property
name=
"build.dir"
value=
"build"
/>
<path
id=
"master-classpath"
>
<fileset
dir=
"lib"
>
...
...
@@ -12,7 +14,7 @@
<target
name=
"clean"
>
<delete
dir=
"build"
/>
<delete
dir=
"
testResults
"
/>
<delete
dir=
"
${test.dir}
"
/>
</target>
<target
name=
"compile"
>
...
...
@@ -34,7 +36,7 @@
</target>
<target
name=
"test"
>
<mkdir
dir=
"
testResults
"
/>
<mkdir
dir=
"
${test.dir}
"
/>
<junit
printsummary=
"true"
haltonfailure=
"false"
haltonerror=
"false"
showoutput=
"false"
logfailedtests=
"true"
maxmemory=
"256m"
>
<sysproperty
key=
"java.library.path"
path=
"${opencv.lib.path}"
/>
<env
key=
"PATH"
path=
"${opencv.lib.path}"
/>
...
...
@@ -45,12 +47,18 @@
<formatter
type=
"xml"
/>
<batchtest
fork=
"yes"
todir=
"
testResults
"
>
<batchtest
fork=
"yes"
todir=
"
${test.dir}
"
>
<zipfileset
src=
"build/jar/opencv-test.jar"
includes=
"**/*.class"
excludes=
"**/OpenCVTest*"
>
<exclude
name=
"**/*$*.class"
/>
</zipfileset>
</batchtest>
</junit>
<junitreport
todir=
"${test.dir}"
>
<fileset
dir=
"${test.dir}"
>
<include
name=
"TEST-*.xml"
/>
</fileset>
<report
format=
"noframes"
todir=
"${test.dir}"
/>
</junitreport>
</target>
<target
name=
"build"
>
...
...
modules/java/test/src/org/opencv/test/OpenCVTestCase.java
View file @
79f593a4
...
...
@@ -116,7 +116,7 @@ public class OpenCVTestCase extends TestCase {
return
;
}
OpenCVTestRunner
.
LENA_PATH
=
pwd
+
"res/drawable/lena.
jp
g"
;
OpenCVTestRunner
.
LENA_PATH
=
pwd
+
"res/drawable/lena.
pn
g"
;
OpenCVTestRunner
.
CHESS_PATH
=
pwd
+
"res/drawable/chessboard.jpg"
;
OpenCVTestRunner
.
LBPCASCADE_FRONTALFACE_PATH
=
pwd
+
"res/raw/lbpcascade_frontalface.xml"
;
...
...
samples/android/15-puzzle/src/org/opencv/samples/puzzle15/Puzzle15Processor.java
View file @
79f593a4
...
...
@@ -6,6 +6,7 @@ import org.opencv.core.Mat;
import
org.opencv.core.Scalar
;
import
org.opencv.core.Size
;
import
org.opencv.core.Point
;
import
org.opencv.imgproc.Imgproc
;
import
android.util.Log
;
...
...
samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/CameraCalibrator.java
View file @
79f593a4
...
...
@@ -13,6 +13,7 @@ import org.opencv.core.MatOfPoint3f;
import
org.opencv.core.Point
;
import
org.opencv.core.Scalar
;
import
org.opencv.core.Size
;
import
org.opencv.imgproc.Imgproc
;
import
android.util.Log
;
...
...
samples/android/color-blob-detection/src/org/opencv/samples/colorblobdetect/ColorBlobDetectionActivity.java
View file @
79f593a4
...
...
@@ -174,7 +174,7 @@ public class ColorBlobDetectionActivity extends Activity implements OnTouchListe
mDetector
.
process
(
mRgba
);
List
<
MatOfPoint
>
contours
=
mDetector
.
getContours
();
Log
.
e
(
TAG
,
"Contours count: "
+
contours
.
size
());
Core
.
drawContours
(
mRgba
,
contours
,
-
1
,
CONTOUR_COLOR
);
Imgproc
.
drawContours
(
mRgba
,
contours
,
-
1
,
CONTOUR_COLOR
);
Mat
colorLabel
=
mRgba
.
submat
(
4
,
68
,
4
,
68
);
colorLabel
.
setTo
(
mBlobColorRgba
);
...
...
samples/android/face-detection/src/org/opencv/samples/facedetect/FdActivity.java
View file @
79f593a4
...
...
@@ -18,6 +18,7 @@ import org.opencv.core.Size;
import
org.opencv.android.CameraBridgeViewBase
;
import
org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2
;
import
org.opencv.objdetect.CascadeClassifier
;
import
org.opencv.imgproc.Imgproc
;
import
android.app.Activity
;
import
android.content.Context
;
...
...
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