Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张士柳
/
eyemLib
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 75de1885
由
张士柳
编写于
2021-09-15 17:23:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
无
1 个父辈
cde6cc7d
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
3 行增加
和
4 行删除
eyemLib/eyemMisc.cpp
eyemLib/eyemMisc.cpp
查看文件 @
75de188
...
@@ -449,7 +449,7 @@ static int Otsu(int hist[])
...
@@ -449,7 +449,7 @@ static int Otsu(int hist[])
// The float casting here is to avoid compiler warning about loss of precision and
// The float casting here is to avoid compiler warning about loss of precision and
// will prevent overflow in the case of large saturated images
// will prevent overflow in the case of large saturated images
denom
=
(
double
)(
N1
)
*
(
N
-
N1
);
// Maximum value of denom is (N^2)/4 = approx. 3E10
denom
=
(
double
)(
N1
)
*
(
N
-
N1
);
// Maximum value of denom is (N^2)/4 = approx. 3E10
if
(
denom
!=
0
)
{
if
(
denom
!=
0
)
{
// Float here is to avoid loss of precision when dividing
// Float here is to avoid loss of precision when dividing
...
@@ -1368,7 +1368,7 @@ int eyemCountObject(EyemImage tpImage, EyemRect tpRoi, const char *fileName, int
...
@@ -1368,7 +1368,7 @@ int eyemCountObject(EyemImage tpImage, EyemRect tpRoi, const char *fileName, int
//更新元件间角度
//更新元件间角度
partDist
=
(
2
*
asin
(
dChordL
/
(
2
*
trackRadius
)))
*
180
/
PI
;
partDist
=
(
2
*
asin
(
dChordL
/
(
2
*
trackRadius
)))
*
180
/
PI
;
//判断是否结束
//判断是否结束
if
((
mac
.
iPartSize
<
sinPartSize
/
4
)
||
(
trackMat
.
at
<
uchar
>
((
cvRound
(
trackCenter
.
y
)),
(
cvRound
(
trackCenter
.
x
)))
==
255
)
||
(
mac
.
iLimit
/
255
)
>
(
rect
.
size
.
area
()
/
4
)
||
(
sinParts
.
at
<
uchar
>
((
cvRound
(
trackCenter
.
y
)),
(
cvRound
(
trackCenter
.
x
)))
==
0
))
if
((
mac
.
iPartSize
<
sinPartSize
/
4
)
||
(
trackMat
.
at
<
uchar
>
((
cvRound
(
trackCenter
.
y
)),
(
cvRound
(
trackCenter
.
x
)))
==
255
)
||
(
mac
.
iLimit
/
255
)
>
(
rect
.
size
.
area
()
/
4
)
||
(
sinParts
.
at
<
uchar
>
((
cvRound
(
trackCenter
.
y
)),
(
cvRound
(
trackCenter
.
x
)))
==
0
))
{
{
found
=
false
;
found
=
false
;
//for (int j = 0; j < 4; j++)
//for (int j = 0; j < 4; j++)
...
@@ -4474,7 +4474,7 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
...
@@ -4474,7 +4474,7 @@ int eyemCountObjectIrregularParts(EyemImage tpImage, EyemRect tpRoi, const char
{
{
//面积过滤
//面积过滤
if
(
stats
.
ptr
<
int
>
(
j
)[
cv
::
CC_STAT_AREA
]
>
2
)
{
if
(
stats
.
ptr
<
int
>
(
j
)[
cv
::
CC_STAT_AREA
]
>
2
)
{
binary
.
at
<
uchar
>
(
cv
::
Point
(
cvRound
((
float
)
dpCent
[(
0
)
+
(
j
)
*
2
]),
cvRound
((
float
)
dpCent
[(
1
)
+
(
j
)
*
2
])))
=
255
;
binary
.
at
<
uchar
>
(
cv
::
Point
(
cvRound
((
float
)
dpCent
[(
0
)
+
(
j
)
*
2
]),
cvRound
((
float
)
dpCent
[(
1
)
+
(
j
)
*
2
])))
=
255
;
}
}
}
}
}
}
...
@@ -7953,7 +7953,6 @@ int eyemLibImpl(EyemImage tpImage, EyemHSVModel tpHSVModel, EyemImage *tpDstImg)
...
@@ -7953,7 +7953,6 @@ int eyemLibImpl(EyemImage tpImage, EyemHSVModel tpHSVModel, EyemImage *tpDstImg)
(
tpHSVModel
.
dpRangeUExt
[
0
]
+
tpHSVModel
.
dpRangeUExt
[
1
]
+
tpHSVModel
.
dpRangeUExt
[
2
])
!=
0
)
{
(
tpHSVModel
.
dpRangeUExt
[
0
]
+
tpHSVModel
.
dpRangeUExt
[
1
]
+
tpHSVModel
.
dpRangeUExt
[
2
])
!=
0
)
{
std
::
cout
<<
"红色"
<<
std
::
endl
;
std
::
cout
<<
"红色"
<<
std
::
endl
;
}
}
return
FUNC_OK
;
return
FUNC_OK
;
//shape_based_matching GM; // object to implent geometric matching
//shape_based_matching GM; // object to implent geometric matching
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论