Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Framework
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.Framework
Commits
d0e6394a
Commit
d0e6394a
authored
Jul 28, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 调整跟踪框命中逻辑
2. 3D鼠标添加是否准备完毕属性
parent
6f7d995a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
15 deletions
+29
-15
VIZ.Framework.Common/VideoControl/Control/Plugin/TrackingBox/EventArgs/TrackingBoxClickEventArgs.cs
+1
-1
VIZ.Framework.Common/VideoControl/Control/Plugin/TrackingBox/Info/TrackingBoxInfo.cs
+1
-0
VIZ.Framework.Common/VideoControl/Control/Plugin/TrackingBox/TrackingBoxExpand.cs
+11
-6
VIZ.Framework.Common/VideoControl/Control/Plugin/TrackingBox/TrackingBoxPlugin.cs
+5
-1
VIZ.Framework.Core/Expand/ThreeDMouse/Navigation3DModel.cs
+5
-0
VIZ.Framework.Module/Setup/AppSetup.cs
+4
-4
VIZ.Framework.WpfTest/VideoRender/OpenCVVideoTest.xaml.cs
+2
-3
No files found.
VIZ.Framework.Common/VideoControl/Control/Plugin/TrackingBox/EventArgs/TrackingBoxClickEventArgs.cs
View file @
d0e6394a
...
...
@@ -20,6 +20,6 @@ namespace VIZ.Framework.Common
/// <summary>
/// 命中的跟踪框信息
/// </summary>
public
List
<
TrackingBoxInfo
>
HitTrackingBoxInfos
{
get
;
set
;
}
public
TrackingBoxInfo
HitTrackingBoxInfo
{
get
;
set
;
}
}
}
VIZ.Framework.Common/VideoControl/Control/Plugin/TrackingBox/Info/TrackingBoxInfo.cs
View file @
d0e6394a
...
...
@@ -32,5 +32,6 @@ namespace VIZ.Framework.Common
/// 绘制边框宽度
/// </summary>
public
float
DrawingBorderWidth
{
get
;
set
;
}
}
}
VIZ.Framework.Common/VideoControl/Control/Plugin/TrackingBox/TrackingBoxExpand.cs
View file @
d0e6394a
...
...
@@ -50,18 +50,23 @@ namespace VIZ.Framework.Common
/// <param name="trackingBoxInfos">跟踪框信息结合</param>
/// <param name="point">视频坐标</param>
/// <returns>命中的跟踪框</returns>
public
static
List
<
TrackingBoxInfo
>
HitTest
(
List
<
TrackingBoxInfo
>
trackingBoxInfos
,
System
.
Windows
.
Point
point
)
public
static
TrackingBoxInfo
HitTest
(
List
<
TrackingBoxInfo
>
trackingBoxInfos
,
System
.
Windows
.
Point
point
)
{
List
<
TrackingBoxInfo
>
result
=
new
List
<
TrackingBoxInfo
>();
if
(
trackingBoxInfos
==
null
||
trackingBoxInfos
.
Count
==
0
)
return
result
;
return
null
;
TrackingBoxInfo
result
=
null
;
double
min
=
double
.
MaxValue
;
foreach
(
TrackingBoxInfo
item
in
trackingBoxInfos
)
{
if
(
point
.
X
>=
item
.
SrcRect
.
Left
&&
point
.
X
<=
item
.
SrcRect
.
Right
&&
point
.
Y
>=
item
.
SrcRect
.
Top
&&
point
.
Y
<=
item
.
SrcRect
.
Bottom
)
System
.
Windows
.
Point
center
=
new
System
.
Windows
.
Point
((
item
.
SrcRect
.
Right
-
item
.
SrcRect
.
Left
)
/
2d
,
(
item
.
SrcRect
.
Bottom
-
item
.
SrcRect
.
Top
)
/
2d
);
double
dist
=
Math
.
Pow
((
point
.
Y
-
center
.
Y
),
2
)
+
Math
.
Pow
((
point
.
X
-
center
.
X
),
2
);
if
(
dist
<
min
)
{
result
.
Add
(
item
);
min
=
dist
;
result
=
item
;
}
}
...
...
VIZ.Framework.Common/VideoControl/Control/Plugin/TrackingBox/TrackingBoxPlugin.cs
View file @
d0e6394a
using
SharpDX.Direct2D1
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -112,7 +113,10 @@ namespace VIZ.Framework.Common
TrackingBoxClickEventArgs
args
=
new
TrackingBoxClickEventArgs
();
args
.
MousePoint
=
uiPoint
;
args
.
HitTrackingBoxInfos
=
TrackingBoxExpand
.
HitTest
(
this
.
trackingBoxInfos
,
bmpPoint
);
args
.
HitTrackingBoxInfo
=
TrackingBoxExpand
.
HitTest
(
this
.
trackingBoxInfos
,
bmpPoint
);
if
(
args
.
HitTrackingBoxInfo
==
null
)
return
;
// 触发视频矩形框点击事件
this
.
TrackingBoxClick
.
Invoke
(
this
,
args
);
...
...
VIZ.Framework.Core/Expand/ThreeDMouse/Navigation3DModel.cs
View file @
d0e6394a
...
...
@@ -42,6 +42,11 @@ namespace VIZ.Framework.Core
public
bool
IsUseSmooth
{
get
;
set
;
}
=
true
;
/// <summary>
/// 是否准备完毕
/// </summary>
public
bool
IsReady
{
get
;
set
;
}
=
true
;
/// <summary>
/// 平滑处理器
/// </summary>
private
Navigation3DSmooth
Smooth
=
new
Navigation3DSmooth
();
...
...
VIZ.Framework.Module/Setup/AppSetup.cs
View file @
d0e6394a
...
...
@@ -100,7 +100,7 @@ namespace VIZ.Framework.Module
if
(
setup
.
Setup
(
context
))
{
stopwatch
.
Stop
();
Debug
.
WriteLine
(
$"Setup ||
{
setup
.
Detail
}
==>
{
stopwatch
.
ElapsedMilliseconds
}
"
);
Debug
.
WriteLine
(
$"Setup ||
{
setup
.
Detail
}
==>
{
stopwatch
.
ElapsedMilliseconds
}
ms
"
);
continue
;
}
...
...
@@ -164,7 +164,7 @@ namespace VIZ.Framework.Module
setup
.
Shutdown
(
context
);
stopwatch
.
Stop
();
Debug
.
WriteLine
(
$"ShutDown ||
{
setup
.
Detail
}
==>
{
stopwatch
.
ElapsedMilliseconds
}
"
);
Debug
.
WriteLine
(
$"ShutDown ||
{
setup
.
Detail
}
==>
{
stopwatch
.
ElapsedMilliseconds
}
ms
"
);
}
catch
(
Exception
ex
)
{
...
...
@@ -197,7 +197,7 @@ namespace VIZ.Framework.Module
if
(
setup
.
Setup
(
context
))
{
stopwatch
.
Stop
();
Debug
.
WriteLine
(
$"Load ||
{
setup
.
Detail
}
==>
{
stopwatch
.
ElapsedMilliseconds
}
"
);
Debug
.
WriteLine
(
$"Load ||
{
setup
.
Detail
}
==>
{
stopwatch
.
ElapsedMilliseconds
}
ms
"
);
continue
;
}
context
.
IsSuccess
=
false
;
...
...
@@ -243,7 +243,7 @@ namespace VIZ.Framework.Module
setup
.
Shutdown
(
context
);
stopwatch
.
Stop
();
Debug
.
WriteLine
(
$"UnLoad ||
{
setup
.
Detail
}
==>
{
stopwatch
.
ElapsedMilliseconds
}
"
);
Debug
.
WriteLine
(
$"UnLoad ||
{
setup
.
Detail
}
==>
{
stopwatch
.
ElapsedMilliseconds
}
ms
"
);
}
catch
(
Exception
ex
)
{
...
...
VIZ.Framework.WpfTest/VideoRender/OpenCVVideoTest.xaml.cs
View file @
d0e6394a
...
...
@@ -91,11 +91,10 @@ namespace VIZ.Framework.WpfTest
private
void
TrackingBoxPlugin_TrackingBoxClick
(
object
sender
,
TrackingBoxClickEventArgs
e
)
{
TrackingBoxInfo
info
=
e
.
HitTrackingBoxInfos
.
FirstOrDefault
();
if
(
info
==
null
)
if
(
e
.
HitTrackingBoxInfo
==
null
)
return
;
Rect
rect
=
i
nfo
.
SrcRect
.
ToRect
();
Rect
rect
=
e
.
HitTrackingBoxI
nfo
.
SrcRect
.
ToRect
();
Debug
.
WriteLine
(
$"Click: [
{
rect
.
X
}
,
{
rect
.
Y
}
,
{
rect
.
Width
}
,
{
rect
.
Height
}
]"
);
}
...
...
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