Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.H2V
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.H2V
Commits
00c929b2
Commit
00c929b2
authored
Aug 22, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 添加算法初始化流程
2. 在裁切状态下绘制目标框的功能
parent
ef7debf5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
138 additions
and
8 deletions
+138
-8
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
+8
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/IAlgorithmController.cs
+8
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Cableway.cs
+20
-1
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Near.cs
+21
-1
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Single.cs
+25
-1
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Sixteen.cs
+21
-1
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Tactics.cs
+21
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Message.cs
+6
-2
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
+5
-0
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
+1
-1
VIZ.H2V/config/config.ini
+2
-0
No files found.
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
View file @
00c929b2
...
...
@@ -157,6 +157,14 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 初始化算法
/// </summary>
/// <remarks>
/// 初始化消息和自动模式消息一致,信号为no_mode
/// </remarks>
public
abstract
void
InitAlgorithm
();
/// <summary>
/// 切换至自动模式
/// </summary>
/// <param name="context">切换模式上下文</param>
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/IAlgorithmController.cs
View file @
00c929b2
...
...
@@ -65,6 +65,14 @@ namespace VIZ.H2V.Module
void
BorderPoint
(
AlgorithmInfo_borderpoint
borderpoint
);
/// <summary>
/// 初始化算法
/// </summary>
/// <remarks>
/// 初始化消息和自动模式消息一致,信号为no_mode
/// </remarks>
void
InitAlgorithm
();
/// <summary>
/// 切换至无模式
/// </summary>
void
ChangeNoMode
();
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Cableway.cs
View file @
00c929b2
...
...
@@ -24,6 +24,25 @@ namespace VIZ.H2V.Module
{
}
/// <summary>
/// 初始化算法
/// </summary>
/// <remarks>
/// 初始化消息和自动模式消息一致,信号为no_mode
/// </remarks>
public
override
void
InitAlgorithm
()
{
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
AlgorithmSenderOption
option
=
new
AlgorithmSenderOption
();
option
.
id
=
this
.
Support
.
ID
;
option
.
enable_sendto_crop
=
this
.
Support
.
ViewConfig
.
IsSendToCrop
;
AlgorithmPackage__auto_mode_Cableway
package
=
this
.
BuildPackage
(
null
);
package
.
signal
=
AlgorithmPackageSignal
.
no_mode
;
AlgorithmSender
.
AutoMode
(
manager
,
package
,
option
);
}
/// <summary>
/// 切换至自动模式
/// </summary>
/// <param name="context">切换模式上下文</param>
...
...
@@ -110,7 +129,7 @@ namespace VIZ.H2V.Module
AlgorithmPackage__auto_mode_Cableway
package
=
new
AlgorithmPackage__auto_mode_Cableway
();
package
.
cmd
=
cmd
;
package
.
smooth
=
config
.
SmoothCoeff
;
package
.
smooth
=
Math
.
Round
(
config
.
SmoothCoeff
,
3
)
;
package
.
max_fixed_frames
=
config
.
KeepPrevFrame
;
package
.
min_human_area
=
config
.
PersonAreaProportion
/
100d
;
package
.
weight_area
=
config
.
PersonAreaProportionWeight
/
100d
;
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Near.cs
View file @
00c929b2
...
...
@@ -24,6 +24,26 @@ namespace VIZ.H2V.Module
{
}
/// <summary>
/// 初始化算法
/// </summary>
/// <remarks>
/// 初始化消息和自动模式消息一致,信号为no_mode
/// </remarks>
public
override
void
InitAlgorithm
()
{
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
AlgorithmSenderOption
option
=
new
AlgorithmSenderOption
();
option
.
id
=
this
.
Support
.
ID
;
option
.
enable_sendto_crop
=
this
.
Support
.
ViewConfig
.
IsSendToCrop
;
AlgorithmPackage__auto_mode_Near
package
=
this
.
BuildPackage
(
null
,
null
);
package
.
signal
=
AlgorithmPackageSignal
.
no_mode
;
AlgorithmSender
.
AutoMode
(
manager
,
package
,
option
);
}
/// <summary>
/// 切换至自动模式
/// </summary>
/// <param name="context">切换模式上下文</param>
...
...
@@ -121,7 +141,7 @@ namespace VIZ.H2V.Module
AlgorithmPackage__auto_mode_Near
package
=
new
AlgorithmPackage__auto_mode_Near
();
package
.
cmd
=
cmd
;
package
.
smooth
=
config
.
SmoothCoeff
;
package
.
smooth
=
Math
.
Round
(
config
.
SmoothCoeff
,
3
)
;
package
.
max_fixed_frames
=
config
.
KeepPrevFrame
;
package
.
min_human_area
=
config
.
PersonAreaProportion
/
100d
;
package
.
weight_area
=
config
.
PersonAreaProportionWeight
/
100d
;
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Single.cs
View file @
00c929b2
...
...
@@ -25,6 +25,26 @@ namespace VIZ.H2V.Module
{
}
/// <summary>
/// 初始化算法
/// </summary>
/// <remarks>
/// 初始化消息和自动模式消息一致,信号为no_mode
/// </remarks>
public
override
void
InitAlgorithm
()
{
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
AlgorithmSenderOption
option
=
new
AlgorithmSenderOption
();
option
.
id
=
this
.
Support
.
ID
;
option
.
enable_sendto_crop
=
this
.
Support
.
ViewConfig
.
IsSendToCrop
;
AlgorithmPackage__auto_mode_Single
package
=
this
.
BuildPackage
(
null
,
null
);
package
.
signal
=
AlgorithmPackageSignal
.
no_mode
;
AlgorithmSender
.
AutoMode
(
manager
,
package
,
option
);
}
/// <summary>
/// 切换至自动模式
/// </summary>
/// <param name="context">切换模式上下文</param>
...
...
@@ -40,6 +60,10 @@ namespace VIZ.H2V.Module
// 其他方式触发则切换为检测模式
this
.
Detect
();
// 清理视图控件
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
();
this
.
Support
.
ClearVideoControl
(
clear_context
);
}
/// <summary>
...
...
@@ -128,7 +152,7 @@ namespace VIZ.H2V.Module
AlgorithmPackage__auto_mode_Single
package
=
new
AlgorithmPackage__auto_mode_Single
();
package
.
cmd
=
cmd
;
package
.
smooth
=
config
.
SmoothCoeff
;
package
.
smooth
=
Math
.
Round
(
config
.
SmoothCoeff
,
3
)
;
package
.
max_fixed_frames
=
config
.
KeepPrevFrame
;
package
.
bbox
=
box
==
null
?
null
:
new
List
<
int
>
{
(
int
)
box
.
SrcRect
.
Left
,
(
int
)
box
.
SrcRect
.
Top
,
(
int
)
box
.
SrcRect
.
Right
,
(
int
)
box
.
SrcRect
.
Bottom
};
package
.
border_scene
=
config
.
BorderScene
;
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Sixteen.cs
View file @
00c929b2
...
...
@@ -24,6 +24,26 @@ namespace VIZ.H2V.Module
{
}
/// <summary>
/// 初始化算法
/// </summary>
/// <remarks>
/// 初始化消息和自动模式消息一致,信号为no_mode
/// </remarks>
public
override
void
InitAlgorithm
()
{
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
AlgorithmSenderOption
option
=
new
AlgorithmSenderOption
();
option
.
id
=
this
.
Support
.
ID
;
option
.
enable_sendto_crop
=
this
.
Support
.
ViewConfig
.
IsSendToCrop
;
AlgorithmPackage__auto_mode_Sixteen
package
=
this
.
BuildPackage
(
null
,
null
);
package
.
signal
=
AlgorithmPackageSignal
.
no_mode
;
AlgorithmSender
.
AutoMode
(
manager
,
package
,
option
);
}
/// <summary>
/// 切换至自动模式
/// </summary>
/// <param name="context">切换模式上下文</param>
...
...
@@ -121,7 +141,7 @@ namespace VIZ.H2V.Module
AlgorithmPackage__auto_mode_Sixteen
package
=
new
AlgorithmPackage__auto_mode_Sixteen
();
package
.
cmd
=
cmd
;
package
.
smooth
=
config
.
SmoothCoeff
;
package
.
smooth
=
Math
.
Round
(
config
.
SmoothCoeff
,
3
)
;
package
.
max_fixed_frames
=
config
.
KeepPrevFrame
;
package
.
min_human_area
=
config
.
PersonAreaProportion
/
100d
;
package
.
weight_area
=
config
.
PersonAreaProportionWeight
/
100d
;
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Tactics.cs
View file @
00c929b2
...
...
@@ -24,6 +24,26 @@ namespace VIZ.H2V.Module
{
}
/// <summary>
/// 初始化算法
/// </summary>
/// <remarks>
/// 初始化消息和自动模式消息一致,信号为no_mode
/// </remarks>
public
override
void
InitAlgorithm
()
{
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
AlgorithmSenderOption
option
=
new
AlgorithmSenderOption
();
option
.
id
=
this
.
Support
.
ID
;
option
.
enable_sendto_crop
=
this
.
Support
.
ViewConfig
.
IsSendToCrop
;
AlgorithmPackage__auto_mode_Tactics
package
=
this
.
BuildPackage
(
null
,
null
);
package
.
signal
=
AlgorithmPackageSignal
.
no_mode
;
AlgorithmSender
.
AutoMode
(
manager
,
package
,
option
);
}
/// <summary>
/// 切换至自动模式
/// </summary>
/// <param name="context">切换模式上下文</param>
...
...
@@ -121,7 +141,7 @@ namespace VIZ.H2V.Module
AlgorithmPackage__auto_mode_Tactics
package
=
new
AlgorithmPackage__auto_mode_Tactics
();
package
.
cmd
=
cmd
;
package
.
smooth
=
config
.
SmoothCoeff
;
package
.
smooth
=
Math
.
Round
(
config
.
SmoothCoeff
,
3
)
;
package
.
max_fixed_frames
=
config
.
KeepPrevFrame
;
package
.
min_human_area
=
config
.
PersonAreaProportion
/
100d
;
package
.
weight_area
=
config
.
PersonAreaProportionWeight
/
100d
;
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Message.cs
View file @
00c929b2
...
...
@@ -45,6 +45,9 @@ namespace VIZ.H2V.Module
if
(!
this
.
AlgorithmControllerDic
.
TryGetValue
(
this
.
StrategyType
,
out
IAlgorithmController
controller
))
return
;
// 初始化算法
controller
.
InitAlgorithm
();
if
(!
this
.
IsUseClip
)
{
this
.
ViewStatus
=
NDIViewStatus
.
CropRoi
;
...
...
@@ -135,7 +138,7 @@ namespace VIZ.H2V.Module
return
;
// 如果当前视图状态不处于裁切状态,那么不处理裁切消息
if
(!
this
.
ViewConfig
.
IsUseClip
||
this
.
View
Config
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
||
this
.
View
Status
!=
NDIViewStatus
.
CropRoi
)
if
(!
this
.
ViewConfig
.
IsUseClip
||
this
.
ViewStatus
!=
NDIViewStatus
.
CropRoi
)
return
;
NDIView
view
=
this
.
GetView
<
NDIView
>();
...
...
@@ -167,7 +170,8 @@ namespace VIZ.H2V.Module
/// <param name="view">视图</param>
private
void
OnAlgorithmMessage__crop_roi__roi
(
AlgorithmMessage__crop_roi
msg
,
VideoRenderInfo
renderInfo
,
NDIView
view
)
{
if
(
msg
.
roi
==
null
)
// 裁切框在手动模式下由客户端控制,不需要处理算法给的裁切框
if
(
msg
.
roi
==
null
||
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
)
{
view
.
video
.
ClearClipBox
();
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
View file @
00c929b2
...
...
@@ -54,6 +54,11 @@ namespace VIZ.H2V.Module
private
readonly
int
TRACKING_BOX_BORDER_WIDTH
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
VideoConfig
,
int
>(
p
=>
p
.
VIDEO_TRACKING_BOX_BORDER_WIDTH
);
/// <summary>
/// 视频边线检测多边形区域透明度
/// </summary>
private
readonly
double
VIDEO_SIDE_CHECK_POLYGON_OPACITY
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
VideoConfig
,
double
>(
p
=>
p
.
VIDEO_SIDE_CHECK_POLYGON_OPACITY
);
/// <summary>
/// 是否显示目标框
/// </summary>
private
readonly
bool
ALGORITHM_IS_SHOW_TARGET_BOX
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
AlgorithmConfig
,
bool
>(
p
=>
p
.
ALGORITHM_IS_SHOW_TARGET_BOX
);
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
View file @
00c929b2
...
...
@@ -263,7 +263,7 @@ namespace VIZ.H2V.Module
this
.
ClipBoxStrokeColor_Manual
=
SharpDxColorHelper
.
FromString
(
config
.
ClipManualColor
);
RawColor4
borderSceneColor
=
SharpDxColorHelper
.
FromString
(
config
.
BorderSceneColor
);
borderSceneColor
.
A
=
0.4f
;
borderSceneColor
.
A
=
(
float
)
this
.
VIDEO_SIDE_CHECK_POLYGON_OPACITY
;
this
.
BorderSceneColor
=
borderSceneColor
;
}
...
...
VIZ.H2V/config/config.ini
View file @
00c929b2
...
...
@@ -34,6 +34,8 @@ VIDEO_CLIP_BOX_BORDER_WIDTH=4
VIDEO_CLIP_BOX_BORDER_COLOR
=
#FFFF0000
;视频剪切掩码颜色
VIDEO_CLIP_BOX_MASK_COLOR=#88000000
;视频边线检测多边形区域透明度
VIDEO_SIDE_CHECK_POLYGON_OPACITY
=
0.2
; ============================================================
; === Navigation3D ===
; ============================================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment