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
caa2df5f
Commit
caa2df5f
authored
Aug 20, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 添加边线检测场景
2. 算法配置缓存
parent
3b537ef3
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
473 additions
and
130 deletions
+473
-130
VIZ.H2V.Connection/UDP/Algorithm/Sender/AlgorithmSender.cs
+6
-2
VIZ.H2V.Connection/UDP/Algorithm/Signal/Send/AlgorithmPackage__auto_mode.cs
+5
-0
VIZ.H2V.Connection/UDP/Algorithm/Signal/Send/AlgorithmPackage__center_mode.cs
+5
-0
VIZ.H2V.Connection/UDP/Algorithm/Signal/Send/AlgorithmPackage__manual_mode.cs
+5
-0
VIZ.H2V.Domain/Model/Algorithm/AlgorithmBorderScenceModel.cs
+57
-0
VIZ.H2V.Domain/VIZ.H2V.Domain.csproj
+1
-0
VIZ.H2V.Module/NDIMainView/ViewModel/NDIMainViewModel.cs
+13
-7
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmCablewayPanelView.xaml
+23
-0
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmNearPanelView.xaml
+21
-0
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmSinglePanelView.xaml
+22
-0
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmSixteenPanelView.xaml
+3
-3
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmTacticsPanelView.xaml
+23
-0
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmCablewayPanelViewModel.cs
+9
-11
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmNearPanelViewModel.cs
+9
-11
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmPanelViewModelBase.cs
+30
-12
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmSinglePanelViewModel.cs
+9
-11
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmSixteenPanelViewModel.cs
+9
-11
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmTacticsPanelViewModel.cs
+9
-11
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
+5
-6
VIZ.H2V.Module/NDIView/Controller/Algorithm/IAlgorithmController.cs
+2
-2
VIZ.H2V.Module/NDIView/Controller/Algorithm/IAlgorithmSupport.cs
+5
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Cableway.cs
+3
-2
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Near.cs
+5
-4
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Single.cs
+3
-2
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Sixteen.cs
+5
-4
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Tactics.cs
+5
-4
VIZ.H2V.Module/NDIView/Service/INDIViewService.cs
+5
-0
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
+14
-11
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
+2
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
+14
-0
VIZ.H2V.Module/Setup/Provider/AppSetup_InitCsv.cs
+3
-1
VIZ.H2V.Storage/CSV/Algorithm/AlgorithmBorderScene.cs
+29
-0
VIZ.H2V.Storage/CSV/Algorithm/AlgorithmStrategy.cs
+0
-5
VIZ.H2V.Storage/CSV/CsvContext.cs
+20
-2
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmCableway.cs
+5
-0
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmNear.cs
+5
-0
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmSingle.cs
+5
-0
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmSixteen.cs
+5
-0
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmTactics.cs
+5
-0
VIZ.H2V.Storage/LiteDB/Algorithm/AlgorithmBase.cs
+2
-2
VIZ.H2V.Storage/LiteDB/Algorithm/AlgorithmBorderSceneType.cs
+45
-0
VIZ.H2V.Storage/LiteDB/System/SystemConfig.cs
+5
-0
VIZ.H2V.Storage/VIZ.H2V.Storage.csproj
+2
-0
VIZ.H2V/VIZ.H2V.csproj
+3
-0
VIZ.H2V/config/algorithm_border_scene.csv
+7
-0
VIZ.H2V/config/algorithm_strategy.csv
+5
-5
No files found.
VIZ.H2V.Connection/UDP/Algorithm/Sender/AlgorithmSender.cs
View file @
caa2df5f
...
...
@@ -33,11 +33,13 @@ namespace VIZ.H2V.Connection
/// <param name="manager">UDP终结点管理器</param>
/// <param name="id">算法ID</param>
/// <param name="enable_sendto_crop">是否向裁切程序发送坐标</param>
public
static
void
CenterMode
(
UdpEndpointManager
manager
,
string
id
,
bool
enable_sendto_crop
)
/// <param name="smooth">平滑系数</param>
public
static
void
CenterMode
(
UdpEndpointManager
manager
,
string
id
,
bool
enable_sendto_crop
,
double
smooth
)
{
AlgorithmPackage__center_mode
package
=
new
AlgorithmPackage__center_mode
();
package
.
id
=
id
;
package
.
enable_sendto_crop
=
enable_sendto_crop
?
1
:
0
;
package
.
smooth
=
smooth
;
manager
.
SendJson
(
package
);
}
...
...
@@ -49,12 +51,14 @@ namespace VIZ.H2V.Connection
/// <param name="id">算法ID</param>
/// <param name="roi">手动裁切坐标</param>
/// <param name="enable_sendto_crop">是否向裁切程序发送坐标</param>
public
static
void
ManualMode
(
UdpEndpointManager
manager
,
string
id
,
bool
enable_sendto_crop
,
List
<
int
>
roi
)
/// <param name="smooth">平滑系数</param>
public
static
void
ManualMode
(
UdpEndpointManager
manager
,
string
id
,
bool
enable_sendto_crop
,
List
<
int
>
roi
,
double
smooth
)
{
AlgorithmPackage__manual_mode
package
=
new
AlgorithmPackage__manual_mode
();
package
.
id
=
id
;
package
.
roi
=
roi
;
package
.
enable_sendto_crop
=
enable_sendto_crop
?
1
:
0
;
package
.
smooth
=
smooth
;
manager
.
SendJson
(
package
);
}
...
...
VIZ.H2V.Connection/UDP/Algorithm/Signal/Send/AlgorithmPackage__auto_mode.cs
View file @
caa2df5f
...
...
@@ -37,5 +37,10 @@ namespace VIZ.H2V.Connection
/// 是否向裁切程序发送坐标(1:需要, 0: 不需要)
/// </summary>
public
int
enable_sendto_crop
{
get
;
set
;
}
/// <summary>
/// 边线检测场景
/// </summary>
public
string
border_scene
{
get
;
set
;
}
}
}
VIZ.H2V.Connection/UDP/Algorithm/Signal/Send/AlgorithmPackage__center_mode.cs
View file @
caa2df5f
...
...
@@ -21,5 +21,10 @@ namespace VIZ.H2V.Connection
/// 是否向裁切程序发送坐标(1:需要, 0: 不需要)
/// </summary>
public
int
enable_sendto_crop
{
get
;
set
;
}
/// <summary>
/// 平滑系数
/// </summary>
public
double
smooth
{
get
;
set
;
}
}
}
VIZ.H2V.Connection/UDP/Algorithm/Signal/Send/AlgorithmPackage__manual_mode.cs
View file @
caa2df5f
...
...
@@ -26,5 +26,10 @@ namespace VIZ.H2V.Connection
/// 是否向裁切程序发送坐标(1:需要, 0: 不需要)
/// </summary>
public
int
enable_sendto_crop
{
get
;
set
;
}
/// <summary>
/// 平滑系数
/// </summary>
public
double
smooth
{
get
;
set
;
}
}
}
VIZ.H2V.Domain/Model/Algorithm/AlgorithmBorderScenceModel.cs
0 → 100644
View file @
caa2df5f
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
namespace
VIZ.H2V.Domain
{
/// <summary>
/// 算法边线场景模型
/// </summary>
public
class
AlgorithmBorderScenceModel
:
ModelBase
{
#
region
ID
--
编号
private
int
id
;
/// <summary>
/// 编号
/// </summary>
public
int
ID
{
get
{
return
id
;
}
set
{
id
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ID
));
}
}
#
endregion
#
region
Key
--
键
private
string
key
;
/// <summary>
/// 键
/// </summary>
public
string
Key
{
get
{
return
key
;
}
set
{
key
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Key
));
}
}
#
endregion
#
region
DisplayName
--
显示名称
private
string
displayName
;
/// <summary>
/// 显示名称
/// </summary>
public
string
DisplayName
{
get
{
return
displayName
;
}
set
{
displayName
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
DisplayName
));
}
}
#
endregion
}
}
VIZ.H2V.Domain/VIZ.H2V.Domain.csproj
View file @
caa2df5f
...
...
@@ -75,6 +75,7 @@
<Compile Include="Message\Algorithm\AlgorithmMessage__checked_ok.cs" />
<Compile Include="Message\NDI\AlgorithmStrategyChangedToManualMessage.cs" />
<Compile Include="Model\Algorithm\AlgorithmProcessModel.cs" />
<Compile Include="Model\Algorithm\AlgorithmBorderScenceModel.cs" />
<Compile Include="Model\Algorithm\AlgorithmStrategyModel.cs" />
<Compile Include="Model\NDI\NDIStreamInfoModel.cs" />
<Compile Include="Model\NDI\NDIStreamDelayInfoModel.cs" />
...
...
VIZ.H2V.Module/NDIMainView/ViewModel/NDIMainViewModel.cs
View file @
caa2df5f
...
...
@@ -290,15 +290,21 @@ namespace VIZ.H2V.Module
if
(
this
.
hotkeyController
==
null
)
return
;
WPFHelper
.
BeginInvoke
(()
=>
{
Window
window
=
Window
.
GetWindow
(
this
.
GetView
<
NDIMainView
>());
if
(
window
==
null
)
return
;
Window
window
=
Window
.
GetWindow
(
this
.
GetView
<
NDIMainView
>());
if
(
window
==
null
)
return
;
if
(!
window
.
IsActive
)
return
;
if
(!
window
.
IsActive
)
return
;
// 屏蔽空格键
if
(
e
.
KeyCode
==
System
.
Windows
.
Forms
.
Keys
.
Space
)
{
e
.
Handled
=
true
;
}
WPFHelper
.
BeginInvoke
(()
=>
{
// 空格键特殊处理
if
(
e
.
KeyCode
==
System
.
Windows
.
Forms
.
Keys
.
Space
)
{
...
...
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmCablewayPanelView.xaml
View file @
caa2df5f
...
...
@@ -38,6 +38,7 @@
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 无球时自动跟人 -->
...
...
@@ -142,6 +143,27 @@
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<!-- 场景 -->
<Grid Grid.Row="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="380"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="场景" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="6"></TextBlock>
<ComboBox Grid.Column="1" Style="{StaticResource ComboBox_Setting}" Height="40"
ItemsSource="{Binding Path=BorderScences,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedBorderScence,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding DisplayName}" VerticalAlignment="Center" HorizontalAlignment="Left"
Grid.Column="3" Foreground="White" FontSize="14"></TextBlock>
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Grid>
</Border>
</UserControl>
\ No newline at end of file
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmNearPanelView.xaml
View file @
caa2df5f
...
...
@@ -143,6 +143,27 @@
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<!-- 场景 -->
<Grid Grid.Row="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="380"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="场景" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="6"></TextBlock>
<ComboBox Grid.Column="1" Style="{StaticResource ComboBox_Setting}" Height="40"
ItemsSource="{Binding Path=BorderScences,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedBorderScence,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding DisplayName}" VerticalAlignment="Center" HorizontalAlignment="Left"
Grid.Column="3" Foreground="White" FontSize="14"></TextBlock>
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Grid>
</Border>
</UserControl>
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmSinglePanelView.xaml
View file @
caa2df5f
...
...
@@ -35,6 +35,7 @@
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 平滑系数 -->
...
...
@@ -103,6 +104,27 @@
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<!-- 场景 -->
<Grid Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="380"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="场景" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="6"></TextBlock>
<ComboBox Grid.Column="1" Style="{StaticResource ComboBox_Setting}" Height="40"
ItemsSource="{Binding Path=BorderScences,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedBorderScence,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding DisplayName}" VerticalAlignment="Center" HorizontalAlignment="Left"
Grid.Column="3" Foreground="White" FontSize="14"></TextBlock>
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Grid>
</Border>
</UserControl>
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmSixteenPanelView.xaml
View file @
caa2df5f
...
...
@@ -152,12 +152,12 @@
</Grid.ColumnDefinitions>
<TextBlock Text="场景" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="6"></TextBlock>
<ComboBox Grid.Column="1" Style="{StaticResource ComboBox_Setting}" Height="40"
ItemsSource="{Binding Path=Scences,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedScence,Mode=TwoWay}">
ItemsSource="{Binding Path=
Border
Scences,Mode=OneWay}"
SelectedValue="{Binding Path=Selected
Border
Scence,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding
.
}" VerticalAlignment="Center" HorizontalAlignment="Left"
<TextBlock Text="{Binding
DisplayName
}" VerticalAlignment="Center" HorizontalAlignment="Left"
Grid.Column="3" Foreground="White" FontSize="14"></TextBlock>
</Grid>
</DataTemplate>
...
...
VIZ.H2V.Module/NDISettingView/View/Algorithm/AlgorithmTacticsPanelView.xaml
View file @
caa2df5f
...
...
@@ -38,6 +38,7 @@
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 无球时自动跟人 -->
...
...
@@ -142,6 +143,27 @@
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<!-- 场景 -->
<Grid Grid.Row="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="380"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="场景" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="6"></TextBlock>
<ComboBox Grid.Column="1" Style="{StaticResource ComboBox_Setting}" Height="40"
ItemsSource="{Binding Path=BorderScences,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedBorderScence,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding DisplayName}" VerticalAlignment="Center" HorizontalAlignment="Left"
Grid.Column="3" Foreground="White" FontSize="14"></TextBlock>
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Grid>
</Border>
</UserControl>
\ No newline at end of file
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmCablewayPanelViewModel.cs
View file @
caa2df5f
...
...
@@ -141,12 +141,7 @@ namespace VIZ.H2V.Module
this
.
KeepPrevFrame
=
config
.
KeepPrevFrame
;
// 场景信息
AlgorithmStrategy
strategy
=
ApplicationDomainEx
.
CsvContext
.
AlgorithmStrategys
.
FirstOrDefault
(
p
=>
p
.
ID
==
(
int
)
this
.
StrategyType
);
if
(
strategy
==
null
)
return
;
this
.
Scences
=
strategy
.
Scenes
?.
Split
(
new
char
[]
{
','
},
StringSplitOptions
.
RemoveEmptyEntries
)?.
ToList
();
this
.
SelectedScence
=
(
this
.
Scences
?.
Contains
(
this
.
Config
.
Scene
)
==
true
)
?
this
.
Config
.
Scene
:
this
.
Scences
?.
FirstOrDefault
();
this
.
SelectedBorderScence
=
this
.
BorderScences
?.
FirstOrDefault
(
p
=>
p
.
Key
==
this
.
Config
.
BorderScene
)
??
this
.
BorderScences
?.
FirstOrDefault
();
}
/// <summary>
...
...
@@ -185,7 +180,7 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
Selected
Scence
!=
this
.
Config
.
Scene
)
if
(
this
.
Selected
BorderScence
.
Key
!=
this
.
Config
.
Border
Scene
)
return
true
;
return
false
;
...
...
@@ -200,9 +195,6 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
SelectedScence
!=
this
.
Config
.
Scene
)
return
true
;
return
false
;
}
...
...
@@ -227,7 +219,7 @@ namespace VIZ.H2V.Module
this
.
Config
.
NoBallAutoChangeToPerson
=
this
.
NoBallAutoChangeToPerson
;
this
.
Config
.
SmoothCoeff
=
this
.
SmoothCoeff
;
this
.
Config
.
KeepPrevFrame
=
this
.
KeepPrevFrame
;
this
.
Config
.
Scene
=
this
.
SelectedScence
;
this
.
Config
.
BorderScene
=
this
.
SelectedBorderScence
.
Key
;
this
.
ViewConfig
.
GPU
=
this
.
SelectedGpuInfo
?.
Physics
??
0
;
ApplicationDomainEx
.
LiteDbContext
.
AlgorithmCableway
.
Upsert
(
this
.
Config
);
...
...
@@ -243,6 +235,12 @@ namespace VIZ.H2V.Module
/// <returns>是否成功</returns>
public
override
bool
Apply
()
{
INDIViewService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
this
.
ViewKey
);
if
(
service
==
null
)
return
false
;
service
.
AlgorithmConfig
=
this
.
Config
;
return
true
;
}
}
...
...
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmNearPanelViewModel.cs
View file @
caa2df5f
...
...
@@ -143,12 +143,7 @@ namespace VIZ.H2V.Module
this
.
KeepPrevFrame
=
config
.
KeepPrevFrame
;
// 场景信息
AlgorithmStrategy
strategy
=
ApplicationDomainEx
.
CsvContext
.
AlgorithmStrategys
.
FirstOrDefault
(
p
=>
p
.
ID
==
(
int
)
this
.
StrategyType
);
if
(
strategy
==
null
)
return
;
this
.
Scences
=
strategy
.
Scenes
?.
Split
(
new
char
[]
{
','
},
StringSplitOptions
.
RemoveEmptyEntries
)?.
ToList
();
this
.
SelectedScence
=
(
this
.
Scences
?.
Contains
(
this
.
Config
.
Scene
)
==
true
)
?
this
.
Config
.
Scene
:
this
.
Scences
?.
FirstOrDefault
();
this
.
SelectedBorderScence
=
this
.
BorderScences
?.
FirstOrDefault
(
p
=>
p
.
Key
==
this
.
Config
.
BorderScene
)
??
this
.
BorderScences
?.
FirstOrDefault
();
}
/// <summary>
...
...
@@ -187,7 +182,7 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
Selected
Scence
!=
this
.
Config
.
Scene
)
if
(
this
.
Selected
BorderScence
.
Key
!=
this
.
Config
.
Border
Scene
)
return
true
;
return
false
;
...
...
@@ -202,9 +197,6 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
SelectedScence
!=
this
.
Config
.
Scene
)
return
true
;
return
false
;
}
...
...
@@ -229,7 +221,7 @@ namespace VIZ.H2V.Module
this
.
Config
.
NoBallAutoChangeToPerson
=
this
.
NoBallAutoChangeToPerson
;
this
.
Config
.
SmoothCoeff
=
this
.
SmoothCoeff
;
this
.
Config
.
KeepPrevFrame
=
this
.
KeepPrevFrame
;
this
.
Config
.
Scene
=
this
.
SelectedScence
;
this
.
Config
.
BorderScene
=
this
.
SelectedBorderScence
.
Key
;
ApplicationDomainEx
.
LiteDbContext
.
AlgorithmNear
.
Upsert
(
this
.
Config
);
...
...
@@ -243,6 +235,12 @@ namespace VIZ.H2V.Module
/// <returns>是否成功</returns>
public
override
bool
Apply
()
{
INDIViewService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
this
.
ViewKey
);
if
(
service
==
null
)
return
false
;
service
.
AlgorithmConfig
=
this
.
Config
;
return
true
;
}
}
...
...
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmPanelViewModelBase.cs
View file @
caa2df5f
...
...
@@ -90,30 +90,30 @@ namespace VIZ.H2V.Module
#
endregion
#
region
Scences
--
场景信息
集合
#
region
BorderScences
--
边线场景
集合
private
List
<
string
>
scence
;
private
List
<
AlgorithmBorderScenceModel
>
borderScences
;
/// <summary>
///
场景信息
集合
///
边线场景
集合
/// </summary>
public
List
<
string
>
Scences
public
List
<
AlgorithmBorderScenceModel
>
Border
Scences
{
get
{
return
scence
;
}
set
{
scence
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Scences
));
}
get
{
return
borderScences
;
}
set
{
borderScences
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Border
Scences
));
}
}
#
endregion
#
region
Selected
Scence
--
选中的
场景
#
region
Selected
BorderScence
--
选中的边线
场景
private
string
selected
Scence
;
private
AlgorithmBorderScenceModel
selectedBorder
Scence
;
/// <summary>
/// 选中的场景
/// 选中的
边线
场景
/// </summary>
public
string
Selected
Scence
public
AlgorithmBorderScenceModel
SelectedBorder
Scence
{
get
{
return
selectedScence
;
}
set
{
selected
Scence
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Selected
Scence
));
}
get
{
return
selected
Border
Scence
;
}
set
{
selected
BorderScence
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
SelectedBorder
Scence
));
}
}
#
endregion
...
...
@@ -193,6 +193,24 @@ namespace VIZ.H2V.Module
{
this
.
SelectedGpuInfo
=
info
.
GpuInfos
[
this
.
ViewConfig
.
GPU
];
}
// 边线场景
if
(
ApplicationDomainEx
.
CsvContext
.
AlgorithmBorderScenes
==
null
||
ApplicationDomainEx
.
CsvContext
.
AlgorithmBorderScenes
.
Count
==
0
)
return
;
List
<
AlgorithmBorderScenceModel
>
borderScences
=
new
List
<
AlgorithmBorderScenceModel
>();
foreach
(
AlgorithmBorderScene
scene
in
ApplicationDomainEx
.
CsvContext
.
AlgorithmBorderScenes
)
{
AlgorithmBorderScenceModel
model
=
new
AlgorithmBorderScenceModel
();
model
.
ID
=
scene
.
ID
;
model
.
Key
=
scene
.
Key
;
model
.
DisplayName
=
scene
.
DisplayName
;
borderScences
.
Add
(
model
);
}
this
.
BorderScences
=
borderScences
;
}
#
endregion
...
...
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmSinglePanelViewModel.cs
View file @
caa2df5f
...
...
@@ -42,12 +42,7 @@ namespace VIZ.H2V.Module
this
.
KeepPrevFrame
=
config
.
KeepPrevFrame
;
// 场景信息
AlgorithmStrategy
strategy
=
ApplicationDomainEx
.
CsvContext
.
AlgorithmStrategys
.
FirstOrDefault
(
p
=>
p
.
ID
==
(
int
)
this
.
StrategyType
);
if
(
strategy
==
null
)
return
;
this
.
Scences
=
strategy
.
Scenes
?.
Split
(
new
char
[]
{
','
},
StringSplitOptions
.
RemoveEmptyEntries
)?.
ToList
();
this
.
SelectedScence
=
(
this
.
Scences
?.
Contains
(
this
.
Config
.
Scene
)
==
true
)
?
this
.
Config
.
Scene
:
this
.
Scences
?.
FirstOrDefault
();
this
.
SelectedBorderScence
=
this
.
BorderScences
?.
FirstOrDefault
(
p
=>
p
.
Key
==
this
.
Config
.
BorderScene
)
??
this
.
BorderScences
?.
FirstOrDefault
();
}
/// <summary>
...
...
@@ -68,7 +63,7 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
Selected
Scence
!=
this
.
Config
.
Scene
)
if
(
this
.
Selected
BorderScence
.
Key
!=
this
.
Config
.
Border
Scene
)
return
true
;
return
false
;
...
...
@@ -83,9 +78,6 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
SelectedScence
!=
this
.
Config
.
Scene
)
return
true
;
return
false
;
}
...
...
@@ -97,7 +89,7 @@ namespace VIZ.H2V.Module
// 保存值
this
.
Config
.
SmoothCoeff
=
this
.
SmoothCoeff
;
this
.
Config
.
KeepPrevFrame
=
this
.
KeepPrevFrame
;
this
.
Config
.
Scene
=
this
.
SelectedScence
;
this
.
Config
.
BorderScene
=
this
.
SelectedBorderScence
.
Key
;
this
.
ViewConfig
.
GPU
=
this
.
SelectedGpuInfo
?.
Physics
??
0
;
ApplicationDomainEx
.
LiteDbContext
.
AlgorithmSingle
.
Upsert
(
this
.
Config
);
...
...
@@ -112,6 +104,12 @@ namespace VIZ.H2V.Module
/// <returns>是否成功</returns>
public
override
bool
Apply
()
{
INDIViewService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
this
.
ViewKey
);
if
(
service
==
null
)
return
false
;
service
.
AlgorithmConfig
=
this
.
Config
;
return
true
;
}
}
...
...
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmSixteenPanelViewModel.cs
View file @
caa2df5f
...
...
@@ -141,12 +141,7 @@ namespace VIZ.H2V.Module
this
.
KeepPrevFrame
=
config
.
KeepPrevFrame
;
// 场景信息
AlgorithmStrategy
strategy
=
ApplicationDomainEx
.
CsvContext
.
AlgorithmStrategys
.
FirstOrDefault
(
p
=>
p
.
ID
==
(
int
)
this
.
StrategyType
);
if
(
strategy
==
null
)
return
;
this
.
Scences
=
strategy
.
Scenes
?.
Split
(
new
char
[]
{
','
},
StringSplitOptions
.
RemoveEmptyEntries
)?.
ToList
();
this
.
SelectedScence
=
(
this
.
Scences
?.
Contains
(
this
.
Config
.
Scene
)
==
true
)
?
this
.
Config
.
Scene
:
this
.
Scences
?.
FirstOrDefault
();
this
.
SelectedBorderScence
=
this
.
BorderScences
?.
FirstOrDefault
(
p
=>
p
.
Key
==
this
.
Config
.
BorderScene
)
??
this
.
BorderScences
?.
FirstOrDefault
();
}
/// <summary>
...
...
@@ -185,7 +180,7 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
Selected
Scence
!=
this
.
Config
.
Scene
)
if
(
this
.
Selected
BorderScence
.
Key
!=
this
.
Config
.
Border
Scene
)
return
true
;
return
false
;
...
...
@@ -200,9 +195,6 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
SelectedScence
!=
this
.
Config
.
Scene
)
return
true
;
return
false
;
}
...
...
@@ -227,7 +219,7 @@ namespace VIZ.H2V.Module
this
.
Config
.
NoBallAutoChangeToPerson
=
this
.
NoBallAutoChangeToPerson
;
this
.
Config
.
SmoothCoeff
=
this
.
SmoothCoeff
;
this
.
Config
.
KeepPrevFrame
=
this
.
KeepPrevFrame
;
this
.
Config
.
Scene
=
this
.
SelectedScence
;
this
.
Config
.
BorderScene
=
this
.
SelectedBorderScence
.
Key
;
this
.
ViewConfig
.
GPU
=
this
.
SelectedGpuInfo
?.
Physics
??
0
;
ApplicationDomainEx
.
LiteDbContext
.
AlgorithmSixteen
.
Upsert
(
this
.
Config
);
...
...
@@ -243,6 +235,12 @@ namespace VIZ.H2V.Module
/// <returns>是否成功</returns>
public
override
bool
Apply
()
{
INDIViewService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
this
.
ViewKey
);
if
(
service
==
null
)
return
false
;
service
.
AlgorithmConfig
=
this
.
Config
;
return
true
;
}
}
...
...
VIZ.H2V.Module/NDISettingView/ViewModel/Algorithm/AlgorithmTacticsPanelViewModel.cs
View file @
caa2df5f
...
...
@@ -141,12 +141,7 @@ namespace VIZ.H2V.Module
this
.
KeepPrevFrame
=
config
.
KeepPrevFrame
;
// 场景信息
AlgorithmStrategy
strategy
=
ApplicationDomainEx
.
CsvContext
.
AlgorithmStrategys
.
FirstOrDefault
(
p
=>
p
.
ID
==
(
int
)
this
.
StrategyType
);
if
(
strategy
==
null
)
return
;
this
.
Scences
=
strategy
.
Scenes
?.
Split
(
new
char
[]
{
','
},
StringSplitOptions
.
RemoveEmptyEntries
)?.
ToList
();
this
.
SelectedScence
=
(
this
.
Scences
?.
Contains
(
this
.
Config
.
Scene
)
==
true
)
?
this
.
Config
.
Scene
:
this
.
Scences
?.
FirstOrDefault
();
this
.
SelectedBorderScence
=
this
.
BorderScences
?.
FirstOrDefault
(
p
=>
p
.
Key
==
this
.
Config
.
BorderScene
)
??
this
.
BorderScences
?.
FirstOrDefault
();
}
/// <summary>
...
...
@@ -185,7 +180,7 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
Selected
Scence
!=
this
.
Config
.
Scene
)
if
(
this
.
Selected
BorderScence
.
Key
!=
this
.
Config
.
Border
Scene
)
return
true
;
return
false
;
...
...
@@ -200,9 +195,6 @@ namespace VIZ.H2V.Module
if
(
this
.
SelectedGpuInfo
.
Physics
!=
this
.
ViewConfig
.
GPU
)
return
true
;
if
(
this
.
SelectedScence
!=
this
.
Config
.
Scene
)
return
true
;
return
false
;
}
...
...
@@ -227,7 +219,7 @@ namespace VIZ.H2V.Module
this
.
Config
.
NoBallAutoChangeToPerson
=
this
.
NoBallAutoChangeToPerson
;
this
.
Config
.
SmoothCoeff
=
this
.
SmoothCoeff
;
this
.
Config
.
KeepPrevFrame
=
this
.
KeepPrevFrame
;
this
.
Config
.
Scene
=
this
.
SelectedScence
;
this
.
Config
.
BorderScene
=
this
.
SelectedBorderScence
.
Key
;
this
.
ViewConfig
.
GPU
=
this
.
SelectedGpuInfo
?.
Physics
??
0
;
ApplicationDomainEx
.
LiteDbContext
.
AlgorithmTactics
.
Upsert
(
this
.
Config
);
...
...
@@ -243,6 +235,12 @@ namespace VIZ.H2V.Module
/// <returns>是否成功</returns>
public
override
bool
Apply
()
{
INDIViewService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
this
.
ViewKey
);
if
(
service
==
null
)
return
false
;
service
.
AlgorithmConfig
=
this
.
Config
;
return
true
;
}
}
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
View file @
caa2df5f
...
...
@@ -134,7 +134,8 @@ namespace VIZ.H2V.Module
if
(
manager
==
null
)
return
;
AlgorithmSender
.
CenterMode
(
manager
,
this
.
Support
.
ID
,
this
.
Support
.
ViewConfig
.
IsSendToCrop
);
// TODO: 平滑系数读取
AlgorithmSender
.
CenterMode
(
manager
,
this
.
Support
.
ID
,
this
.
Support
.
ViewConfig
.
IsSendToCrop
,
this
.
Support
.
AlgorithmConfig
.
SmoothCoeff
);
}
/// <summary>
...
...
@@ -151,7 +152,8 @@ namespace VIZ.H2V.Module
List
<
int
>
roi
=
this
.
Support
.
GetManulRoi
();
AlgorithmSender
.
ManualMode
(
manager
,
this
.
Support
.
ID
,
this
.
Support
.
ViewConfig
.
IsSendToCrop
,
roi
);
// TODO: 平滑系数读取
AlgorithmSender
.
ManualMode
(
manager
,
this
.
Support
.
ID
,
this
.
Support
.
ViewConfig
.
IsSendToCrop
,
roi
,
this
.
Support
.
AlgorithmConfig
.
SmoothCoeff
);
}
/// <summary>
...
...
@@ -353,9 +355,6 @@ namespace VIZ.H2V.Module
return
false
;
}
// 获取配置
AlgorithmBase
config
=
this
.
GetConfig
();
// 端口
int
port
=
this
.
Support
.
ProcessModel
.
Port
;
// NDI流名称
...
...
@@ -379,7 +378,7 @@ namespace VIZ.H2V.Module
Process
proc
=
new
Process
();
proc
.
StartInfo
.
UseShellExecute
=
true
;
proc
.
StartInfo
.
FileName
=
ALGORITHM_PYTHON_PATH
;
proc
.
StartInfo
.
Arguments
=
$"\"
{
fullPath
}
\" --port=\"
{
port
}
\" --ndi_name=\"
{
ndi_name
}
\" --id=\"
{
id
}
\" --device=\"
{
device
}
\" --vis_port=\"
{
CLIENT_PORT
}
\"
--scenes=\"
{
config
.
Scene
??
string
.
Empty
}
\"
"
;
proc
.
StartInfo
.
Arguments
=
$"\"
{
fullPath
}
\" --port=\"
{
port
}
\" --ndi_name=\"
{
ndi_name
}
\" --id=\"
{
id
}
\" --device=\"
{
device
}
\" --vis_port=\"
{
CLIENT_PORT
}
\""
;
proc
.
StartInfo
.
WindowStyle
=
ProcessWindowStyle
.
Normal
;
if
(!
proc
.
Start
())
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/IAlgorithmController.cs
View file @
caa2df5f
...
...
@@ -61,8 +61,8 @@ namespace VIZ.H2V.Module
/// <summary>
/// 边线检测
/// </summary>
/// <param name="bo
a
rderpoint">边线检测点</param>
void
BorderPoint
(
AlgorithmInfo_borderpoint
bo
a
rderpoint
);
/// <param name="borderpoint">边线检测点</param>
void
BorderPoint
(
AlgorithmInfo_borderpoint
borderpoint
);
/// <summary>
/// 切换至无模式
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/IAlgorithmSupport.cs
View file @
caa2df5f
...
...
@@ -35,6 +35,11 @@ namespace VIZ.H2V.Module
NdiViewConfig
ViewConfig
{
get
;
}
/// <summary>
/// 算法配置
/// </summary>
AlgorithmBase
AlgorithmConfig
{
get
;
}
/// <summary>
/// 显示名称
/// </summary>
string
DisplayName
{
get
;
}
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Cableway.cs
View file @
caa2df5f
...
...
@@ -82,8 +82,8 @@ namespace VIZ.H2V.Module
/// <summary>
/// 边线检测校准
/// </summary>
/// <param name="bo
a
rderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
bo
a
rderpoint
)
/// <param name="borderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
borderpoint
)
{
}
...
...
@@ -118,6 +118,7 @@ namespace VIZ.H2V.Module
package
.
weight_conf
=
config
.
ConfidenceWeight
/
100d
;
package
.
weight_distance
=
config
.
PositionToCenterWeight
/
100d
;
package
.
auto_follow_human
=
config
.
NoBallAutoChangeToPerson
?
1
:
0
;
package
.
border_scene
=
config
.
BorderScene
;
return
package
;
}
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Near.cs
View file @
caa2df5f
...
...
@@ -82,10 +82,10 @@ namespace VIZ.H2V.Module
/// <summary>
/// 边线检测校准
/// </summary>
/// <param name="bo
a
rderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
bo
a
rderpoint
)
/// <param name="borderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
borderpoint
)
{
if
(
bo
a
rderpoint
==
null
)
if
(
borderpoint
==
null
)
return
;
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
...
...
@@ -95,7 +95,7 @@ namespace VIZ.H2V.Module
option
.
enable_sendto_crop
=
this
.
Support
.
ViewConfig
.
IsSendToCrop
;
option
.
borderpoint
=
new
AlgorithmInfo_borderpoint
();
AlgorithmSender
.
AutoMode
(
manager
,
this
.
BuildPackage
(
AlgorithmAutoModeCmd
.
set_params
,
boa
rderpoint
),
option
);
AlgorithmSender
.
AutoMode
(
manager
,
this
.
BuildPackage
(
AlgorithmAutoModeCmd
.
borderline_correction
,
bo
rderpoint
),
option
);
}
/// <summary>
...
...
@@ -130,6 +130,7 @@ namespace VIZ.H2V.Module
package
.
weight_distance
=
config
.
PositionToCenterWeight
/
100d
;
package
.
auto_follow_human
=
config
.
NoBallAutoChangeToPerson
?
1
:
0
;
package
.
borderpoint
=
boarderpoint
;
package
.
border_scene
=
config
.
BorderScene
;
return
package
;
}
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Single.cs
View file @
caa2df5f
...
...
@@ -99,8 +99,8 @@ namespace VIZ.H2V.Module
/// <summary>
/// 边线检测校准
/// </summary>
/// <param name="bo
a
rderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
bo
a
rderpoint
)
/// <param name="borderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
borderpoint
)
{
}
...
...
@@ -131,6 +131,7 @@ namespace VIZ.H2V.Module
package
.
smooth
=
config
.
SmoothCoeff
;
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
;
return
package
;
}
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Sixteen.cs
View file @
caa2df5f
...
...
@@ -82,10 +82,10 @@ namespace VIZ.H2V.Module
/// <summary>
/// 边线检测校准
/// </summary>
/// <param name="bo
a
rderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
bo
a
rderpoint
)
/// <param name="borderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
borderpoint
)
{
if
(
bo
a
rderpoint
==
null
)
if
(
borderpoint
==
null
)
return
;
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
...
...
@@ -95,7 +95,7 @@ namespace VIZ.H2V.Module
option
.
enable_sendto_crop
=
this
.
Support
.
ViewConfig
.
IsSendToCrop
;
option
.
borderpoint
=
new
AlgorithmInfo_borderpoint
();
AlgorithmSender
.
AutoMode
(
manager
,
this
.
BuildPackage
(
AlgorithmAutoModeCmd
.
set_params
,
boa
rderpoint
),
option
);
AlgorithmSender
.
AutoMode
(
manager
,
this
.
BuildPackage
(
AlgorithmAutoModeCmd
.
borderline_correction
,
bo
rderpoint
),
option
);
}
/// <summary>
...
...
@@ -130,6 +130,7 @@ namespace VIZ.H2V.Module
package
.
weight_distance
=
config
.
PositionToCenterWeight
/
100d
;
package
.
auto_follow_human
=
config
.
NoBallAutoChangeToPerson
?
1
:
0
;
package
.
borderpoint
=
boarderpoint
;
package
.
border_scene
=
config
.
BorderScene
;
return
package
;
}
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Tactics.cs
View file @
caa2df5f
...
...
@@ -82,10 +82,10 @@ namespace VIZ.H2V.Module
/// <summary>
/// 边线检测校准
/// </summary>
/// <param name="bo
a
rderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
bo
a
rderpoint
)
/// <param name="borderpoint">边线检测校准点</param>
public
override
void
BorderPoint
(
AlgorithmInfo_borderpoint
borderpoint
)
{
if
(
bo
a
rderpoint
==
null
)
if
(
borderpoint
==
null
)
return
;
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
...
...
@@ -95,7 +95,7 @@ namespace VIZ.H2V.Module
option
.
enable_sendto_crop
=
this
.
Support
.
ViewConfig
.
IsSendToCrop
;
option
.
borderpoint
=
new
AlgorithmInfo_borderpoint
();
AlgorithmSender
.
AutoMode
(
manager
,
this
.
BuildPackage
(
AlgorithmAutoModeCmd
.
set_params
,
boa
rderpoint
),
option
);
AlgorithmSender
.
AutoMode
(
manager
,
this
.
BuildPackage
(
AlgorithmAutoModeCmd
.
borderline_correction
,
bo
rderpoint
),
option
);
}
/// <summary>
...
...
@@ -130,6 +130,7 @@ namespace VIZ.H2V.Module
package
.
weight_distance
=
config
.
PositionToCenterWeight
/
100d
;
package
.
auto_follow_human
=
config
.
NoBallAutoChangeToPerson
?
1
:
0
;
package
.
borderpoint
=
boarderpoint
;
package
.
border_scene
=
config
.
BorderScene
;
return
package
;
}
...
...
VIZ.H2V.Module/NDIView/Service/INDIViewService.cs
View file @
caa2df5f
...
...
@@ -45,6 +45,11 @@ namespace VIZ.H2V.Module
NdiViewConfig
ViewConfig
{
get
;
}
/// <summary>
/// 算法配置
/// </summary>
AlgorithmBase
AlgorithmConfig
{
get
;
set
;
}
/// <summary>
/// NDI视图状态
/// </summary>
NDIViewStatus
ViewStatus
{
get
;
set
;
}
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
View file @
caa2df5f
...
...
@@ -44,8 +44,8 @@ namespace VIZ.H2V.Module
// 视图键
this
.
ViewKey
=
view
.
NDIKey
;
// 初始化
视图
配置
this
.
Loaded_
View
Config
();
// 初始化配置
this
.
Loaded_Config
();
// 初始化属性
this
.
Loaded_Property
();
...
...
@@ -73,13 +73,16 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 初始化
视图
配置
/// 初始化配置
/// </summary>
private
void
Loaded_
View
Config
()
private
void
Loaded_Config
()
{
// 视图配置
NdiViewConfig
viewConfig
=
ApplicationDomainEx
.
LiteDbContext
.
ViewConfig
.
FindOne
(
p
=>
p
.
ViewKey
==
this
.
ViewKey
);
this
.
ViewConfig
=
viewConfig
;
// 算法配置
this
.
AlgorithmConfig
=
this
.
AlgorithmControllerDic
[
this
.
ViewConfig
.
StrategyType
].
GetConfig
();
}
/// <summary>
...
...
@@ -171,26 +174,26 @@ namespace VIZ.H2V.Module
if
(!
this
.
FootballFieldPanelModel
.
HasSelected
())
return
;
AlgorithmInfo_borderpoint
bo
a
rderpoint
=
new
AlgorithmInfo_borderpoint
();
AlgorithmInfo_borderpoint
borderpoint
=
new
AlgorithmInfo_borderpoint
();
if
(
this
.
FootballFieldPanelModel
.
IsTopSelected
)
{
bo
a
rderpoint
.
up
=
new
List
<
int
>
{
(
int
)
e
.
SrcPoint
.
X
,
(
int
)
e
.
SrcPoint
.
Y
};
borderpoint
.
up
=
new
List
<
int
>
{
(
int
)
e
.
SrcPoint
.
X
,
(
int
)
e
.
SrcPoint
.
Y
};
}
else
if
(
this
.
FootballFieldPanelModel
.
IsBottomSelected
)
{
bo
a
rderpoint
.
down
=
new
List
<
int
>
{
(
int
)
e
.
SrcPoint
.
X
,
(
int
)
e
.
SrcPoint
.
Y
};
borderpoint
.
down
=
new
List
<
int
>
{
(
int
)
e
.
SrcPoint
.
X
,
(
int
)
e
.
SrcPoint
.
Y
};
}
else
if
(
this
.
FootballFieldPanelModel
.
IsLeftSelected
)
{
bo
a
rderpoint
.
left
=
new
List
<
int
>
{
(
int
)
e
.
SrcPoint
.
X
,
(
int
)
e
.
SrcPoint
.
Y
};
borderpoint
.
left
=
new
List
<
int
>
{
(
int
)
e
.
SrcPoint
.
X
,
(
int
)
e
.
SrcPoint
.
Y
};
}
else
if
(
this
.
FootballFieldPanelModel
.
IsRightSelected
)
{
bo
a
rderpoint
.
right
=
new
List
<
int
>
{
(
int
)
e
.
SrcPoint
.
X
,
(
int
)
e
.
SrcPoint
.
Y
};
borderpoint
.
right
=
new
List
<
int
>
{
(
int
)
e
.
SrcPoint
.
X
,
(
int
)
e
.
SrcPoint
.
Y
};
}
this
.
AlgorithmControllerDic
[
this
.
StrategyType
].
BorderPoint
(
bo
a
rderpoint
);
this
.
AlgorithmControllerDic
[
this
.
StrategyType
].
BorderPoint
(
borderpoint
);
// ====================================================================================
// DEBUG
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
View file @
caa2df5f
...
...
@@ -164,7 +164,8 @@ namespace VIZ.H2V.Module
if
(
manager
==
null
)
return
;
AlgorithmSender
.
ManualMode
(
manager
,
this
.
ID
,
this
.
ViewConfig
.
IsSendToCrop
,
this
.
GetManulRoi
());
// TODO: 平滑系数读取
AlgorithmSender
.
ManualMode
(
manager
,
this
.
ID
,
this
.
ViewConfig
.
IsSendToCrop
,
this
.
GetManulRoi
(),
0.02
);
// 在需要发送裁切框时
if
(
this
.
viewConfig
.
IsSendToCrop
)
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
View file @
caa2df5f
...
...
@@ -136,6 +136,20 @@ namespace VIZ.H2V.Module
#
endregion
#
region
AlgorithmConfig
--
算法配置
private
AlgorithmBase
algorithmConfig
;
/// <summary>
/// 算法配置
/// </summary>
public
AlgorithmBase
AlgorithmConfig
{
get
{
return
algorithmConfig
;
}
set
{
algorithmConfig
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
AlgorithmConfig
));
}
}
#
endregion
#
region
DisplayName
--
显示名称
private
string
displayName
;
...
...
VIZ.H2V.Module/Setup/Provider/AppSetup_InitCsv.cs
View file @
caa2df5f
...
...
@@ -25,7 +25,7 @@ namespace VIZ.H2V.Module
/// <summary>
/// 描述
/// </summary>
public
override
string
Detail
{
get
;
}
=
"应用程序启动 -- 初始化
Excel
"
;
public
override
string
Detail
{
get
;
}
=
"应用程序启动 -- 初始化
CSV
"
;
/// <summary>
/// 执行启动
...
...
@@ -35,10 +35,12 @@ namespace VIZ.H2V.Module
public
override
bool
Setup
(
AppSetupContext
context
)
{
string
algorithm_strategy_path
=
System
.
IO
.
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"config"
,
"algorithm_strategy.csv"
);
string
algorithm_border_scence_path
=
System
.
IO
.
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"config"
,
"algorithm_border_scene.csv"
);
string
clip_system_path
=
System
.
IO
.
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"config"
,
"clip_system.csv"
);
ApplicationDomainEx
.
CsvContext
=
new
CsvContext
();
ApplicationDomainEx
.
CsvContext
.
LoadAlgorithmStrategys
(
algorithm_strategy_path
);
ApplicationDomainEx
.
CsvContext
.
LoadAlgorithmBorderScenes
(
algorithm_border_scence_path
);
ApplicationDomainEx
.
CsvContext
.
LoadClipSystems
(
clip_system_path
);
return
true
;
...
...
VIZ.H2V.Storage/CSV/Algorithm/AlgorithmBorderScene.cs
0 → 100644
View file @
caa2df5f
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.H2V.Storage
{
/// <summary>
/// 算法边线场景
/// </summary>
public
class
AlgorithmBorderScene
{
/// <summary>
/// 编号
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 键
/// </summary>
public
string
Key
{
get
;
set
;
}
/// <summary>
/// 显示名称
/// </summary>
public
string
DisplayName
{
get
;
set
;
}
}
}
VIZ.H2V.Storage/CSV/Algorithm/AlgorithmStrategy.cs
View file @
caa2df5f
...
...
@@ -31,10 +31,5 @@ namespace VIZ.H2V.Storage
/// 启动路径(绝对路径 or 相对路径)
/// </summary>
public
string
SetupPath
{
get
;
set
;
}
/// <summary>
/// 场景选项集合,使用英文逗号分隔
/// </summary>
public
string
Scenes
{
get
;
set
;
}
}
}
VIZ.H2V.Storage/CSV/CsvContext.cs
View file @
caa2df5f
...
...
@@ -20,6 +20,11 @@ namespace VIZ.H2V.Storage
public
List
<
AlgorithmStrategy
>
AlgorithmStrategys
{
get
;
private
set
;
}
/// <summary>
/// 边线场景
/// </summary>
public
List
<
AlgorithmBorderScene
>
AlgorithmBorderScenes
{
get
;
private
set
;
}
/// <summary>
/// 裁切系统
/// </summary>
public
List
<
ClipSystem
>
ClipSystems
{
get
;
private
set
;
}
...
...
@@ -30,7 +35,7 @@ namespace VIZ.H2V.Storage
/// <param name="path">文件路径</param>
public
void
LoadAlgorithmStrategys
(
string
path
)
{
using
(
StreamReader
sr
=
new
StreamReader
(
path
,
Encoding
.
UTF8
))
using
(
StreamReader
sr
=
new
StreamReader
(
path
,
Encoding
.
Default
))
using
(
CsvReader
reader
=
new
CsvReader
(
sr
,
CultureInfo
.
InvariantCulture
))
{
this
.
AlgorithmStrategys
=
reader
.
GetRecords
<
AlgorithmStrategy
>()?.
ToList
();
...
...
@@ -38,12 +43,25 @@ namespace VIZ.H2V.Storage
}
/// <summary>
/// 加载边线场景
/// </summary>
/// <param name="path">文件路径</param>
public
void
LoadAlgorithmBorderScenes
(
string
path
)
{
using
(
StreamReader
sr
=
new
StreamReader
(
path
,
Encoding
.
Default
))
using
(
CsvReader
reader
=
new
CsvReader
(
sr
,
CultureInfo
.
InvariantCulture
))
{
this
.
AlgorithmBorderScenes
=
reader
.
GetRecords
<
AlgorithmBorderScene
>()?.
ToList
();
}
}
/// <summary>
/// 加载裁切系统配置
/// </summary>
/// <param name="path">文件路径</param>
public
void
LoadClipSystems
(
string
path
)
{
using
(
StreamReader
sr
=
new
StreamReader
(
path
,
Encoding
.
UTF8
))
using
(
StreamReader
sr
=
new
StreamReader
(
path
,
Encoding
.
Default
))
using
(
CsvReader
reader
=
new
CsvReader
(
sr
,
CultureInfo
.
InvariantCulture
))
{
this
.
ClipSystems
=
reader
.
GetRecords
<
ClipSystem
>()?.
ToList
();
...
...
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmCableway.cs
View file @
caa2df5f
...
...
@@ -12,6 +12,11 @@ namespace VIZ.H2V.Storage
public
class
AlgorithmCableway
:
AlgorithmBase
{
/// <summary>
/// 边线检测场景
/// </summary>
public
override
string
BorderScene
{
get
;
set
;
}
=
AlgorithmBorderSceneType
.
_fly_cat
;
/// <summary>
/// 人物面积占比
/// </summary>
public
double
PersonAreaProportion
{
get
;
set
;
}
=
9
;
...
...
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmNear.cs
View file @
caa2df5f
...
...
@@ -12,6 +12,11 @@ namespace VIZ.H2V.Storage
public
class
AlgorithmNear
:
AlgorithmBase
{
/// <summary>
/// 边线检测场景
/// </summary>
public
override
string
BorderScene
{
get
;
set
;
}
=
AlgorithmBorderSceneType
.
_close_up
;
/// <summary>
/// 人物面积占比
/// </summary>
public
double
PersonAreaProportion
{
get
;
set
;
}
=
9
;
...
...
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmSingle.cs
View file @
caa2df5f
...
...
@@ -11,5 +11,10 @@ namespace VIZ.H2V.Storage
/// </summary>
public
class
AlgorithmSingle
:
AlgorithmBase
{
/// <summary>
/// 边线检测场景
/// </summary>
public
override
string
BorderScene
{
get
;
set
;
}
=
AlgorithmBorderSceneType
.
_single_person
;
}
}
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmSixteen.cs
View file @
caa2df5f
...
...
@@ -12,6 +12,11 @@ namespace VIZ.H2V.Storage
public
class
AlgorithmSixteen
:
AlgorithmBase
{
/// <summary>
/// 边线检测场景
/// </summary>
public
override
string
BorderScene
{
get
;
set
;
}
=
AlgorithmBorderSceneType
.
_16m_left
;
/// <summary>
/// 人物面积占比
/// </summary>
public
double
PersonAreaProportion
{
get
;
set
;
}
=
9
;
...
...
VIZ.H2V.Storage/LiteDB/Algorithm/Algorithm/AlgorithmTactics.cs
View file @
caa2df5f
...
...
@@ -12,6 +12,11 @@ namespace VIZ.H2V.Storage
public
class
AlgorithmTactics
:
AlgorithmBase
{
/// <summary>
/// 边线检测场景
/// </summary>
public
override
string
BorderScene
{
get
;
set
;
}
=
AlgorithmBorderSceneType
.
_tactical
;
/// <summary>
/// 人物面积占比
/// </summary>
public
double
PersonAreaProportion
{
get
;
set
;
}
=
9
;
...
...
VIZ.H2V.Storage/LiteDB/Algorithm/AlgorithmBase.cs
View file @
caa2df5f
...
...
@@ -35,8 +35,8 @@ namespace VIZ.H2V.Storage
public
int
KeepPrevFrame
{
get
;
set
;
}
=
75
;
/// <summary>
/// 场景
///
边线检测
场景
/// </summary>
public
string
Scene
{
get
;
set
;
}
public
virtual
string
Border
Scene
{
get
;
set
;
}
}
}
VIZ.H2V.Storage/LiteDB/Algorithm/AlgorithmBorderSceneType.cs
0 → 100644
View file @
caa2df5f
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.H2V.Storage
{
/// <summary>
/// 算法边线检测场景类型
/// </summary>
public
static
class
AlgorithmBorderSceneType
{
/// <summary>
/// 单人
/// </summary>
public
const
string
_single_person
=
"single_person"
;
/// <summary>
/// 近景
/// </summary>
public
const
string
_close_up
=
"close_up"
;
/// <summary>
/// 16米左
/// </summary>
public
const
string
_16m_left
=
"16m_left"
;
/// <summary>
/// 16米右
/// </summary>
public
const
string
_16m_right
=
"16m_right"
;
/// <summary>
/// 战术
/// </summary>
public
const
string
_tactical
=
"tactical"
;
/// <summary>
/// 索道
/// </summary>
public
const
string
_fly_cat
=
"fly_cat"
;
}
}
VIZ.H2V.Storage/LiteDB/System/SystemConfig.cs
View file @
caa2df5f
...
...
@@ -33,6 +33,11 @@ namespace VIZ.H2V.Storage
public
string
ClipManualColor
{
get
;
set
;
}
=
"#ffd9001b"
;
/// <summary>
/// 边线颜色
/// </summary>
public
string
BorderLineColor
{
get
;
set
;
}
=
"#44FF000000"
;
/// <summary>
/// 手动裁切是否使用平滑
/// </summary>
public
bool
IsManualUseSmooth
{
get
;
set
;
}
=
true
;
...
...
VIZ.H2V.Storage/VIZ.H2V.Storage.csproj
View file @
caa2df5f
...
...
@@ -111,12 +111,14 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CSV\Algorithm\AlgorithmBorderScene.cs" />
<Compile Include="CSV\Algorithm\AlgorithmStrategy.cs" />
<Compile Include="CSV\Clip\ClipSystem.cs" />
<Compile Include="CSV\CsvContext.cs" />
<Compile Include="Init\Config\AlgorithmConfig.cs" />
<Compile Include="Init\Config\UdpConfig.cs" />
<Compile Include="LiteDB\Algorithm\AlgorithmBase.cs" />
<Compile Include="LiteDB\Algorithm\AlgorithmBorderSceneType.cs" />
<Compile Include="LiteDB\Algorithm\AlgorithmStrategyMode.cs" />
<Compile Include="LiteDB\Algorithm\AlgorithmStrategyType.cs" />
<Compile Include="LiteDB\Algorithm\Algorithm\AlgorithmNear.cs" />
...
...
VIZ.H2V/VIZ.H2V.csproj
View file @
caa2df5f
...
...
@@ -146,6 +146,9 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="config\algorithm_border_scene.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config\algorithm_strategy.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
...
...
VIZ.H2V/config/algorithm_border_scene.csv
0 → 100644
View file @
caa2df5f
ID,Key,DisplayName
1,single_person,单人
2,close_up,近景
3,16m_left,16米左
4,16m_right,16米右
5,tactical,战术
6,fly_cat,索道
VIZ.H2V/config/algorithm_strategy.csv
View file @
caa2df5f
ID,Name,DisplayName,SetupPath,Scenes
1,
单人机位,单人机位,E:\
Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,single_person
2,
近景机位,近景机位,E:\
Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,close_up
3,16
米机位,16米机位,E
:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,"16m_left,16m_right"
4,
战术机位,战术机位,E:\
Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,tactical
5,
索道机位,索道机位,E:\
Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,fly_cat
1,
单人机位,单人机位
,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,single_person
2,
近景机位,近景机位
,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,close_up
3,16
米机位,16米机位
,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,"16m_left,16m_right"
4,
战术机位,战术机位
,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,tactical
5,
索道机位,索道机位
,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,fly_cat
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