Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
8286e1a5
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8286e1a5
编写于
11月 26, 2012
作者:
A
Andrey Kamaev
提交者:
OpenCV Buildbot
11月 26, 2012
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #185 from apavlenko:bug2569/simplify_samples_jni_code
上级
39da17a0
b19f6728
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
30 deletion
+34
-30
samples/android/face-detection/jni/DetectionBasedTracker_jni.cpp
.../android/face-detection/jni/DetectionBasedTracker_jni.cpp
+18
-18
samples/android/tutorial-3-native/jni/jni_part.cpp
samples/android/tutorial-3-native/jni/jni_part.cpp
+8
-6
samples/android/tutorial-4-mixed/jni/jni_part.cpp
samples/android/tutorial-4-mixed/jni/jni_part.cpp
+8
-6
未找到文件。
samples/android/face-detection/jni/DetectionBasedTracker_jni.cpp
浏览文件 @
8286e1a5
...
...
@@ -33,9 +33,9 @@ JNIEXPORT jlong JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker
DetectorParams
.
minObjectSize
=
faceSize
;
result
=
(
jlong
)
new
DetectionBasedTracker
(
stdFileName
,
DetectorParams
);
}
catch
(
cv
::
Exception
e
)
catch
(
cv
::
Exception
&
e
)
{
LOGD
(
"nativeCreateObject ca
tched
cv::Exception: %s"
,
e
.
what
());
LOGD
(
"nativeCreateObject ca
ught
cv::Exception: %s"
,
e
.
what
());
jclass
je
=
jenv
->
FindClass
(
"org/opencv/core/CvException"
);
if
(
!
je
)
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
...
...
@@ -43,7 +43,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker
}
catch
(...)
{
LOGD
(
"nativeCreateObject ca
tched
unknown exception"
);
LOGD
(
"nativeCreateObject ca
ught
unknown exception"
);
jclass
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
jenv
->
ThrowNew
(
je
,
"Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}"
);
return
0
;
...
...
@@ -65,9 +65,9 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
delete
(
DetectionBasedTracker
*
)
thiz
;
}
}
catch
(
cv
::
Exception
e
)
catch
(
cv
::
Exception
&
e
)
{
LOGD
(
"nativeestroyObject ca
tched
cv::Exception: %s"
,
e
.
what
());
LOGD
(
"nativeestroyObject ca
ught
cv::Exception: %s"
,
e
.
what
());
jclass
je
=
jenv
->
FindClass
(
"org/opencv/core/CvException"
);
if
(
!
je
)
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
...
...
@@ -75,7 +75,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
}
catch
(...)
{
LOGD
(
"nativeDestroyObject ca
tched
unknown exception"
);
LOGD
(
"nativeDestroyObject ca
ught
unknown exception"
);
jclass
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
jenv
->
ThrowNew
(
je
,
"Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}"
);
}
...
...
@@ -90,9 +90,9 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
{
((
DetectionBasedTracker
*
)
thiz
)
->
run
();
}
catch
(
cv
::
Exception
e
)
catch
(
cv
::
Exception
&
e
)
{
LOGD
(
"nativeStart ca
tched
cv::Exception: %s"
,
e
.
what
());
LOGD
(
"nativeStart ca
ught
cv::Exception: %s"
,
e
.
what
());
jclass
je
=
jenv
->
FindClass
(
"org/opencv/core/CvException"
);
if
(
!
je
)
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
...
...
@@ -100,7 +100,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
}
catch
(...)
{
LOGD
(
"nativeStart ca
tched
unknown exception"
);
LOGD
(
"nativeStart ca
ught
unknown exception"
);
jclass
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
jenv
->
ThrowNew
(
je
,
"Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}"
);
}
...
...
@@ -115,9 +115,9 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
{
((
DetectionBasedTracker
*
)
thiz
)
->
stop
();
}
catch
(
cv
::
Exception
e
)
catch
(
cv
::
Exception
&
e
)
{
LOGD
(
"nativeStop ca
tched
cv::Exception: %s"
,
e
.
what
());
LOGD
(
"nativeStop ca
ught
cv::Exception: %s"
,
e
.
what
());
jclass
je
=
jenv
->
FindClass
(
"org/opencv/core/CvException"
);
if
(
!
je
)
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
...
...
@@ -125,7 +125,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
}
catch
(...)
{
LOGD
(
"nativeStop ca
tched
unknown exception"
);
LOGD
(
"nativeStop ca
ught
unknown exception"
);
jclass
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
jenv
->
ThrowNew
(
je
,
"Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}"
);
}
...
...
@@ -146,9 +146,9 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
((
DetectionBasedTracker
*
)
thiz
)
->
setParameters
(
DetectorParams
);
}
}
catch
(
cv
::
Exception
e
)
catch
(
cv
::
Exception
&
e
)
{
LOGD
(
"nativeStop ca
tched
cv::Exception: %s"
,
e
.
what
());
LOGD
(
"nativeStop ca
ught
cv::Exception: %s"
,
e
.
what
());
jclass
je
=
jenv
->
FindClass
(
"org/opencv/core/CvException"
);
if
(
!
je
)
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
...
...
@@ -156,7 +156,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
}
catch
(...)
{
LOGD
(
"nativeSetFaceSize ca
tched
unknown exception"
);
LOGD
(
"nativeSetFaceSize ca
ught
unknown exception"
);
jclass
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
jenv
->
ThrowNew
(
je
,
"Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}"
);
}
...
...
@@ -175,9 +175,9 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
((
DetectionBasedTracker
*
)
thiz
)
->
getObjects
(
RectFaces
);
vector_Rect_to_Mat
(
RectFaces
,
*
((
Mat
*
)
faces
));
}
catch
(
cv
::
Exception
e
)
catch
(
cv
::
Exception
&
e
)
{
LOGD
(
"nativeCreateObject ca
tched
cv::Exception: %s"
,
e
.
what
());
LOGD
(
"nativeCreateObject ca
ught
cv::Exception: %s"
,
e
.
what
());
jclass
je
=
jenv
->
FindClass
(
"org/opencv/core/CvException"
);
if
(
!
je
)
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
...
...
@@ -185,7 +185,7 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_facedetect_DetectionBasedTracker_
}
catch
(...)
{
LOGD
(
"nativeDetect ca
tched
unknown exception"
);
LOGD
(
"nativeDetect ca
ught
unknown exception"
);
jclass
je
=
jenv
->
FindClass
(
"java/lang/Exception"
);
jenv
->
ThrowNew
(
je
,
"Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}"
);
}
...
...
samples/android/tutorial-3-native/jni/jni_part.cpp
浏览文件 @
8286e1a5
...
...
@@ -12,14 +12,16 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial3_Sample3Native_FindFeatu
JNIEXPORT
void
JNICALL
Java_org_opencv_samples_tutorial3_Sample3Native_FindFeatures
(
JNIEnv
*
,
jobject
,
jlong
addrGray
,
jlong
addrRgba
)
{
Mat
*
pMatGr
=
(
Mat
*
)
addrGray
;
Mat
*
pMatRgb
=
(
Mat
*
)
addrRgba
;
Mat
&
mGr
=
*
(
Mat
*
)
addrGray
;
Mat
&
mRgb
=
*
(
Mat
*
)
addrRgba
;
vector
<
KeyPoint
>
v
;
FastFeatureDetector
detector
(
50
);
detector
.
detect
(
*
pMatGr
,
v
);
for
(
size_t
i
=
0
;
i
<
v
.
size
();
i
++
)
circle
(
*
pMatRgb
,
Point
(
v
[
i
].
pt
.
x
,
v
[
i
].
pt
.
y
),
10
,
Scalar
(
255
,
0
,
0
,
255
));
detector
.
detect
(
mGr
,
v
);
for
(
unsigned
int
i
=
0
;
i
<
v
.
size
();
i
++
)
{
const
KeyPoint
&
kp
=
v
[
i
];
circle
(
mRgb
,
Point
(
kp
.
pt
.
x
,
kp
.
pt
.
y
),
10
,
Scalar
(
255
,
0
,
0
,
255
));
}
}
}
samples/android/tutorial-4-mixed/jni/jni_part.cpp
浏览文件 @
8286e1a5
...
...
@@ -12,14 +12,16 @@ JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Sample4Mixed_FindFeatur
JNIEXPORT
void
JNICALL
Java_org_opencv_samples_tutorial4_Sample4Mixed_FindFeatures
(
JNIEnv
*
,
jobject
,
jlong
addrGray
,
jlong
addrRgba
)
{
Mat
*
pMatGr
=
(
Mat
*
)
addrGray
;
Mat
*
pMatRgb
=
(
Mat
*
)
addrRgba
;
Mat
&
mGr
=
*
(
Mat
*
)
addrGray
;
Mat
&
mRgb
=
*
(
Mat
*
)
addrRgba
;
vector
<
KeyPoint
>
v
;
FastFeatureDetector
detector
(
50
);
detector
.
detect
(
*
pMatGr
,
v
);
for
(
size_t
i
=
0
;
i
<
v
.
size
();
i
++
)
circle
(
*
pMatRgb
,
Point
(
v
[
i
].
pt
.
x
,
v
[
i
].
pt
.
y
),
10
,
Scalar
(
255
,
0
,
0
,
255
));
detector
.
detect
(
mGr
,
v
);
for
(
unsigned
int
i
=
0
;
i
<
v
.
size
();
i
++
)
{
const
KeyPoint
&
kp
=
v
[
i
];
circle
(
mRgb
,
Point
(
kp
.
pt
.
x
,
kp
.
pt
.
y
),
10
,
Scalar
(
255
,
0
,
0
,
255
));
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录