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
c995120d
Commit
c995120d
authored
Sep 24, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 居中模式逻辑调整
parent
91b2a119
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
10 deletions
+60
-10
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
+2
-2
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Single.cs
+29
-1
VIZ.H2V.Module/NDIView/Controller/Manual/ManualController.cs
+4
-3
VIZ.H2V.Module/NDIView/View/NDIView.xaml
+1
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
+2
-2
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Message.cs
+9
-0
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
+13
-1
No files found.
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
View file @
c995120d
...
...
@@ -132,7 +132,7 @@ namespace VIZ.H2V.Module
/// <summary>
/// 切换居中模式
/// </summary>
public
void
ChangeCenterMode
()
public
v
irtual
v
oid
ChangeCenterMode
()
{
UdpEndpointManager
manager
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
this
.
Support
.
ViewKey
);
if
(
manager
==
null
)
...
...
@@ -148,7 +148,7 @@ namespace VIZ.H2V.Module
/// <summary>
/// 切换手动模式
/// </summary>
public
void
ChangeManualMode
()
public
v
irtual
v
oid
ChangeManualMode
()
{
// 重置3D鼠标
this
.
Support
.
Reset3DMouse
();
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Single.cs
View file @
c995120d
...
...
@@ -60,9 +60,37 @@ namespace VIZ.H2V.Module
// 其他方式触发则切换为检测模式
this
.
Detect
();
// 更新裁切框样式
this
.
Support
.
UpdateClipBoxToAutoOrCenterStyle
();
// 清理视图控件
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
false
,
true
);
//ClearVideoControlContext clear_context = new ClearVideoControlContext(false, true);
//this.Support.ClearVideoControl(clear_context);
}
/// <summary>
/// 切换居中模式
/// </summary>
public
override
void
ChangeCenterMode
()
{
base
.
ChangeCenterMode
();
// 单人机位在切换居中模式后需要清理跟踪框
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
false
,
false
);
clear_context
.
IsClearTrackingBox
=
true
;
this
.
Support
.
ClearVideoControl
(
clear_context
);
}
/// <summary>
/// 切换手动模式
/// </summary>
public
override
void
ChangeManualMode
()
{
base
.
ChangeManualMode
();
// 单人机位在切换居中模式后需要清理跟踪框
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
false
,
false
);
clear_context
.
IsClearTrackingBox
=
true
;
this
.
Support
.
ClearVideoControl
(
clear_context
);
}
...
...
VIZ.H2V.Module/NDIView/Controller/Manual/ManualController.cs
View file @
c995120d
...
...
@@ -97,7 +97,7 @@ namespace VIZ.H2V.Module
{
if
(
this
.
IsClipBoxAutoMoving
)
{
if
(
this
.
ClipBoxAutoMovingFrame
==
VIDEO_CLIP_BOX_AUTO_MOVE_DURATION_FRAME
)
if
(
this
.
ClipBoxAutoMovingFrame
==
VIDEO_CLIP_BOX_AUTO_MOVE_DURATION_FRAME
||
(
int
)
this
.
Support
.
ClipBoxX
==
(
int
)
this
.
ClipBoxCenterX
)
{
this
.
IsClipBoxAutoMoving
=
false
;
this
.
ClipBoxAutoMovingFrame
=
0
;
...
...
@@ -191,6 +191,7 @@ namespace VIZ.H2V.Module
{
this
.
IsClipBoxAutoMoving
=
false
;
this
.
ClipBoxAutoMovingFrame
=
0
;
this
.
Support
.
IsCenterModeMoveToCenterEnabled
=
true
;
}
/// <summary>
...
...
@@ -203,12 +204,12 @@ namespace VIZ.H2V.Module
{
double
x
=
this
.
ClipBoxTargetX
;
if
(
x
<
this
.
ClipBoxCenterX
)
if
(
(
int
)
x
<
(
int
)
this
.
ClipBoxCenterX
)
{
x
+=
VIDEO_CLIP_BOX_AUTO_MOVE_SPEED
;
x
=
x
>
this
.
ClipBoxCenterX
?
this
.
ClipBoxCenterX
:
x
;
}
else
if
(
x
>
this
.
ClipBoxCenterX
)
else
if
(
(
int
)
x
>
(
int
)
this
.
ClipBoxCenterX
)
{
x
-=
VIDEO_CLIP_BOX_AUTO_MOVE_SPEED
;
x
=
x
<
this
.
ClipBoxCenterX
?
this
.
ClipBoxCenterX
:
x
;
...
...
VIZ.H2V.Module/NDIView/View/NDIView.xaml
View file @
c995120d
...
...
@@ -130,7 +130,7 @@
Style="{StaticResource CheckBox_NdiView}"></CheckBox>
<Rectangle Grid.Row="1" Grid.RowSpan="10" Fill="#ff181d2b"></Rectangle>
<Border Grid.Row="1" IsEnabled="{Binding IsUseClip,Mode=OneWay}">
<Grid>
<Grid
IsEnabled="{Binding Path=IsCenterModeMoveToCenterEnabled}"
>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
View file @
c995120d
...
...
@@ -282,8 +282,8 @@ namespace VIZ.H2V.Module
return
;
// 清理视频控件
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
false
,
true
);
this
.
ClearVideoControl
(
clear_context
);
//
ClearVideoControlContext clear_context = new ClearVideoControlContext(false, true);
//
this.ClearVideoControl(clear_context);
// 切换自动模式
ChangeStrategyContext
context
=
new
ChangeStrategyContext
();
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Message.cs
View file @
c995120d
...
...
@@ -230,6 +230,7 @@ namespace VIZ.H2V.Module
/// <param name="view">视图</param>
private
void
OnAlgorithmMessage__crop_roi__target_bbox
(
AlgorithmMessage__crop_roi
msg
,
VideoRenderInfo
renderInfo
,
NDIView
view
)
{
// 没有目标框 || 配置是否显示目标框
if
(
msg
.
target_bbox
==
null
||
!
this
.
ALGORITHM_IS_SHOW_TARGET_BOX
)
{
view
.
video
.
ClearTrackingBox
();
...
...
@@ -237,6 +238,14 @@ namespace VIZ.H2V.Module
return
;
}
// 当前算法模式为单人机位模式 & ( 处于居中模式 | 处于手动模式 ) 时不显示
if
(
this
.
StrategyType
==
AlgorithmStrategyType
.
Single
&&
(
this
.
StrategyMode
==
AlgorithmStrategyMode
.
center_mode
||
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
))
{
view
.
video
.
ClearTrackingBox
();
return
;
}
RawRectangleF
rect
=
RawRectangleFExpand
.
ClipInVideoFrame
(
msg
.
target_bbox
.
Value
,
0
,
0
,
renderInfo
.
Frame
.
Width
,
renderInfo
.
Frame
.
Height
);
if
(!
RawRectangleFExpand
.
IsEffective
(
rect
))
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
View file @
c995120d
...
...
@@ -383,6 +383,9 @@ namespace VIZ.H2V.Module
isUseClip
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsUseClip
));
// 当前窗口获取焦点
this
.
IsActive
=
true
;
ChangeStrategyContext
context
=
new
ChangeStrategyContext
();
context
.
IsUseClip
=
value
;
context
.
Mode
=
this
.
StrategyMode
;
...
...
@@ -411,6 +414,9 @@ namespace VIZ.H2V.Module
if
(!
value
)
return
;
// 当前窗口获取焦点
this
.
IsActive
=
true
;
ChangeStrategyContext
context
=
new
ChangeStrategyContext
();
context
.
IsUseClip
=
this
.
IsUseClip
;
context
.
Mode
=
AlgorithmStrategyMode
.
auto_mode
;
...
...
@@ -439,6 +445,9 @@ namespace VIZ.H2V.Module
if
(!
value
)
return
;
// 当前窗口获取焦点
this
.
IsActive
=
true
;
ChangeStrategyContext
context
=
new
ChangeStrategyContext
();
context
.
IsUseClip
=
this
.
IsUseClip
;
context
.
Mode
=
AlgorithmStrategyMode
.
center_mode
;
...
...
@@ -467,6 +476,9 @@ namespace VIZ.H2V.Module
if
(!
value
)
return
;
// 当前窗口获取焦点
this
.
IsActive
=
true
;
ChangeStrategyContext
context
=
new
ChangeStrategyContext
();
context
.
IsUseClip
=
this
.
IsUseClip
;
context
.
Mode
=
AlgorithmStrategyMode
.
manual_mode
;
...
...
@@ -495,7 +507,7 @@ namespace VIZ.H2V.Module
#
region
IsCenterModeMoveToCenterEnabled
--
居中模式移动至中间是否可用
private
bool
isCenterModeMoveToCenterEnabled
;
private
bool
isCenterModeMoveToCenterEnabled
=
true
;
/// <summary>
/// 居中模式移动至中间是否可用
/// </summary>
...
...
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