Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
d2613dd9
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
d2613dd9
编写于
9月 18, 2012
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added patches by Bram Bolder
上级
310bd870
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
36 deletion
+47
-36
modules/imgproc/src/cornersubpix.cpp
modules/imgproc/src/cornersubpix.cpp
+17
-23
modules/imgproc/src/deriv.cpp
modules/imgproc/src/deriv.cpp
+30
-13
未找到文件。
modules/imgproc/src/cornersubpix.cpp
浏览文件 @
d2613dd9
...
...
@@ -48,8 +48,7 @@ cvFindCornerSubPix( const void* srcarr, CvPoint2D32f* corners,
cv
::
AutoBuffer
<
float
>
buffer
;
const
int
MAX_ITERS
=
100
;
const
float
drv_x
[]
=
{
-
1.
f
,
0.
f
,
1.
f
};
const
float
drv_y
[]
=
{
0.
f
,
0.5
f
,
0.
f
};
const
float
drv
[]
=
{
-
1.
f
,
0.
f
,
1.
f
};
float
*
maskX
;
float
*
maskY
;
float
*
mask
;
...
...
@@ -187,13 +186,12 @@ cvFindCornerSubPix( const void* srcarr, CvPoint2D32f* corners,
cvSize
(
win_w
+
2
,
win_h
+
2
),
cI
));
/* calc derivatives */
icvSepConvSmall3_32f
(
src_buffer
,
src_buf_size
.
width
*
sizeof
(
src_buffer
[
0
]),
gx_buffer
,
win_w
*
sizeof
(
gx_buffer
[
0
]),
src_buf_size
,
drv_x
,
drv_y
,
buffer
);
icvSepConvSmall3_32f
(
src_buffer
,
src_buf_size
.
width
*
sizeof
(
src_buffer
[
0
]),
gy_buffer
,
win_w
*
sizeof
(
gy_buffer
[
0
]),
src_buf_size
,
drv_y
,
drv_x
,
buffer
);
icvSepConvSmall3_32f
(
src_buffer
+
src_buf_size
.
width
,
src_buf_size
.
width
*
sizeof
(
src_buffer
[
0
]),
gx_buffer
,
win_w
*
sizeof
(
gx_buffer
[
0
]),
src_buf_size
,
drv
,
NULL
,
NULL
);
icvSepConvSmall3_32f
(
src_buffer
+
1
,
src_buf_size
.
width
*
sizeof
(
src_buffer
[
0
]),
gy_buffer
,
win_w
*
sizeof
(
gy_buffer
[
0
]),
src_buf_size
,
NULL
,
drv
,
NULL
);
a
=
b
=
c
=
bb1
=
bb2
=
0
;
...
...
@@ -221,21 +219,17 @@ cvFindCornerSubPix( const void* srcarr, CvPoint2D32f* corners,
}
}
double
det
=
a
*
c
-
b
*
b
;
if
(
fabs
(
det
)
>
DBL_EPSILON
*
DBL_EPSILON
)
{
double
A
[
4
];
double
InvA
[
4
];
CvMat
matA
,
matInvA
;
A
[
0
]
=
a
;
A
[
1
]
=
A
[
2
]
=
b
;
A
[
3
]
=
c
;
cvInitMatHeader
(
&
matA
,
2
,
2
,
CV_64F
,
A
);
cvInitMatHeader
(
&
matInvA
,
2
,
2
,
CV_64FC1
,
InvA
);
cvInvert
(
&
matA
,
&
matInvA
,
CV_SVD
);
cI2
.
x
=
(
float
)(
cI
.
x
+
InvA
[
0
]
*
bb1
+
InvA
[
1
]
*
bb2
);
cI2
.
y
=
(
float
)(
cI
.
y
+
InvA
[
2
]
*
bb1
+
InvA
[
3
]
*
bb2
);
// 2x2 matrix inversion
double
scale
=
1.0
/
det
;
cI2
.
x
=
(
float
)(
cI
.
x
+
c
*
scale
*
bb1
-
b
*
scale
*
bb2
);
cI2
.
y
=
(
float
)(
cI
.
y
-
b
*
scale
*
bb1
+
a
*
scale
*
bb2
);
}
else
{
cI2
=
cI
;
}
err
=
(
cI2
.
x
-
cI
.
x
)
*
(
cI2
.
x
-
cI
.
x
)
+
(
cI2
.
y
-
cI
.
y
)
*
(
cI2
.
y
-
cI
.
y
);
...
...
modules/imgproc/src/deriv.cpp
浏览文件 @
d2613dd9
...
...
@@ -51,6 +51,7 @@ void icvSepConvSmall3_32f( float* src, int src_step, float* dst, int dst_step,
{
int
dst_width
,
buffer_step
=
0
;
int
x
,
y
;
bool
fast_kx
=
true
,
fast_ky
=
true
;
assert
(
src
&&
dst
&&
src_size
.
width
>
2
&&
src_size
.
height
>
2
&&
(
src_step
&
3
)
==
0
&&
(
dst_step
&
3
)
==
0
&&
...
...
@@ -71,35 +72,51 @@ void icvSepConvSmall3_32f( float* src, int src_step, float* dst, int dst_step,
buffer
=
dst
;
dst_width
=
0
;
}
else
fast_kx
=
kx
[
1
]
==
0.
f
&&
kx
[
0
]
==
-
kx
[
2
]
&&
kx
[
0
]
==
-
1.
f
;
assert
(
src_step
>=
src_size
.
width
&&
dst_step
>=
dst_width
);
src_size
.
height
-=
3
;
src_size
.
height
-=
2
;
if
(
!
ky
)
{
/* set vars, so that vertical convolution won't run and
horizontal convolution will write results into destination ROI */
src_size
.
height
+=
3
;
src_size
.
height
+=
2
;
buffer_step
=
src_step
;
buffer
=
src
;
src_size
.
width
=
0
;
}
else
fast_ky
=
ky
[
1
]
==
0.
f
&&
ky
[
0
]
==
-
ky
[
2
]
&&
ky
[
0
]
==
-
1.
f
;
for
(
y
=
0
;
y
<
=
src_size
.
height
;
y
++
,
src
+=
src_step
,
dst
+=
dst_step
,
buffer
+=
buffer_step
)
for
(
y
=
0
;
y
<
src_size
.
height
;
y
++
,
src
+=
src_step
,
dst
+=
dst_step
,
buffer
+=
buffer_step
)
{
float
*
src2
=
src
+
src_step
;
float
*
src3
=
src
+
src_step
*
2
;
for
(
x
=
0
;
x
<
src_size
.
width
;
x
++
)
{
buffer
[
x
]
=
(
float
)(
ky
[
0
]
*
src
[
x
]
+
ky
[
1
]
*
src2
[
x
]
+
ky
[
2
]
*
src3
[
x
]);
}
if
(
fast_ky
)
for
(
x
=
0
;
x
<
src_size
.
width
;
x
++
)
{
buffer
[
x
]
=
(
float
)(
src3
[
x
]
-
src
[
x
]);
}
else
for
(
x
=
0
;
x
<
src_size
.
width
;
x
++
)
{
buffer
[
x
]
=
(
float
)(
ky
[
0
]
*
src
[
x
]
+
ky
[
1
]
*
src2
[
x
]
+
ky
[
2
]
*
src3
[
x
]);
}
for
(
x
=
0
;
x
<
dst_width
;
x
++
)
{
dst
[
x
]
=
(
float
)(
kx
[
0
]
*
buffer
[
x
]
+
kx
[
1
]
*
buffer
[
x
+
1
]
+
kx
[
2
]
*
buffer
[
x
+
2
]);
}
if
(
fast_kx
)
for
(
x
=
0
;
x
<
dst_width
;
x
++
)
{
dst
[
x
]
=
(
float
)(
buffer
[
x
+
2
]
-
buffer
[
x
]);
}
else
for
(
x
=
0
;
x
<
dst_width
;
x
++
)
{
dst
[
x
]
=
(
float
)(
kx
[
0
]
*
buffer
[
x
]
+
kx
[
1
]
*
buffer
[
x
+
1
]
+
kx
[
2
]
*
buffer
[
x
+
2
]);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录