Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
opencv
提交
199687a1
O
opencv
项目概览
Oneflow-Inc
/
opencv
12 个月 前同步成功
通知
14
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,发现更多精彩内容 >>
提交
199687a1
编写于
10月 02, 2020
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
上级
b5a6c8e2
a5b8f163
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
320 addition
and
188 deletion
+320
-188
modules/calib3d/src/fundam.cpp
modules/calib3d/src/fundam.cpp
+3
-0
modules/calib3d/test/test_homography.cpp
modules/calib3d/test/test_homography.cpp
+25
-1
modules/dnn/src/darknet/darknet_io.cpp
modules/dnn/src/darknet/darknet_io.cpp
+2
-2
modules/dnn/src/layers/resize_layer.cpp
modules/dnn/src/layers/resize_layer.cpp
+1
-1
modules/dnn/src/onnx/onnx_importer.cpp
modules/dnn/src/onnx/onnx_importer.cpp
+282
-178
modules/highgui/src/window_w32.cpp
modules/highgui/src/window_w32.cpp
+2
-2
modules/imgproc/include/opencv2/imgproc/detail/gcgraph.hpp
modules/imgproc/include/opencv2/imgproc/detail/gcgraph.hpp
+2
-0
modules/imgproc/src/subdivision2d.cpp
modules/imgproc/src/subdivision2d.cpp
+3
-4
未找到文件。
modules/calib3d/src/fundam.cpp
浏览文件 @
199687a1
...
...
@@ -380,6 +380,9 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
return
Mat
();
convertPointsFromHomogeneous
(
p
,
p
);
}
// Need at least 4 point correspondences to calculate Homography
if
(
npoints
<
4
)
CV_Error
(
Error
::
StsVecLengthErr
,
"The input arrays should have at least 4 corresponding point sets to calculate Homography"
);
p
.
reshape
(
2
,
npoints
).
convertTo
(
m
,
CV_32F
);
}
...
...
modules/calib3d/test/test_homography.cpp
浏览文件 @
199687a1
...
...
@@ -63,6 +63,7 @@ namespace opencv_test { namespace {
#define MESSAGE_RANSAC_DIFF "Reprojection error for current pair of points more than required."
#define MAX_COUNT_OF_POINTS 303
#define MIN_COUNT_OF_POINTS 4
#define COUNT_NORM_TYPES 3
#define METHODS_COUNT 4
...
...
@@ -249,7 +250,7 @@ void CV_HomographyTest::print_information_8(int _method, int j, int N, int k, in
void
CV_HomographyTest
::
run
(
int
)
{
for
(
int
N
=
4
;
N
<=
MAX_COUNT_OF_POINTS
;
++
N
)
for
(
int
N
=
MIN_COUNT_OF_POINTS
;
N
<=
MAX_COUNT_OF_POINTS
;
++
N
)
{
RNG
&
rng
=
ts
->
get_rng
();
...
...
@@ -711,4 +712,27 @@ TEST(Calib3d_Homography, fromImages)
ASSERT_GE
(
ninliers1
,
80
);
}
TEST
(
Calib3d_Homography
,
minPoints
)
{
float
pt1data
[]
=
{
2.80073029e+002
f
,
2.39591217e+002
f
,
2.21912201e+002
f
,
2.59783997e+002
f
};
float
pt2data
[]
=
{
1.84072723e+002
f
,
1.43591202e+002
f
,
1.25912483e+002
f
,
1.63783859e+002
f
};
int
npoints
=
(
int
)(
sizeof
(
pt1data
)
/
sizeof
(
pt1data
[
0
])
/
2
);
printf
(
"npoints = %d
\n
"
,
npoints
);
// npoints = 2
Mat
p1
(
1
,
npoints
,
CV_32FC2
,
pt1data
);
Mat
p2
(
1
,
npoints
,
CV_32FC2
,
pt2data
);
Mat
mask
;
// findHomography should raise an error since npoints < MIN_COUNT_OF_POINTS
EXPECT_THROW
(
findHomography
(
p1
,
p2
,
RANSAC
,
0.01
,
mask
),
cv
::
Exception
);
}
}}
// namespace
modules/dnn/src/darknet/darknet_io.cpp
浏览文件 @
199687a1
...
...
@@ -984,8 +984,8 @@ namespace cv {
}
std
::
string
activation
=
getParam
<
std
::
string
>
(
layer_params
,
"activation"
,
"linear"
);
if
(
activation
==
"leaky"
||
activation
==
"swish"
||
activation
==
"mish"
||
activation
==
"logistic
"
)
++
cv_layers_counter
;
// For ReLU, Swish, Mish, Sigmoid
if
(
activation
!=
"linear
"
)
++
cv_layers_counter
;
// For ReLU, Swish, Mish, Sigmoid
, etc
if
(
!
darknet_layers_counter
)
tensor_shape
.
resize
(
1
);
...
...
modules/dnn/src/layers/resize_layer.cpp
浏览文件 @
199687a1
...
...
@@ -45,7 +45,7 @@ public:
CV_Assert
(
params
.
has
(
"zoom_factor_x"
)
&&
params
.
has
(
"zoom_factor_y"
));
}
interpolation
=
params
.
get
<
String
>
(
"interpolation"
);
CV_
Assert
(
interpolation
==
"nearest"
||
interpolation
==
"opencv_linear"
||
interpolation
==
"bilinear
"
);
CV_
Check
(
interpolation
,
interpolation
==
"nearest"
||
interpolation
==
"opencv_linear"
||
interpolation
==
"bilinear"
,
"
"
);
alignCorners
=
params
.
get
<
bool
>
(
"align_corners"
,
false
);
}
...
...
modules/dnn/src/onnx/onnx_importer.cpp
浏览文件 @
199687a1
此差异已折叠。
点击以展开。
modules/highgui/src/window_w32.cpp
浏览文件 @
199687a1
...
...
@@ -263,13 +263,13 @@ CV_IMPL int cvInitSystem( int, char** )
wndc
.
lpszMenuName
=
highGUIclassName
;
wndc
.
hIcon
=
LoadIcon
(
0
,
IDI_APPLICATION
);
wndc
.
hCursor
=
(
HCURSOR
)
LoadCursor
(
0
,
(
LPSTR
)(
size_t
)
IDC_CROSS
);
wndc
.
hbrBackground
=
(
HBRUSH
)
GetStockObject
(
GRAY_BRUSH
);
wndc
.
hbrBackground
=
(
HBRUSH
)
GetStockObject
(
DK
GRAY_BRUSH
);
RegisterClass
(
&
wndc
);
wndc
.
lpszClassName
=
mainHighGUIclassName
;
wndc
.
lpszMenuName
=
mainHighGUIclassName
;
wndc
.
hbrBackground
=
(
HBRUSH
)
GetStockObject
(
GRAY_BRUSH
);
wndc
.
hbrBackground
=
(
HBRUSH
)
GetStockObject
(
DK
GRAY_BRUSH
);
wndc
.
lpfnWndProc
=
MainWindowProc
;
RegisterClass
(
&
wndc
);
...
...
modules/imgproc/include/opencv2/imgproc/detail/gcgraph.hpp
浏览文件 @
199687a1
...
...
@@ -155,6 +155,8 @@ void GCGraph<TWeight>::addTermWeights( int i, TWeight sourceW, TWeight sinkW )
template
<
class
TWeight
>
TWeight
GCGraph
<
TWeight
>::
maxFlow
()
{
CV_Assert
(
!
vtcs
.
empty
());
CV_Assert
(
!
edges
.
empty
());
const
int
TERMINAL
=
-
1
,
ORPHAN
=
-
2
;
Vtx
stub
,
*
nilNode
=
&
stub
,
*
first
=
nilNode
,
*
last
=
nilNode
;
int
curr_ts
=
0
;
...
...
modules/imgproc/src/subdivision2d.cpp
浏览文件 @
199687a1
...
...
@@ -758,7 +758,6 @@ void Subdiv2D::getTriangleList(std::vector<Vec6f>& triangleList) const
triangleList
.
clear
();
int
i
,
total
=
(
int
)(
qedges
.
size
()
*
4
);
std
::
vector
<
bool
>
edgemask
(
total
,
false
);
const
bool
filterPoints
=
true
;
Rect2f
rect
(
topLeft
.
x
,
topLeft
.
y
,
bottomRight
.
x
-
topLeft
.
x
,
bottomRight
.
y
-
topLeft
.
y
);
for
(
i
=
4
;
i
<
total
;
i
+=
2
)
...
...
@@ -768,15 +767,15 @@ void Subdiv2D::getTriangleList(std::vector<Vec6f>& triangleList) const
Point2f
a
,
b
,
c
;
int
edge_a
=
i
;
edgeOrg
(
edge_a
,
&
a
);
if
(
filterPoints
&&
!
rect
.
contains
(
a
)
)
if
(
!
rect
.
contains
(
a
)
)
continue
;
int
edge_b
=
getEdge
(
edge_a
,
NEXT_AROUND_LEFT
);
edgeOrg
(
edge_b
,
&
b
);
if
(
filterPoints
&&
!
rect
.
contains
(
b
)
)
if
(
!
rect
.
contains
(
b
)
)
continue
;
int
edge_c
=
getEdge
(
edge_b
,
NEXT_AROUND_LEFT
);
edgeOrg
(
edge_c
,
&
c
);
if
(
filterPoints
&&
!
rect
.
contains
(
c
)
)
if
(
!
rect
.
contains
(
c
)
)
continue
;
edgemask
[
edge_a
]
=
true
;
edgemask
[
edge_b
]
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录