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
cfe6e1e6
Commit
cfe6e1e6
authored
Sep 05, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手动调整
parent
c4be4b7c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
52 deletions
+31
-52
VIZ.H2V.Module/NDIView/Controller/Manual/ManualController.cs
+2
-2
VIZ.H2V.Module/NDIView/Controller/Recording/NDIViewRecording.cs
+1
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
+0
-10
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
+22
-23
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
+1
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
+5
-8
VIZ.H2V/App.xaml.cs
+0
-7
No files found.
VIZ.H2V.Module/NDIView/Controller/Manual/ManualController.cs
View file @
cfe6e1e6
...
...
@@ -28,7 +28,6 @@ namespace VIZ.H2V.Module
public
ManualController
(
IManualSupport
support
)
{
this
.
Support
=
support
;
}
/// <summary>
...
...
@@ -95,7 +94,8 @@ namespace VIZ.H2V.Module
double
x
=
this
.
ClipBoxTargetX
+
this
.
GetMappingValue
();
x
=
MathHelper
.
Clip
(
min
,
max
,
x
);
this
.
ClipBoxTargetX
=
x
;
double
result
=
this
.
ClipBoxSmooth
.
Call
(
this
.
ClipBoxTargetX
,
1
);
double
result
=
this
.
ClipBoxSmooth
.
Call
(
this
.
ClipBoxTargetX
,
0.6d
);
return
result
;
}
...
...
VIZ.H2V.Module/NDIView/Controller/Recording/NDIViewRecording.cs
View file @
cfe6e1e6
...
...
@@ -97,7 +97,7 @@ namespace VIZ.H2V.Module
int
x
=
(
int
)
boxInfo
.
SrcRect
.
Left
;
int
y
=
0
;
int
w
=
x
+
810
;
int
w
=
810
;
int
h
=
1080
;
Mat
cut
=
dst
[
new
Rect
(
x
,
y
,
w
,
h
)];
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
View file @
cfe6e1e6
...
...
@@ -70,16 +70,6 @@ namespace VIZ.H2V.Module
{
this
.
IsActive
=
true
;
}
#if DEBUG
// ====================================================================
// 录制测试
if
(
this
.
ViewKey
==
NDIViewKeys
.
CAM_1
)
{
this
.
ReecordingController
=
new
RecordingController
(
this
);
}
// ====================================================================
#endif
}
/// <summary>
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
View file @
cfe6e1e6
...
...
@@ -49,8 +49,24 @@ namespace VIZ.H2V.Module
{
SystemConfig
config
=
ApplicationDomainEx
.
LiteDbContext
.
SystemConfig
.
FindAll
().
FirstOrDefault
();
this
.
ManualController
.
ClipBoxSmooth
.
MinCutoff
=
config
.
ManualSmoothCoeff
;
this
.
ManualController
.
ClipBoxSmooth
.
Init
(
555
,
555
,
config
.
ManualSmoothCoeff
)
;
this
.
ManualController
.
ClipBoxTargetX
=
555
;
CompositionTarget
.
Rendering
-=
CompositionTarget_Rendering
;
CompositionTarget
.
Rendering
+=
CompositionTarget_Rendering
;
}
/// <summary>
/// 渲染处理
/// </summary>
private
void
CompositionTarget_Rendering
(
object
sender
,
EventArgs
e
)
{
// 更新手动裁切框
// 仅手动模式下处理 & 需要进行裁切 & 3D鼠标准备完毕 时才处理
if
(
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
&&
this
.
IsUseClip
)
{
this
.
UpdateClipBoxWithManual
();
}
}
/// <summary>
...
...
@@ -100,25 +116,6 @@ namespace VIZ.H2V.Module
if
(
view
==
null
)
return
;
// 更新手动裁切框
// 仅手动模式下处理 & 需要进行裁切 & 3D鼠标准备完毕 时才处理
if
(
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
&&
this
.
IsUseClip
)
{
this
.
UpdateClipBoxWithManual
();
}
#if DEBUG
// ====================================================================
// 录制测试
if
(
this
.
ReecordingController
!=
null
)
{
ClipBoxInfo
temp
=
new
ClipBoxInfo
();
temp
.
SrcRect
=
new
RawRectangleF
((
float
)
this
.
ClipBoxX
,
0
,
(
float
)
this
.
ClipBoxX
+
810
,
1080
);
this
.
ReecordingController
.
Append
(
e
.
Frame
,
temp
);
}
// ====================================================================
#endif
// 更新画面
view
.
video
.
UpdateVideoFrame
(
e
.
Frame
);
...
...
@@ -129,8 +126,10 @@ namespace VIZ.H2V.Module
if
(
manager
==
null
)
return
;
// TODO: 平滑系数读取
AlgorithmSender
.
ManualMode
(
manager
,
this
.
ID
,
this
.
ViewConfig
.
IsSendToCrop
,
this
.
GetManulRoi
(),
this
.
AlgorithmConfig
.
SmoothCoeff
);
List
<
int
>
roi
=
this
.
GetManulRoi
();
// 向算法发送裁切框
AlgorithmSender
.
ManualMode
(
manager
,
this
.
ID
,
this
.
ViewConfig
.
IsSendToCrop
,
roi
,
this
.
AlgorithmConfig
.
SmoothCoeff
);
// 在需要发送裁切框时
if
(
this
.
viewConfig
.
IsSendToCrop
)
...
...
@@ -138,7 +137,7 @@ namespace VIZ.H2V.Module
UdpEndpointManager
manager_clip
=
ConnectionManager
.
UdpConnection
.
GetEndpointManager
(
$"
{
this
.
ViewKey
}
__CLIP"
);
if
(
manager_clip
!=
null
)
{
ClipSender
.
CropRoi
(
manager_clip
,
0
,
this
.
GetManulRoi
(),
(
int
)
CLIP_BOX_WIDTH
,
e
.
Frame
.
Height
,
e
.
Frame
.
TimeStamp
);
ClipSender
.
CropRoi
(
manager_clip
,
0
,
roi
,
CLIP_BOX_WIDTH
,
e
.
Frame
.
Height
,
e
.
Frame
.
TimeStamp
);
}
}
}
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
View file @
cfe6e1e6
...
...
@@ -31,7 +31,7 @@ namespace VIZ.H2V.Module
/// <summary>
/// 剪切框宽度
/// </summary>
private
readonly
double
CLIP_BOX_WIDTH
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
VideoConfig
,
double
>(
p
=>
p
.
VIDEO_CLIP_BOX_WIDTH
);
private
readonly
int
CLIP_BOX_WIDTH
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
VideoConfig
,
int
>(
p
=>
p
.
VIDEO_CLIP_BOX_WIDTH
);
/// <summary>
/// 剪切框宽度
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
View file @
cfe6e1e6
...
...
@@ -223,15 +223,12 @@ namespace VIZ.H2V.Module
/// <returns>手动裁切框</returns>
public
List
<
int
>
GetManulRoi
()
{
NDIView
view
=
this
.
GetView
<
NDIView
>();
if
(
view
==
null
)
return
null
;
VideoRenderInfo
renderInfo
=
view
.
video
.
GetRenderInfo
();
if
(
renderInfo
==
null
)
return
null
;
int
left
=
(
int
)
this
.
ClipBoxX
;
int
top
=
0
;
int
right
=
left
+
this
.
CLIP_BOX_WIDTH
;
int
bottom
=
1080
;
return
new
List
<
int
>
{
(
int
)
this
.
ClipBoxX
,
0
,
(
int
)(
this
.
ClipBoxX
+
this
.
CLIP_BOX_WIDTH
),
renderInfo
.
Frame
.
Height
};
return
new
List
<
int
>
{
left
,
top
,
right
,
bottom
};
}
/// <summary>
...
...
VIZ.H2V/App.xaml.cs
View file @
cfe6e1e6
...
...
@@ -38,13 +38,6 @@ namespace VIZ.H2V
// 初始化3D鼠标
AppSetup
.
AppendLoad
(
new
AppSetup_Navigation3D
());
#if DEBUG
// ====================================================================
// 录制测试
AppSetup
.
AppendSetup
(
new
AppSetup_Recording
());
// ====================================================================
#endif
// 执行启动流程
AppSetupContext
context
=
AppSetup
.
Setup
();
...
...
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