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
dfdb15be
Commit
dfdb15be
authored
Jul 19, 2011
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Java packages support to cmake
parent
070579d9
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
124 additions
and
84 deletions
+124
-84
CMakeLists.txt
modules/java/CMakeLists.txt
+27
-3
gen_java.py
modules/java/gen_java.py
+1
-0
Mat.cpp
modules/java/src/cpp/Mat.cpp
+34
-34
VideoCapture.cpp
modules/java/src/cpp/VideoCapture.cpp
+25
-25
android.java
modules/java/src/java/android.java
+1
-0
core+CvException.java
modules/java/src/java/core+CvException.java
+1
-1
core+CvType.java
modules/java/src/java/core+CvType.java
+1
-1
core+Mat.java
modules/java/src/java/core+Mat.java
+3
-4
core+Point.java
modules/java/src/java/core+Point.java
+1
-1
core+Point3.java
modules/java/src/java/core+Point3.java
+1
-1
core+Range.java
modules/java/src/java/core+Range.java
+1
-1
core+Rect.java
modules/java/src/java/core+Rect.java
+1
-1
core+RotatedRect.java
modules/java/src/java/core+RotatedRect.java
+1
-1
core+Scalar.java
modules/java/src/java/core+Scalar.java
+1
-1
core+Size.java
modules/java/src/java/core+Size.java
+1
-1
core+TermCriteria.java
modules/java/src/java/core+TermCriteria.java
+1
-1
highgui+VideoCapture.java
modules/java/src/java/highgui+VideoCapture.java
+4
-1
utils.java
modules/java/src/java/utils.java
+6
-1
Sample1View.java
...dopencv/src/org/opencv/samples/tutorial1/Sample1View.java
+13
-6
No files found.
modules/java/CMakeLists.txt
View file @
dfdb15be
...
@@ -16,6 +16,18 @@ SET(RST_PARSER "${CMAKE_CURRENT_SOURCE_DIR}/rst_parser.py")
...
@@ -16,6 +16,18 @@ SET(RST_PARSER "${CMAKE_CURRENT_SOURCE_DIR}/rst_parser.py")
SET
(
additional_clean_files
""
)
SET
(
additional_clean_files
""
)
macro
(
capitalize name outputvar
)
string
(
SUBSTRING
"
${
name
}
"
0 1 first_letter
)
string
(
SUBSTRING
"
${
name
}
"
1 -1 tail_letters
)
string
(
TOUPPER
"
${
first_letter
}
"
first_letter
)
SET
(
${
outputvar
}
"
${
first_letter
}${
tail_letters
}
"
)
endmacro
()
#cleanup
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E remove *.java *.cpp *.h *.txt
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
OUTPUT_QUIET ERROR_QUIET
)
foreach
(
module
${
OPENCV_JAVA_MODULES
}
)
foreach
(
module
${
OPENCV_JAVA_MODULES
}
)
IF
(
EXISTS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/config/
${
module
}
.filelist"
)
IF
(
EXISTS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/config/
${
module
}
.filelist"
)
FILE
(
STRINGS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/config/
${
module
}
.filelist"
headers_to_parse
)
FILE
(
STRINGS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/config/
${
module
}
.filelist"
headers_to_parse
)
...
@@ -31,8 +43,16 @@ foreach(module ${OPENCV_JAVA_MODULES})
...
@@ -31,8 +43,16 @@ foreach(module ${OPENCV_JAVA_MODULES})
list
(
SORT module_cppheaders
)
list
(
SORT module_cppheaders
)
ENDIF
()
ENDIF
()
# first run =(
execute_process
(
COMMAND
${
PYTHON_EXECUTABLE
}
"
${
GEN_JAVA
}
"
"
${
HDR_PARSER
}
"
${
module
}
${
module_cheaders
}
${
module_cppheaders
}
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
OUTPUT_QUIET ERROR_QUIET
)
FILE
(
GLOB
${
module
}
_generated_java_sources
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
module
}
+*.java"
)
# second run =(
add_custom_command
(
add_custom_command
(
OUTPUT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
module
}
.java"
OUTPUT
${${
module
}
_generated_java_sources
}
OUTPUT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
module
}
.cpp"
OUTPUT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
module
}
.cpp"
COMMAND
${
PYTHON_EXECUTABLE
}
"
${
GEN_JAVA
}
"
"
${
HDR_PARSER
}
"
${
module
}
${
module_cheaders
}
${
module_cppheaders
}
COMMAND
${
PYTHON_EXECUTABLE
}
"
${
GEN_JAVA
}
"
"
${
HDR_PARSER
}
"
${
module
}
${
module_cheaders
}
${
module_cppheaders
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
...
@@ -52,7 +72,7 @@ SET (dependent_extra_libs "")
...
@@ -52,7 +72,7 @@ SET (dependent_extra_libs "")
foreach
(
module
${
OPENCV_JAVA_MODULES
}
)
foreach
(
module
${
OPENCV_JAVA_MODULES
}
)
LIST
(
APPEND generated_cpp_sources
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
module
}
.cpp"
)
LIST
(
APPEND generated_cpp_sources
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
module
}
.cpp"
)
LIST
(
APPEND generated_java_sources
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
module
}
.java"
)
LIST
(
APPEND generated_java_sources
${${
module
}
_generated_java_sources
}
)
LIST
(
APPEND dependent_libs opencv_
${
module
}
)
LIST
(
APPEND dependent_libs opencv_
${
module
}
)
include_directories
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../
${
module
}
/include"
)
include_directories
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../
${
module
}
/include"
)
endforeach
()
endforeach
()
...
@@ -136,7 +156,9 @@ FILE(GLOB java_project_files "${CMAKE_CURRENT_SOURCE_DIR}/src/java/*.java")
...
@@ -136,7 +156,9 @@ FILE(GLOB java_project_files "${CMAKE_CURRENT_SOURCE_DIR}/src/java/*.java")
SET
(
documented_java_files
)
SET
(
documented_java_files
)
foreach
(
java_file
${
java_project_files
}
${
generated_java_sources
}
)
foreach
(
java_file
${
java_project_files
}
${
generated_java_sources
}
)
get_filename_component
(
java_file_name
"
${
java_file
}
"
NAME_WE
)
get_filename_component
(
java_file_name
"
${
java_file
}
"
NAME_WE
)
list
(
APPEND documented_java_files
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
java_file_name
}
-jdoc.java"
)
if
(
NOT java_file_name MATCHES
".*-jdoc$"
)
list
(
APPEND documented_java_files
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
java_file_name
}
-jdoc.java"
)
endif
()
endforeach
()
endforeach
()
add_custom_command
(
add_custom_command
(
...
@@ -157,6 +179,8 @@ SET(JAVA_OUTPUT_DIR "${CMAKE_BINARY_DIR}/src/org/opencv")
...
@@ -157,6 +179,8 @@ SET(JAVA_OUTPUT_DIR "${CMAKE_BINARY_DIR}/src/org/opencv")
foreach
(
java_file
${
documented_java_files
}
)
foreach
(
java_file
${
documented_java_files
}
)
get_filename_component
(
java_file_name
"
${
java_file
}
"
NAME
)
get_filename_component
(
java_file_name
"
${
java_file
}
"
NAME
)
string
(
REPLACE
"-jdoc.java"
".java"
java_file_name
"
${
java_file_name
}
"
)
string
(
REPLACE
"-jdoc.java"
".java"
java_file_name
"
${
java_file_name
}
"
)
string
(
REPLACE
"+"
"/"
java_file_name
"
${
java_file_name
}
"
)
add_custom_command
(
add_custom_command
(
TARGET
${
api_target
}
TARGET
${
api_target
}
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
java_file
}
"
"
${
JAVA_OUTPUT_DIR
}
/
${
java_file_name
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
java_file
}
"
"
${
JAVA_OUTPUT_DIR
}
/
${
java_file_name
}
"
...
...
modules/java/gen_java.py
View file @
dfdb15be
...
@@ -309,6 +309,7 @@ class JavaWrapperGenerator(object):
...
@@ -309,6 +309,7 @@ class JavaWrapperGenerator(object):
//
//
package org.opencv.
%
s;
package org.opencv.
%
s;
%
s
%
s
import org.opencv.utils;
%
s
%
s
public class
%
s {
public class
%
s {
...
...
modules/java/src/cpp/Mat.cpp
View file @
dfdb15be
...
@@ -12,42 +12,42 @@
...
@@ -12,42 +12,42 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nType
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nType
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
me
->
type
(
);
return
me
->
type
(
);
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nRows
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nRows
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
me
->
rows
;
return
me
->
rows
;
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nCols
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nCols
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
me
->
cols
;
return
me
->
cols
;
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nData
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nData
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
(
jlong
)
me
->
data
;
return
(
jlong
)
me
->
data
;
}
}
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_Mat_nIsEmpty
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
core_
Mat_nIsEmpty
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
me
->
empty
();
return
me
->
empty
();
}
}
JNIEXPORT
jdoubleArray
JNICALL
Java_org_opencv_Mat_nSize
JNIEXPORT
jdoubleArray
JNICALL
Java_org_opencv_
core_
Mat_nSize
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
try
{
try
{
...
@@ -65,7 +65,7 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_Mat_nSize
...
@@ -65,7 +65,7 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_Mat_nSize
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"core::Mat::nSize() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"core::Mat::nSize() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -79,28 +79,28 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_Mat_nSize
...
@@ -79,28 +79,28 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_Mat_nSize
}
}
}
}
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_Mat_nIsCont
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
core_
Mat_nIsCont
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
me
->
isContinuous
();
return
me
->
isContinuous
();
}
}
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_Mat_nIsSubmat
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
core_
Mat_nIsSubmat
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
me
->
isSubmatrix
();
return
me
->
isSubmatrix
();
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nSubmat
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nSubmat
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
r1
,
jint
r2
,
jint
c1
,
jint
c2
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
r1
,
jint
r2
,
jint
c1
,
jint
c2
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
(
jlong
)
new
cv
::
Mat
(
*
me
,
cv
::
Range
(
r1
,
r2
>
0
?
r2
:
me
->
rows
),
cv
::
Range
(
c1
,
c2
>
0
?
c2
:
me
->
cols
));
return
(
jlong
)
new
cv
::
Mat
(
*
me
,
cv
::
Range
(
r1
,
r2
>
0
?
r2
:
me
->
rows
),
cv
::
Range
(
c1
,
c2
>
0
?
c2
:
me
->
cols
));
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nClone
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nClone
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
...
@@ -112,7 +112,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nClone
...
@@ -112,7 +112,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nClone
// unlike other nPut()-s this one (with double[]) should convert input values to correct type
// unlike other nPut()-s this one (with double[]) should convert input values to correct type
#define PUT_ITEM(T, R, C) { T*dst = (T*)me->ptr(R, C); for(int ch=0; ch<me->channels() && count>0; count--,ch++,src++,dst++) *dst = cv::saturate_cast<T>(*src); }
#define PUT_ITEM(T, R, C) { T*dst = (T*)me->ptr(R, C); for(int ch=0; ch<me->channels() && count>0; count--,ch++,src++,dst++) *dst = cv::saturate_cast<T>(*src); }
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nPutD
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nPutD
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jdoubleArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jdoubleArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -196,7 +196,7 @@ template<typename T> static int mat_put(cv::Mat* m, int row, int col, int count,
...
@@ -196,7 +196,7 @@ template<typename T> static int mat_put(cv::Mat* m, int row, int col, int count,
extern
"C"
{
extern
"C"
{
#endif
#endif
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nPutB
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nPutB
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jbyteArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jbyteArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -210,7 +210,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nPutB
...
@@ -210,7 +210,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nPutB
return
res
;
return
res
;
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nPutS
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nPutS
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jshortArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jshortArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -224,7 +224,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nPutS
...
@@ -224,7 +224,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nPutS
return
res
;
return
res
;
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nPutI
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nPutI
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jintArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jintArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -238,7 +238,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nPutI
...
@@ -238,7 +238,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nPutI
return
res
;
return
res
;
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nPutF
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nPutF
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jfloatArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jfloatArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -293,7 +293,7 @@ extern "C" {
...
@@ -293,7 +293,7 @@ extern "C" {
#endif
#endif
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nGetB
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nGetB
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jbyteArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jbyteArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -307,7 +307,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetB
...
@@ -307,7 +307,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetB
return
res
;
return
res
;
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nGetS
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nGetS
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jshortArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jshortArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -321,7 +321,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetS
...
@@ -321,7 +321,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetS
return
res
;
return
res
;
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nGetI
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nGetI
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jintArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jintArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -335,7 +335,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetI
...
@@ -335,7 +335,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetI
return
res
;
return
res
;
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nGetF
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nGetF
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jfloatArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jfloatArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -349,7 +349,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetF
...
@@ -349,7 +349,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetF
return
res
;
return
res
;
}
}
JNIEXPORT
jint
JNICALL
Java_org_opencv_Mat_nGetD
JNIEXPORT
jint
JNICALL
Java_org_opencv_
core_
Mat_nGetD
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jdoubleArray
vals
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
,
jdoubleArray
vals
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -363,7 +363,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetD
...
@@ -363,7 +363,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_Mat_nGetD
return
res
;
return
res
;
}
}
JNIEXPORT
jdoubleArray
JNICALL
Java_org_opencv_Mat_nGet
JNIEXPORT
jdoubleArray
JNICALL
Java_org_opencv_
core_
Mat_nGet
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
row
,
jint
col
,
jint
count
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
...
@@ -388,14 +388,14 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_Mat_nGet
...
@@ -388,14 +388,14 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_Mat_nGet
return
res
;
return
res
;
}
}
JNIEXPORT
void
JNICALL
Java_org_opencv_Mat_nSetTo
JNIEXPORT
void
JNICALL
Java_org_opencv_
core_
Mat_nSetTo
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jdouble
v0
,
jdouble
v1
,
jdouble
v2
,
jdouble
v3
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jdouble
v0
,
jdouble
v1
,
jdouble
v2
,
jdouble
v3
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
me
->
setTo
(
cv
::
Scalar
(
v0
,
v1
,
v2
,
v3
)
);
me
->
setTo
(
cv
::
Scalar
(
v0
,
v1
,
v2
,
v3
)
);
}
}
JNIEXPORT
void
JNICALL
Java_org_opencv_Mat_nCopyTo
JNIEXPORT
void
JNICALL
Java_org_opencv_
core_
Mat_nCopyTo
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
m
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
m
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
...
@@ -403,7 +403,7 @@ JNIEXPORT void JNICALL Java_org_opencv_Mat_nCopyTo
...
@@ -403,7 +403,7 @@ JNIEXPORT void JNICALL Java_org_opencv_Mat_nCopyTo
me
->
copyTo
(
*
_m
);
me
->
copyTo
(
*
_m
);
}
}
JNIEXPORT
jdouble
JNICALL
Java_org_opencv_Mat_nDot
JNIEXPORT
jdouble
JNICALL
Java_org_opencv_
core_
Mat_nDot
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
m
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
m
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
...
@@ -411,7 +411,7 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_Mat_nDot
...
@@ -411,7 +411,7 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_Mat_nDot
return
me
->
dot
(
*
_m
);
return
me
->
dot
(
*
_m
);
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nCross
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nCross
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
m
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
m
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
...
@@ -419,26 +419,26 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nCross
...
@@ -419,26 +419,26 @@ JNIEXPORT jlong JNICALL Java_org_opencv_Mat_nCross
return
(
jlong
)
new
cv
::
Mat
(
me
->
cross
(
*
_m
));
return
(
jlong
)
new
cv
::
Mat
(
me
->
cross
(
*
_m
));
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nInv
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nInv
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
return
(
jlong
)
new
cv
::
Mat
(
me
->
inv
());
return
(
jlong
)
new
cv
::
Mat
(
me
->
inv
());
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nCreateMat__
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nCreateMat__
(
JNIEnv
*
env
,
jclass
cls
)
(
JNIEnv
*
env
,
jclass
cls
)
{
{
return
(
jlong
)
new
cv
::
Mat
();
return
(
jlong
)
new
cv
::
Mat
();
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nEye
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nEye
(
JNIEnv
*
env
,
jclass
cls
,
jint
_rows
,
jint
_cols
,
jint
_type
)
(
JNIEnv
*
env
,
jclass
cls
,
jint
_rows
,
jint
_cols
,
jint
_type
)
{
{
return
(
jlong
)
new
cv
::
Mat
(
cv
::
Mat
::
eye
(
_rows
,
_cols
,
_type
));
return
(
jlong
)
new
cv
::
Mat
(
cv
::
Mat
::
eye
(
_rows
,
_cols
,
_type
));
}
}
JNIEXPORT
jstring
JNICALL
Java_org_opencv_Mat_nDump
JNIEXPORT
jstring
JNICALL
Java_org_opencv_
core_
Mat_nDump
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
...
@@ -447,27 +447,27 @@ JNIEXPORT jstring JNICALL Java_org_opencv_Mat_nDump
...
@@ -447,27 +447,27 @@ JNIEXPORT jstring JNICALL Java_org_opencv_Mat_nDump
return
env
->
NewStringUTF
(
s
.
str
().
c_str
());
return
env
->
NewStringUTF
(
s
.
str
().
c_str
());
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nCreateMat__III
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nCreateMat__III
(
JNIEnv
*
env
,
jclass
cls
,
jint
_rows
,
jint
_cols
,
jint
_type
)
(
JNIEnv
*
env
,
jclass
cls
,
jint
_rows
,
jint
_cols
,
jint
_type
)
{
{
//LOGD("called with r=%d, c=%d", _rows, _cols);
//LOGD("called with r=%d, c=%d", _rows, _cols);
return
(
jlong
)
new
cv
::
Mat
(
_rows
,
_cols
,
_type
);;
return
(
jlong
)
new
cv
::
Mat
(
_rows
,
_cols
,
_type
);;
}
}
JNIEXPORT
jlong
JNICALL
Java_org_opencv_Mat_nCreateMat__IIIDDDD
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
core_
Mat_nCreateMat__IIIDDDD
(
JNIEnv
*
env
,
jclass
cls
,
jint
_rows
,
jint
_cols
,
jint
_type
,
jdouble
v0
,
jdouble
v1
,
jdouble
v2
,
jdouble
v3
)
(
JNIEnv
*
env
,
jclass
cls
,
jint
_rows
,
jint
_cols
,
jint
_type
,
jdouble
v0
,
jdouble
v1
,
jdouble
v2
,
jdouble
v3
)
{
{
return
(
jlong
)
new
cv
::
Mat
(
_rows
,
_cols
,
_type
,
cv
::
Scalar
(
v0
,
v1
,
v2
,
v3
)
);
return
(
jlong
)
new
cv
::
Mat
(
_rows
,
_cols
,
_type
,
cv
::
Scalar
(
v0
,
v1
,
v2
,
v3
)
);
}
}
JNIEXPORT
void
JNICALL
Java_org_opencv_Mat_nDelete
JNIEXPORT
void
JNICALL
Java_org_opencv_
core_
Mat_nDelete
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
delete
me
;
delete
me
;
}
}
JNIEXPORT
void
JNICALL
Java_org_opencv_Mat_nRelease
JNIEXPORT
void
JNICALL
Java_org_opencv_
core_
Mat_nRelease
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
cv
::
Mat
*
me
=
(
cv
::
Mat
*
)
self
;
//TODO: check for NULL
...
...
modules/java/src/cpp/VideoCapture.cpp
View file @
dfdb15be
...
@@ -22,7 +22,7 @@ extern "C" {
...
@@ -22,7 +22,7 @@ extern "C" {
//
//
JNIEXPORT
jlong
JNICALL
Java_org_opencv_VideoCapture_n_1VideoCapture__
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1VideoCapture__
(
JNIEnv
*
env
,
jclass
cls
)
(
JNIEnv
*
env
,
jclass
cls
)
{
{
try
{
try
{
...
@@ -37,7 +37,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_VideoCapture_n_1VideoCapture__
...
@@ -37,7 +37,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_VideoCapture_n_1VideoCapture__
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1VideoCapture__() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1VideoCapture__() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -57,7 +57,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_VideoCapture_n_1VideoCapture__
...
@@ -57,7 +57,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_VideoCapture_n_1VideoCapture__
//
//
JNIEXPORT
jlong
JNICALL
Java_org_opencv_VideoCapture_n_1VideoCapture__I
JNIEXPORT
jlong
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1VideoCapture__I
(
JNIEnv
*
env
,
jclass
cls
,
jint
device
)
(
JNIEnv
*
env
,
jclass
cls
,
jint
device
)
{
{
try
{
try
{
...
@@ -72,7 +72,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_VideoCapture_n_1VideoCapture__I
...
@@ -72,7 +72,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_VideoCapture_n_1VideoCapture__I
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1VideoCapture__I() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1VideoCapture__I() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -93,7 +93,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_VideoCapture_n_1VideoCapture__I
...
@@ -93,7 +93,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_VideoCapture_n_1VideoCapture__I
//
//
JNIEXPORT
jdouble
JNICALL
Java_org_opencv_VideoCapture_n_1get
JNIEXPORT
jdouble
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1get
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
propId
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
propId
)
{
{
try
{
try
{
...
@@ -108,7 +108,7 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_VideoCapture_n_1get
...
@@ -108,7 +108,7 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_VideoCapture_n_1get
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1get() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1get() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -129,7 +129,7 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_VideoCapture_n_1get
...
@@ -129,7 +129,7 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_VideoCapture_n_1get
//
//
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_VideoCapture_n_1grab
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1grab
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
try
{
try
{
...
@@ -144,7 +144,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1grab
...
@@ -144,7 +144,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1grab
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1grab() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1grab() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -165,7 +165,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1grab
...
@@ -165,7 +165,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1grab
//
//
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_VideoCapture_n_1isOpened
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1isOpened
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
try
{
try
{
...
@@ -180,7 +180,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1isOpened
...
@@ -180,7 +180,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1isOpened
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1isOpened() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1isOpened() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -200,7 +200,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1isOpened
...
@@ -200,7 +200,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1isOpened
//
//
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_VideoCapture_n_1open__JI
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1open__JI
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
device
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
device
)
{
{
try
{
try
{
...
@@ -215,7 +215,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1open__JI
...
@@ -215,7 +215,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1open__JI
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1open__JI() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1open__JI() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -236,7 +236,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1open__JI
...
@@ -236,7 +236,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1open__JI
//
//
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_VideoCapture_n_1read
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1read
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
image_nativeObj
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
image_nativeObj
)
{
{
try
{
try
{
...
@@ -252,7 +252,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1read
...
@@ -252,7 +252,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1read
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1read() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1read() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -273,7 +273,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1read
...
@@ -273,7 +273,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1read
//
//
JNIEXPORT
void
JNICALL
Java_org_opencv_VideoCapture_n_1release
JNIEXPORT
void
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1release
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
try
{
try
{
...
@@ -288,7 +288,7 @@ JNIEXPORT void JNICALL Java_org_opencv_VideoCapture_n_1release
...
@@ -288,7 +288,7 @@ JNIEXPORT void JNICALL Java_org_opencv_VideoCapture_n_1release
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1release() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1release() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
;
return
;
...
@@ -309,7 +309,7 @@ JNIEXPORT void JNICALL Java_org_opencv_VideoCapture_n_1release
...
@@ -309,7 +309,7 @@ JNIEXPORT void JNICALL Java_org_opencv_VideoCapture_n_1release
//
//
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_VideoCapture_n_1retrieve__JJI
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1retrieve__JJI
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
image_nativeObj
,
jint
channel
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
image_nativeObj
,
jint
channel
)
{
{
try
{
try
{
...
@@ -325,7 +325,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1retrieve__JJI
...
@@ -325,7 +325,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1retrieve__JJI
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1retrieve__JJI() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1retrieve__JJI() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -342,7 +342,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1retrieve__JJI
...
@@ -342,7 +342,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1retrieve__JJI
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_VideoCapture_n_1retrieve__JJ
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1retrieve__JJ
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
image_nativeObj
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jlong
image_nativeObj
)
{
{
try
{
try
{
...
@@ -358,7 +358,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1retrieve__JJ
...
@@ -358,7 +358,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1retrieve__JJ
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1retrieve__JJ() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1retrieve__JJ() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -379,7 +379,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1retrieve__JJ
...
@@ -379,7 +379,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1retrieve__JJ
//
//
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_VideoCapture_n_1set
JNIEXPORT
jboolean
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1set
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
propId
,
jdouble
value
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
,
jint
propId
,
jdouble
value
)
{
{
try
{
try
{
...
@@ -394,7 +394,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1set
...
@@ -394,7 +394,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1set
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1set() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1set() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
0
;
return
0
;
...
@@ -408,7 +408,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1set
...
@@ -408,7 +408,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_VideoCapture_n_1set
}
}
}
}
JNIEXPORT
jstring
JNICALL
Java_org_opencv_VideoCapture_n_1getSupportedPreviewSizes
JNIEXPORT
jstring
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1getSupportedPreviewSizes
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
try
{
try
{
...
@@ -423,7 +423,7 @@ JNIEXPORT jstring JNICALL Java_org_opencv_VideoCapture_n_1getSupportedPreviewSiz
...
@@ -423,7 +423,7 @@ JNIEXPORT jstring JNICALL Java_org_opencv_VideoCapture_n_1getSupportedPreviewSiz
#ifdef DEBUG
#ifdef DEBUG
LOGD
(
"highgui::VideoCapture_n_1getSupportedPreviewSizes() catched cv::Exception: %s"
,
e
.
what
());
LOGD
(
"highgui::VideoCapture_n_1getSupportedPreviewSizes() catched cv::Exception: %s"
,
e
.
what
());
#endif // DEBUG
#endif // DEBUG
jclass
je
=
env
->
FindClass
(
"org/opencv/CvException"
);
jclass
je
=
env
->
FindClass
(
"org/opencv/
core/
CvException"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
if
(
!
je
)
je
=
env
->
FindClass
(
"java/lang/Exception"
);
env
->
ThrowNew
(
je
,
e
.
what
());
env
->
ThrowNew
(
je
,
e
.
what
());
return
env
->
NewStringUTF
(
""
);
return
env
->
NewStringUTF
(
""
);
...
@@ -444,7 +444,7 @@ JNIEXPORT jstring JNICALL Java_org_opencv_VideoCapture_n_1getSupportedPreviewSiz
...
@@ -444,7 +444,7 @@ JNIEXPORT jstring JNICALL Java_org_opencv_VideoCapture_n_1getSupportedPreviewSiz
// static void VideoCapture::n_delete( __int64 self )
// static void VideoCapture::n_delete( __int64 self )
//
//
JNIEXPORT
void
JNICALL
Java_org_opencv_VideoCapture_n_1delete
JNIEXPORT
void
JNICALL
Java_org_opencv_
highgui_
VideoCapture_n_1delete
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
(
JNIEnv
*
env
,
jclass
cls
,
jlong
self
)
{
{
delete
(
VideoCapture
*
)
self
;
delete
(
VideoCapture
*
)
self
;
...
...
modules/java/src/java/android.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
;
import
org.opencv.core.Mat
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
public
class
android
{
public
class
android
{
...
...
modules/java/src/java/CvException.java
→
modules/java/src/java/
core+
CvException.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
public
class
CvException
extends
Exception
{
public
class
CvException
extends
Exception
{
...
...
modules/java/src/java/CvType.java
→
modules/java/src/java/
core+
CvType.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
public
final
class
CvType
{
public
final
class
CvType
{
...
...
modules/java/src/java/Mat.java
→
modules/java/src/java/
core+
Mat.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:Mat
//javadoc:Mat
public
class
Mat
{
public
class
Mat
{
p
rotected
Mat
(
long
nativeMat
)
{
p
ublic
Mat
(
long
nativeMat
)
{
/*if(nativeMat == 0)
/*if(nativeMat == 0)
throw new java.lang.UnsupportedOperationException("Native object address is NULL");*/
throw new java.lang.UnsupportedOperationException("Native object address is NULL");*/
this
.
nativeObj
=
nativeMat
;
this
.
nativeObj
=
nativeMat
;
...
@@ -44,7 +44,6 @@ public class Mat {
...
@@ -44,7 +44,6 @@ public class Mat {
@Override
@Override
protected
void
finalize
()
throws
Throwable
{
protected
void
finalize
()
throws
Throwable
{
nDelete
(
nativeObj
);
nDelete
(
nativeObj
);
nativeObj
=
0
;
super
.
finalize
();
super
.
finalize
();
}
}
...
@@ -327,7 +326,7 @@ public class Mat {
...
@@ -327,7 +326,7 @@ public class Mat {
// native stuff
// native stuff
static
{
System
.
loadLibrary
(
"opencv_java"
);
}
static
{
System
.
loadLibrary
(
"opencv_java"
);
}
p
rotected
long
nativeObj
;
p
ublic
final
long
nativeObj
;
private
static
native
long
nCreateMat
();
private
static
native
long
nCreateMat
();
private
static
native
long
nCreateMat
(
int
rows
,
int
cols
,
int
type
);
private
static
native
long
nCreateMat
(
int
rows
,
int
cols
,
int
type
);
private
static
native
long
nCreateMat
(
int
rows
,
int
cols
,
int
type
,
double
v0
,
double
v1
,
double
v2
,
double
v3
);
private
static
native
long
nCreateMat
(
int
rows
,
int
cols
,
int
type
,
double
v0
,
double
v1
,
double
v2
,
double
v3
);
...
...
modules/java/src/java/Point.java
→
modules/java/src/java/
core+
Point.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:Point_
//javadoc:Point_
public
class
Point
{
public
class
Point
{
...
...
modules/java/src/java/Point3.java
→
modules/java/src/java/
core+
Point3.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:Point3_
//javadoc:Point3_
public
class
Point3
{
public
class
Point3
{
...
...
modules/java/src/java/Range.java
→
modules/java/src/java/
core+
Range.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:Range
//javadoc:Range
public
class
Range
{
public
class
Range
{
...
...
modules/java/src/java/Rect.java
→
modules/java/src/java/
core+
Rect.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:Rect_
//javadoc:Rect_
public
class
Rect
{
public
class
Rect
{
...
...
modules/java/src/java/RotatedRect.java
→
modules/java/src/java/
core+
RotatedRect.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:RotatedRect_
//javadoc:RotatedRect_
public
class
RotatedRect
{
public
class
RotatedRect
{
...
...
modules/java/src/java/Scalar.java
→
modules/java/src/java/
core+
Scalar.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:Scalar_
//javadoc:Scalar_
public
class
Scalar
{
public
class
Scalar
{
...
...
modules/java/src/java/Size.java
→
modules/java/src/java/
core+
Size.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:Size_
//javadoc:Size_
public
class
Size
{
public
class
Size
{
...
...
modules/java/src/java/TermCriteria.java
→
modules/java/src/java/
core+
TermCriteria.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
core
;
//javadoc:TermCriteria
//javadoc:TermCriteria
public
class
TermCriteria
{
public
class
TermCriteria
{
...
...
modules/java/src/java/VideoCapture.java
→
modules/java/src/java/
highgui+
VideoCapture.java
View file @
dfdb15be
package
org
.
opencv
;
package
org
.
opencv
.
highgui
;
import
java.util.List
;
import
java.util.List
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
org.opencv.core.Mat
;
import
org.opencv.core.Size
;
// C++: class VideoCapture
// C++: class VideoCapture
//javadoc: VideoCapture
//javadoc: VideoCapture
public
class
VideoCapture
{
public
class
VideoCapture
{
...
...
modules/java/src/java/utils.java
View file @
dfdb15be
...
@@ -2,6 +2,11 @@ package org.opencv;
...
@@ -2,6 +2,11 @@ package org.opencv;
import
java.util.List
;
import
java.util.List
;
import
org.opencv.core.Mat
;
import
org.opencv.core.CvType
;
import
org.opencv.core.Point
;
import
org.opencv.core.Rect
;
import
org.opencv.features2d.KeyPoint
;
public
class
utils
{
public
class
utils
{
...
@@ -72,7 +77,7 @@ public class utils {
...
@@ -72,7 +77,7 @@ public class utils {
}
}
}
}
public
static
void
Mat_to_vector_KeyPoint
(
Mat
kp_mat
,
List
<
features2d
.
KeyPoint
>
kps
)
{
public
static
void
Mat_to_vector_KeyPoint
(
Mat
kp_mat
,
List
<
KeyPoint
>
kps
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
...
...
samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1View.java
View file @
dfdb15be
package
org
.
opencv
.
samples
.
tutorial1
;
package
org
.
opencv
.
samples
.
tutorial1
;
import
org.opencv.*
;
import
org.opencv.android
;
import
org.opencv.core.Core
;
import
org.opencv.core.Mat
;
import
org.opencv.core.Size
;
import
org.opencv.core.Point
;
import
org.opencv.core.Scalar
;
import
org.opencv.core.CvType
;
import
org.opencv.imgproc.Imgproc
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
...
@@ -36,15 +43,15 @@ class Sample1View extends SampleViewBase {
...
@@ -36,15 +43,15 @@ class Sample1View extends SampleViewBase {
switch
(
Sample1Java
.
viewMode
)
{
switch
(
Sample1Java
.
viewMode
)
{
case
Sample1Java
.
VIEW_MODE_GRAY
:
case
Sample1Java
.
VIEW_MODE_GRAY
:
imgproc
.
cvtColor
(
mGraySubmat
,
mRgba
,
i
mgproc
.
COLOR_GRAY2RGBA
,
4
);
Imgproc
.
cvtColor
(
mGraySubmat
,
mRgba
,
I
mgproc
.
COLOR_GRAY2RGBA
,
4
);
break
;
break
;
case
Sample1Java
.
VIEW_MODE_RGBA
:
case
Sample1Java
.
VIEW_MODE_RGBA
:
imgproc
.
cvtColor
(
mYuv
,
mRgba
,
i
mgproc
.
COLOR_YUV420i2RGB
,
4
);
Imgproc
.
cvtColor
(
mYuv
,
mRgba
,
I
mgproc
.
COLOR_YUV420i2RGB
,
4
);
c
ore
.
putText
(
mRgba
,
"OpenCV + Android"
,
new
Point
(
10
,
100
),
3
/* CV_FONT_HERSHEY_COMPLEX */
,
2
,
new
Scalar
(
255
,
0
,
0
,
255
),
3
);
C
ore
.
putText
(
mRgba
,
"OpenCV + Android"
,
new
Point
(
10
,
100
),
3
/* CV_FONT_HERSHEY_COMPLEX */
,
2
,
new
Scalar
(
255
,
0
,
0
,
255
),
3
);
break
;
break
;
case
Sample1Java
.
VIEW_MODE_CANNY
:
case
Sample1Java
.
VIEW_MODE_CANNY
:
i
mgproc
.
Canny
(
mGraySubmat
,
mIntermediateMat
,
80
,
100
);
I
mgproc
.
Canny
(
mGraySubmat
,
mIntermediateMat
,
80
,
100
);
imgproc
.
cvtColor
(
mIntermediateMat
,
mRgba
,
i
mgproc
.
COLOR_GRAY2BGRA
,
4
);
Imgproc
.
cvtColor
(
mIntermediateMat
,
mRgba
,
I
mgproc
.
COLOR_GRAY2BGRA
,
4
);
break
;
break
;
}
}
...
...
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