Commit ce1a176d by 鲁志-悦动

算法标定流程走通,后续工作交互实现

parent 188f7d54
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs 
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Themes\Generic.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Themes\Generic.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Widgets\FootballFieldPanel\FootballFieldPanel.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Widgets\FootballFieldPanel\FootballFieldPanel.xaml;;
......
...@@ -8,7 +8,6 @@ namespace VIZ.FGOUT.Connection ...@@ -8,7 +8,6 @@ namespace VIZ.FGOUT.Connection
/// </summary> /// </summary>
public class AlgorithmPackage_Figout_new_model : AlgorithmPackageBase public class AlgorithmPackage_Figout_new_model : AlgorithmPackageBase
{ {
/// <summary> /// <summary>
/// 是自动还是手动 /// 是自动还是手动
/// </summary> /// </summary>
...@@ -25,13 +24,11 @@ namespace VIZ.FGOUT.Connection ...@@ -25,13 +24,11 @@ namespace VIZ.FGOUT.Connection
/// </summary> /// </summary>
public List<List<List<int>>> start { get; set; } public List<List<List<int>>> start { get; set; }
/// <summary> /// <summary>
/// endPalce /// endPalce
/// </summary> /// </summary>
public List<List<List<int>>> end { get; set; } public List<List<List<int>>> end { get; set; }
/// <summary> /// <summary>
/// InValidPalce /// InValidPalce
/// </summary> /// </summary>
...@@ -58,6 +55,9 @@ namespace VIZ.FGOUT.Connection ...@@ -58,6 +55,9 @@ namespace VIZ.FGOUT.Connection
/// </summary> /// </summary>
public long timecode { get; set; } public long timecode { get; set; }
/// <summary>
/// 算法标记
/// </summary>
public List<List<List<int>>> mark { get; set; }
} }
} }
namespace VIZ.FGOUT.Domain
{
public class SaveMarkModel
{
}
}
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
<Compile Include="Message\Setting\MarkModel.cs" /> <Compile Include="Message\Setting\MarkModel.cs" />
<Compile Include="Message\Setting\ReplayModel.cs" /> <Compile Include="Message\Setting\ReplayModel.cs" />
<Compile Include="Message\Setting\RestartAlgorithmModel.cs" /> <Compile Include="Message\Setting\RestartAlgorithmModel.cs" />
<Compile Include="Message\Setting\SaveMarkModel.cs" />
<Compile Include="Message\Setting\SavePlaceModel.cs" /> <Compile Include="Message\Setting\SavePlaceModel.cs" />
<Compile Include="Message\Setting\SendPlaceModel.cs" /> <Compile Include="Message\Setting\SendPlaceModel.cs" />
<Compile Include="Message\Setting\StartPlaceModel.cs" /> <Compile Include="Message\Setting\StartPlaceModel.cs" />
......
9b0900368707f846fdfe912e9d9b99792804e3ab abce2ed6bd8860697bdf35cc469c93114b39453a
...@@ -387,7 +387,7 @@ ...@@ -387,7 +387,7 @@
Width="100" Width="100"
Height="40" Height="40"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Command="{Binding}" Command="{Binding SaveMarkCommand}"
Content="保存" Content="保存"
Style="{StaticResource ButtonStyle}" /> Style="{StaticResource ButtonStyle}" />
</Grid> </Grid>
......
...@@ -60,6 +60,7 @@ namespace VIZ.FGOUT.Module ...@@ -60,6 +60,7 @@ namespace VIZ.FGOUT.Module
this.CloseCommand = new VCommand(this.Close); this.CloseCommand = new VCommand(this.Close);
this.SettingCommand = new VCommand(this.Setting); this.SettingCommand = new VCommand(this.Setting);
this.MarkCommand = new VCommand(this.Mark); this.MarkCommand = new VCommand(this.Mark);
this.SaveMarkCommand = new VCommand(this.SaveMark);
this.UnMarkCommand = new VCommand(this.UnMark); this.UnMarkCommand = new VCommand(this.UnMark);
this.InvalidRegionCommand = new VCommand(this.Invalid); this.InvalidRegionCommand = new VCommand(this.Invalid);
this.StartRegionCommand = new VCommand(this.StartRegion); this.StartRegionCommand = new VCommand(this.StartRegion);
...@@ -940,7 +941,7 @@ namespace VIZ.FGOUT.Module ...@@ -940,7 +941,7 @@ namespace VIZ.FGOUT.Module
} }
/// <summary> /// <summary>
/// 算法标定Command命令 /// 算法标定命令
/// </summary> /// </summary>
public VCommand MarkCommand { get; set; } public VCommand MarkCommand { get; set; }
public MarkModel _markModel = new MarkModel(); public MarkModel _markModel = new MarkModel();
...@@ -949,9 +950,19 @@ namespace VIZ.FGOUT.Module ...@@ -949,9 +950,19 @@ namespace VIZ.FGOUT.Module
_markModel.IsMark = true; _markModel.IsMark = true;
ApplicationDomain.MessageManager.Send(_markModel); ApplicationDomain.MessageManager.Send(_markModel);
} }
/// <summary>
/// 保存标定命定
/// </summary>
public VCommand SaveMarkCommand { get; set; }
public SaveMarkModel _saveMarkModel = new SaveMarkModel();
private void SaveMark()
{
ApplicationDomain.MessageManager.Send(_saveMarkModel);
}
/// <summary> /// <summary>
/// 无效区域Command命令 /// 无效区域命令
/// </summary> /// </summary>
public VCommand InvalidRegionCommand { get; set; } public VCommand InvalidRegionCommand { get; set; }
public InvalidPlaceModel invalidPlaceModel = new InvalidPlaceModel(); public InvalidPlaceModel invalidPlaceModel = new InvalidPlaceModel();
...@@ -969,14 +980,14 @@ namespace VIZ.FGOUT.Module ...@@ -969,14 +980,14 @@ namespace VIZ.FGOUT.Module
} }
/// <summary> /// <summary>
/// 开始位置Command命令 /// 开始位置命令
/// </summary> /// </summary>
public VCommand StartRegionCommand { get; set; } public VCommand StartRegionCommand { get; set; }
public StartPlaceModel startPlaceModel = new StartPlaceModel(); public StartPlaceModel startPlaceModel = new StartPlaceModel();
public EndPlaceModel endPlaceModel = new EndPlaceModel(); public EndPlaceModel endPlaceModel = new EndPlaceModel();
/// <summary> /// <summary>
/// 开始位置设置命令 /// 开始位置命令
/// </summary> /// </summary>
private void StartRegion() private void StartRegion()
{ {
...@@ -993,7 +1004,7 @@ namespace VIZ.FGOUT.Module ...@@ -993,7 +1004,7 @@ namespace VIZ.FGOUT.Module
} }
/// <summary> /// <summary>
/// 结束位置Command命令 /// 结束位置命令
/// </summary> /// </summary>
public VCommand EndRegionCommand { get; set; } public VCommand EndRegionCommand { get; set; }
...@@ -1011,7 +1022,7 @@ namespace VIZ.FGOUT.Module ...@@ -1011,7 +1022,7 @@ namespace VIZ.FGOUT.Module
} }
/// <summary> /// <summary>
/// 设置位置的Command命令 /// 设置位置命令
/// </summary> /// </summary>
public VCommand PlaceSettingCommand { get; set; } public VCommand PlaceSettingCommand { get; set; }
...@@ -1052,13 +1063,15 @@ namespace VIZ.FGOUT.Module ...@@ -1052,13 +1063,15 @@ namespace VIZ.FGOUT.Module
/// </summary> /// </summary>
public VCommand SendPlaceCommand { get; set; } public VCommand SendPlaceCommand { get; set; }
public SendPlaceModel sendPlaceModel = new SendPlaceModel(); public SendPlaceModel sendPlaceModel = new SendPlaceModel();
private void SendPlace() private void SendPlace()
{ {
ApplicationDomain.MessageManager.Send(sendPlaceModel); ApplicationDomain.MessageManager.Send(sendPlaceModel);
} }
/// <summary>
/// 保存位置命令
/// </summary>
public VCommand SavePalceCommand { get; set; } public VCommand SavePalceCommand { get; set; }
public SavePlaceModel savePlaceModel = new SavePlaceModel(); public SavePlaceModel savePlaceModel = new SavePlaceModel();
private void SavePlace() private void SavePlace()
{ {
......
...@@ -15,7 +15,7 @@ namespace VIZ.FGOUT.Module ...@@ -15,7 +15,7 @@ namespace VIZ.FGOUT.Module
{ {
public NDIViewModel vm = new NDIViewModel(); public NDIViewModel vm = new NDIViewModel();
Rectangle rectStart = new Rectangle(); // Rectangle rectStart = new Rectangle();
// Rectangle rectEnd = new Rectangle(); // Rectangle rectEnd = new Rectangle();
...@@ -26,15 +26,16 @@ namespace VIZ.FGOUT.Module ...@@ -26,15 +26,16 @@ namespace VIZ.FGOUT.Module
//public Rect rectStart; //public Rect rectStart;
public List<PointCollection> polygonsStart = new List<PointCollection>(); public List<PointCollection> polygonsStart = new List<PointCollection>();
public List<PointCollection> polygonsEnd = new List<PointCollection>(); public List<PointCollection> polygonsEnd = new List<PointCollection>();
public List<PointCollection> polygonsInvalid= new List<PointCollection>(); // public List<PointCollection> polygonsInvalid= new List<PointCollection>();
public Rect rectEnd; public List<PointCollection> _polygonsMark;
// public Rect rectEnd;
public Rect rectInvalid; public Rect rectInvalid;
//public Rectangle rectInvalid; // public Rectangle rectInvalid;
public List<Rect> rectsInvalid = new List<Rect>(); public List<Rect> rectsInvalid = new List<Rect>();
//public Path myPath = new Path(); // public Path myPath = new Path();
//public Path myPath1 = new Path(); // public Path myPath1 = new Path();
public NDIView() public NDIView()
{ {
...@@ -167,6 +168,8 @@ namespace VIZ.FGOUT.Module ...@@ -167,6 +168,8 @@ namespace VIZ.FGOUT.Module
isMouseDown = false; isMouseDown = false;
#region 注释部分
// //if (vm.IsDrawStartPlace) // //if (vm.IsDrawStartPlace)
// //{ // //{
// // rectStart.Stroke = Brushes.Red; // // rectStart.Stroke = Brushes.Red;
...@@ -247,6 +250,7 @@ namespace VIZ.FGOUT.Module ...@@ -247,6 +250,7 @@ namespace VIZ.FGOUT.Module
// aa.AddGeometry(new RectangleGeometry(rectInvalid)); // aa.AddGeometry(new RectangleGeometry(rectInvalid));
// } // }
#endregion
if (vm.IsDrawInvalidPlace) if (vm.IsDrawInvalidPlace)
{ {
...@@ -390,7 +394,6 @@ namespace VIZ.FGOUT.Module ...@@ -390,7 +394,6 @@ namespace VIZ.FGOUT.Module
public Polygon polygon; public Polygon polygon;
public PointCollection points; public PointCollection points;
public PointCollection dotPoints;
/// <summary> /// <summary>
/// 画多边形 /// 画多边形
/// </summary> /// </summary>
...@@ -413,6 +416,7 @@ namespace VIZ.FGOUT.Module ...@@ -413,6 +416,7 @@ namespace VIZ.FGOUT.Module
polygon.Points = points; polygon.Points = points;
} }
public PointCollection dotPoints;
/// <summary> /// <summary>
/// 画点 /// 画点
/// </summary> /// </summary>
...@@ -420,20 +424,20 @@ namespace VIZ.FGOUT.Module ...@@ -420,20 +424,20 @@ namespace VIZ.FGOUT.Module
/// <param name="brush"></param> /// <param name="brush"></param>
private void DrawDot(Point point, Brush brush) private void DrawDot(Point point, Brush brush)
{ {
aa = new PathGeometry(); if (!dotPoints.Contains(point))
//if (!rectsInvalid.Contains(rectInvalid)) {
//{ aa = new PathGeometry();
aa.AddGeometry(new LineGeometry(){ StartPoint = point, EndPoint = new Point(point.X + 1, point.Y + 1) }); dotPoints.Add(point);
//rectsInvalid.Add(rectInvalid); aa.AddGeometry(new LineGeometry() { StartPoint = point, EndPoint = new Point(point.X + 1, point.Y + 1) });
var myPath = new Path() var myPath = new Path()
{ {
Fill = Brushes.Transparent, Fill = Brushes.Transparent,
Stroke = brush, Stroke = brush,
StrokeThickness = 1.5, StrokeThickness = 4,
Data = aa Data = aa
}; };
canvas1.Children.Add(myPath); canvas1.Children.Add(myPath);
// } }
} }
//public Rectangle _rectangle; //public Rectangle _rectangle;
......
...@@ -134,6 +134,10 @@ namespace VIZ.FGOUT.Module ...@@ -134,6 +134,10 @@ namespace VIZ.FGOUT.Module
// 算法标记 // 算法标记
ApplicationDomain.MessageManager.Register<MarkModel>(this, this.Mark); ApplicationDomain.MessageManager.Register<MarkModel>(this, this.Mark);
// 保存算法标记
ApplicationDomain.MessageManager.Register<SaveMarkModel>(this, this.SaveMark);
// 开始的位置 // 开始的位置
ApplicationDomain.MessageManager.Register<StartPlaceModel>(this, this.StartPlace); ApplicationDomain.MessageManager.Register<StartPlaceModel>(this, this.StartPlace);
...@@ -145,29 +149,29 @@ namespace VIZ.FGOUT.Module ...@@ -145,29 +149,29 @@ namespace VIZ.FGOUT.Module
// 清除开始、结束、无效位置 // 清除开始、结束、无效位置
ApplicationDomain.MessageManager.Register<CleanPlaceModel>(this, this.CleanPlace); ApplicationDomain.MessageManager.Register<CleanPlaceModel>(this, this.CleanPlace);
//显示开始、结束、无效位置 // 显示开始、结束、无效位置
ApplicationDomain.MessageManager.Register<DisplayPlaceModel>(this, this.DisplayPlace); ApplicationDomain.MessageManager.Register<DisplayPlaceModel>(this, this.DisplayPlace);
// 算法发送命令 // 发送位置命令给算法
ApplicationDomain.MessageManager.Register<SendPlaceModel>(this, this.SendPlace); ApplicationDomain.MessageManager.Register<SendPlaceModel>(this, this.SendPlace);
// 保存按钮发送命令 // 保存位置发送命令
ApplicationDomain.MessageManager.Register<SavePlaceModel>(this, this.SavePlace); ApplicationDomain.MessageManager.Register<SavePlaceModel>(this, this.SavePlace);
// 调用Replay发送命令 // 调用Replay发送命令
ApplicationDomain.MessageManager.Register<ReplayModel>(this,this.Replay); ApplicationDomain.MessageManager.Register<ReplayModel>(this,this.Replay);
//调用UESetting发送命令 // 调用UESetting发送命令
ApplicationDomain.MessageManager.Register<UESettingModel>(this,this.UESetting); ApplicationDomain.MessageManager.Register<UESettingModel>(this,this.UESetting);
//调用UEControl发送命令 // 调用UEControl发送命令
ApplicationDomain.MessageManager.Register<UEControlModel>(this, this.UEControl); ApplicationDomain.MessageManager.Register<UEControlModel>(this, this.UEControl);
//重启算法发送命令 // 重启算法发送命令
ApplicationDomain.MessageManager.Register<RestartAlgorithmModel>(this, this.RestartAlgorithm); ApplicationDomain.MessageManager.Register<RestartAlgorithmModel>(this, this.RestartAlgorithm);
//关闭算法发送命令 // 关闭算法发送命令
ApplicationDomain.MessageManager.Register<StopAlgorithmModel>(this, this.CloseAlgorithm); ApplicationDomain.MessageManager.Register<StopAlgorithmModel>(this, this.CloseAlgorithm);
} }
...@@ -315,9 +319,38 @@ namespace VIZ.FGOUT.Module ...@@ -315,9 +319,38 @@ namespace VIZ.FGOUT.Module
return; return;
} }
NDIView nDIView = this.GetView<NDIView>();
nDIView.dotPoints = new PointCollection();
nDIView._polygonsMark = new List<PointCollection>();
IsMark = markModel.IsMark; IsMark = markModel.IsMark;
} }
/// <summary>
/// 保存算法标记
/// </summary>
/// <param name="saveMarkModel"></param>
private void SaveMark(SaveMarkModel saveMarkModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
return;
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (manager == null)
return;
NDIView nDIView = this.GetView<NDIView>();
var srcWidth = nDIView.video.ActualWidth;
var srcHeight = nDIView.video.ActualHeight;
nDIView._polygonsMark.Add(nDIView.dotPoints);
AlgorithmPackage_Figout_new_model package = new AlgorithmPackage_Figout_new_model();
package.mark = Coordinate(nDIView._polygonsMark, srcWidth, srcHeight);
manager.SendJson(package);
MessageBoxEx.ShowDialog("算法标记保存成功");
}
public bool IsDrawStartPlace; public bool IsDrawStartPlace;
/// <summary> /// <summary>
/// 开始位置命令 /// 开始位置命令
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9806D9914924DA355C964D7F602DE067F1D96B5D1858176E2D9922DBC86CDABB" #pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E0D0F55D79FE75A95C4A7B5F034ACA7CA3D958A7C5F5C04B9BF1ECC08A37949D"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9806D9914924DA355C964D7F602DE067F1D96B5D1858176E2D9922DBC86CDABB" #pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E0D0F55D79FE75A95C4A7B5F034ACA7CA3D958A7C5F5C04B9BF1ECC08A37949D"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
 C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment