Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
635bbfe9
O
Opencv
项目概览
Greenplum
/
Opencv
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
635bbfe9
编写于
6月 06, 2023
作者:
A
Alexander Smorkalov
提交者:
GitHub
6月 06, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #23748 from AleksandrPanov:fix_cornerRefinementMethod_binding
fix Java bindings for cornerRefinementMethod binding
上级
9fa014ed
b5ac7ef2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
18 deletion
+18
-18
modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
...es/objdetect/include/opencv2/objdetect/aruco_detector.hpp
+2
-2
modules/objdetect/perf/perf_aruco.cpp
modules/objdetect/perf/perf_aruco.cpp
+3
-3
modules/objdetect/src/aruco/aruco_detector.cpp
modules/objdetect/src/aruco/aruco_detector.cpp
+6
-6
modules/objdetect/test/test_arucodetection.cpp
modules/objdetect/test/test_arucodetection.cpp
+3
-3
modules/objdetect/test/test_boarddetection.cpp
modules/objdetect/test/test_boarddetection.cpp
+2
-2
modules/objdetect/test/test_charucodetection.cpp
modules/objdetect/test/test_charucodetection.cpp
+2
-2
未找到文件。
modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
浏览文件 @
635bbfe9
...
...
@@ -34,7 +34,7 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
minCornerDistanceRate
=
0.05
;
minDistanceToBorder
=
3
;
minMarkerDistanceRate
=
0.05
;
cornerRefinementMethod
=
CORNER_REFINE_NONE
;
cornerRefinementMethod
=
(
int
)
CORNER_REFINE_NONE
;
cornerRefinementWinSize
=
5
;
cornerRefinementMaxIterations
=
30
;
cornerRefinementMinAccuracy
=
0.1
;
...
...
@@ -106,7 +106,7 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
CV_PROP_RW
double
minMarkerDistanceRate
;
/** @brief default value CORNER_REFINE_NONE */
CV_PROP_RW
CornerRefineMethod
cornerRefinementMethod
;
CV_PROP_RW
int
cornerRefinementMethod
;
/// window size for the corner refinement process (in pixels) (default 5).
CV_PROP_RW
int
cornerRefinementWinSize
;
...
...
modules/objdetect/perf/perf_aruco.cpp
浏览文件 @
635bbfe9
...
...
@@ -171,7 +171,7 @@ PERF_TEST_P(EstimateAruco, ArucoFirst, ESTIMATE_PARAMS) {
aruco
::
DetectorParameters
detectorParams
;
detectorParams
.
minDistanceToBorder
=
1
;
detectorParams
.
markerBorderBits
=
1
;
detectorParams
.
cornerRefinementMethod
=
cv
::
aruco
::
CORNER_REFINE_SUBPIX
;
detectorParams
.
cornerRefinementMethod
=
(
int
)
cv
::
aruco
::
CORNER_REFINE_SUBPIX
;
const
int
markerSize
=
100
;
const
int
numMarkersInRow
=
9
;
...
...
@@ -203,7 +203,7 @@ PERF_TEST_P(EstimateAruco, ArucoSecond, ESTIMATE_PARAMS) {
aruco
::
DetectorParameters
detectorParams
;
detectorParams
.
minDistanceToBorder
=
1
;
detectorParams
.
markerBorderBits
=
1
;
detectorParams
.
cornerRefinementMethod
=
cv
::
aruco
::
CORNER_REFINE_SUBPIX
;
detectorParams
.
cornerRefinementMethod
=
(
int
)
cv
::
aruco
::
CORNER_REFINE_SUBPIX
;
//USE_ARUCO3
detectorParams
.
useAruco3Detection
=
get
<
0
>
(
testParams
);
...
...
@@ -255,7 +255,7 @@ PERF_TEST_P(EstimateLargeAruco, ArucoFHD, ESTIMATE_FHD_PARAMS) {
aruco
::
DetectorParameters
detectorParams
;
detectorParams
.
minDistanceToBorder
=
1
;
detectorParams
.
markerBorderBits
=
1
;
detectorParams
.
cornerRefinementMethod
=
cv
::
aruco
::
CORNER_REFINE_SUBPIX
;
detectorParams
.
cornerRefinementMethod
=
(
int
)
cv
::
aruco
::
CORNER_REFINE_SUBPIX
;
//USE_ARUCO3
detectorParams
.
useAruco3Detection
=
get
<
0
>
(
testParams
).
useAruco3Detection
;
...
...
modules/objdetect/src/aruco/aruco_detector.cpp
浏览文件 @
635bbfe9
...
...
@@ -881,7 +881,7 @@ void ArucoDetector::detectMarkers(InputArray _image, OutputArrayOfArrays _corner
}
else
{
// always turn on corner refinement in case of Aruco3, due to upsampling
detectorParams
.
cornerRefinementMethod
=
CORNER_REFINE_SUBPIX
;
detectorParams
.
cornerRefinementMethod
=
(
int
)
CORNER_REFINE_SUBPIX
;
// only CORNER_REFINE_SUBPIX implement correctly for useAruco3Detection
// Todo: update other CORNER_REFINE methods
}
...
...
@@ -923,7 +923,7 @@ void ArucoDetector::detectMarkers(InputArray _image, OutputArrayOfArrays _corner
vector
<
vector
<
vector
<
Point
>
>
>
contoursSet
;
/// STEP 2.a Detect marker candidates :: using AprilTag
if
(
detectorParams
.
cornerRefinementMethod
==
CORNER_REFINE_APRILTAG
){
if
(
detectorParams
.
cornerRefinementMethod
==
(
int
)
CORNER_REFINE_APRILTAG
){
_apriltag
(
grey
,
detectorParams
,
candidates
,
contours
);
candidatesSet
.
push_back
(
candidates
);
...
...
@@ -938,7 +938,7 @@ void ArucoDetector::detectMarkers(InputArray _image, OutputArrayOfArrays _corner
candidates
,
contours
,
ids
,
detectorParams
,
_rejectedImgPoints
);
/// STEP 3: Corner refinement :: use corner subpix
if
(
detectorParams
.
cornerRefinementMethod
==
CORNER_REFINE_SUBPIX
)
{
if
(
detectorParams
.
cornerRefinementMethod
==
(
int
)
CORNER_REFINE_SUBPIX
)
{
CV_Assert
(
detectorParams
.
cornerRefinementWinSize
>
0
&&
detectorParams
.
cornerRefinementMaxIterations
>
0
&&
detectorParams
.
cornerRefinementMinAccuracy
>
0
);
// Do subpixel estimation. In Aruco3 start on the lowest pyramid level and upscale the corners
...
...
@@ -963,7 +963,7 @@ void ArucoDetector::detectMarkers(InputArray _image, OutputArrayOfArrays _corner
}
/// STEP 3, Optional : Corner refinement :: use contour container
if
(
detectorParams
.
cornerRefinementMethod
==
CORNER_REFINE_CONTOUR
){
if
(
detectorParams
.
cornerRefinementMethod
==
(
int
)
CORNER_REFINE_CONTOUR
){
if
(
!
ids
.
empty
())
{
...
...
@@ -976,7 +976,7 @@ void ArucoDetector::detectMarkers(InputArray _image, OutputArrayOfArrays _corner
}
}
if
(
detectorParams
.
cornerRefinementMethod
!=
CORNER_REFINE_SUBPIX
&&
fxfy
!=
1.
f
)
{
if
(
detectorParams
.
cornerRefinementMethod
!=
(
int
)
CORNER_REFINE_SUBPIX
&&
fxfy
!=
1.
f
)
{
// only CORNER_REFINE_SUBPIX implement correctly for useAruco3Detection
// Todo: update other CORNER_REFINE methods
...
...
@@ -1213,7 +1213,7 @@ void ArucoDetector::refineDetectedMarkers(InputArray _image, const Board& _board
if
(
closestCandidateIdx
>=
0
)
{
// subpixel refinement
if
(
detectorParams
.
cornerRefinementMethod
==
CORNER_REFINE_SUBPIX
)
{
if
(
detectorParams
.
cornerRefinementMethod
==
(
int
)
CORNER_REFINE_SUBPIX
)
{
CV_Assert
(
detectorParams
.
cornerRefinementWinSize
>
0
&&
detectorParams
.
cornerRefinementMaxIterations
>
0
&&
detectorParams
.
cornerRefinementMinAccuracy
>
0
);
...
...
modules/objdetect/test/test_arucodetection.cpp
浏览文件 @
635bbfe9
...
...
@@ -268,12 +268,12 @@ void CV_ArucoDetectionPerspective::run(int) {
}
if
(
ArucoAlgParams
::
USE_APRILTAG
==
arucoAlgParams
){
detectorParameters
.
cornerRefinementMethod
=
aruco
::
CORNER_REFINE_APRILTAG
;
detectorParameters
.
cornerRefinementMethod
=
(
int
)
aruco
::
CORNER_REFINE_APRILTAG
;
}
if
(
ArucoAlgParams
::
USE_ARUCO3
==
arucoAlgParams
)
{
detectorParameters
.
useAruco3Detection
=
true
;
detectorParameters
.
cornerRefinementMethod
=
aruco
::
CORNER_REFINE_SUBPIX
;
detectorParameters
.
cornerRefinementMethod
=
(
int
)
aruco
::
CORNER_REFINE_SUBPIX
;
}
detector
.
setDetectorParameters
(
detectorParameters
);
...
...
@@ -653,7 +653,7 @@ TEST_P(ArucoThreading, number_of_threads_does_not_change_results)
img_marker
.
copyTo
(
img
(
Rect
(
shift
,
shift
,
height_marker
,
height_marker
)));
aruco
::
DetectorParameters
detectorParameters
=
detector
.
getDetectorParameters
();
detectorParameters
.
cornerRefinementMethod
=
GetParam
();
detectorParameters
.
cornerRefinementMethod
=
(
int
)
GetParam
();
detector
.
setDetectorParameters
(
detectorParameters
);
vector
<
vector
<
Point2f
>
>
original_corners
;
...
...
modules/objdetect/test/test_boarddetection.cpp
浏览文件 @
635bbfe9
...
...
@@ -26,7 +26,7 @@ class CV_ArucoBoardPose : public cvtest::BaseTest {
params
.
minDistanceToBorder
=
3
;
if
(
arucoAlgParams
==
ArucoAlgParams
::
USE_ARUCO3
)
{
params
.
useAruco3Detection
=
true
;
params
.
cornerRefinementMethod
=
aruco
::
CORNER_REFINE_SUBPIX
;
params
.
cornerRefinementMethod
=
(
int
)
aruco
::
CORNER_REFINE_SUBPIX
;
params
.
minSideLengthCanonicalImg
=
16
;
params
.
errorCorrectionRate
=
0.8
;
}
...
...
@@ -137,7 +137,7 @@ class CV_ArucoRefine : public cvtest::BaseTest {
aruco
::
Dictionary
dictionary
=
aruco
::
getPredefinedDictionary
(
aruco
::
DICT_6X6_250
);
aruco
::
DetectorParameters
params
;
params
.
minDistanceToBorder
=
3
;
params
.
cornerRefinementMethod
=
aruco
::
CORNER_REFINE_SUBPIX
;
params
.
cornerRefinementMethod
=
(
int
)
aruco
::
CORNER_REFINE_SUBPIX
;
if
(
arucoAlgParams
==
ArucoAlgParams
::
USE_ARUCO3
)
params
.
useAruco3Detection
=
true
;
aruco
::
RefineParameters
refineParams
(
10.
f
,
3.
f
,
true
);
...
...
modules/objdetect/test/test_charucodetection.cpp
浏览文件 @
635bbfe9
...
...
@@ -612,7 +612,7 @@ TEST(Charuco, testBoardSubpixelCoords)
cv
::
GaussianBlur
(
gray
,
gray
,
Size
(
5
,
5
),
1.0
);
aruco
::
DetectorParameters
params
;
params
.
cornerRefinementMethod
=
cv
::
aruco
::
CORNER_REFINE_APRILTAG
;
params
.
cornerRefinementMethod
=
(
int
)
cv
::
aruco
::
CORNER_REFINE_APRILTAG
;
aruco
::
CharucoParameters
charucoParameters
;
charucoParameters
.
cameraMatrix
=
K
;
...
...
@@ -636,7 +636,7 @@ TEST(Charuco, issue_14014)
Mat
img
=
imread
(
imgPath
);
aruco
::
DetectorParameters
detectorParams
;
detectorParams
.
cornerRefinementMethod
=
aruco
::
CORNER_REFINE_SUBPIX
;
detectorParams
.
cornerRefinementMethod
=
(
int
)
aruco
::
CORNER_REFINE_SUBPIX
;
detectorParams
.
cornerRefinementMinAccuracy
=
0.01
;
aruco
::
ArucoDetector
detector
(
aruco
::
getPredefinedDictionary
(
aruco
::
DICT_7X7_250
),
detectorParams
);
aruco
::
CharucoBoard
board
(
Size
(
8
,
5
),
0.03455
f
,
0.02164
f
,
detector
.
getDictionary
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录