Commit b9d8a1f5 by 鲁志-悦动

算法增加新的参数 "bbox_min_h", "bbox_min_w" And 忽略区域ignore改为多边形 And 界面接收检测的接口 "ignore_bboxes",如果里面有内容则显示灰色框

parent ffce85a8
...@@ -42,6 +42,17 @@ namespace VIZ.FGOUT.Connection ...@@ -42,6 +42,17 @@ namespace VIZ.FGOUT.Connection
message.bboxes.Add(target); message.bboxes.Add(target);
} }
} }
if (package.ignore_bboxes != null && package.ignore_bboxes.Count > 0)
{
foreach (List<int> src in package.ignore_bboxes)
{
if (src == null || src.Count != 4)
continue;
RawRectangleF target = new RawRectangleF(src[0], src[1], src[2], src[3]);
message.ignore_bboxes.Add(target);
}
}
Signal = AlgorithmPackageSignal.detect; Signal = AlgorithmPackageSignal.detect;
} }
else if (package.signal == "track") else if (package.signal == "track")
......
...@@ -38,6 +38,8 @@ namespace VIZ.FGOUT.Connection ...@@ -38,6 +38,8 @@ namespace VIZ.FGOUT.Connection
/// </summary> /// </summary>
public List<List<int>> bboxes { get; set; } public List<List<int>> bboxes { get; set; }
public List<List<int>> ignore_bboxes { get; set; }
/// <summary> /// <summary>
/// 跟踪框的定义 /// 跟踪框的定义
/// </summary> /// </summary>
......
...@@ -58,6 +58,20 @@ namespace VIZ.FGOUT.Connection ...@@ -58,6 +58,20 @@ namespace VIZ.FGOUT.Connection
/// </summary> /// </summary>
public int Landing_frame_interval { get; set; } = 7; public int Landing_frame_interval { get; set; } = 7;
/// <summary>
/// 用来过滤框的高
/// </summary>
public int Bbox_min_h { get; set; } = 0;
/// <summary>
/// 用来过滤框的宽
/// </summary>
public int Bbox_min_w { get; set; } = 0;
/// <summary>
/// 是否是大模型
/// </summary>
public bool Is_Big_Model { get; set; } = false; public bool Is_Big_Model { get; set; } = false;
} }
} }
...@@ -13,6 +13,8 @@ namespace VIZ.FGOUT.Domain ...@@ -13,6 +13,8 @@ namespace VIZ.FGOUT.Domain
/// </summary> /// </summary>
public List<RawRectangleF> bboxes { get; set; } = new List<RawRectangleF>(); public List<RawRectangleF> bboxes { get; set; } = new List<RawRectangleF>();
public List<RawRectangleF> ignore_bboxes { get; set; } = new List<RawRectangleF>();
/// <summary> /// <summary>
/// 裁切坐标 /// 裁切坐标
/// </summary> /// </summary>
......
...@@ -570,7 +570,7 @@ ...@@ -570,7 +570,7 @@
IsEnabled="{Binding SendEnable}" IsEnabled="{Binding SendEnable}"
Style="{StaticResource ButtonStyle}" /> Style="{StaticResource ButtonStyle}" />
<Button <!--<Button
Grid.Row="1" Grid.Row="1"
Grid.Column="5" Grid.Column="5"
Width="100" Width="100"
...@@ -579,11 +579,11 @@ ...@@ -579,11 +579,11 @@
Command="{Binding Path=SavePalceCommand}" Command="{Binding Path=SavePalceCommand}"
Content="保存位置" Content="保存位置"
IsEnabled="{Binding SaveEnable}" IsEnabled="{Binding SaveEnable}"
Style="{StaticResource ButtonStyle}" /> Style="{StaticResource ButtonStyle}" />-->
<Button <Button
Grid.Row="1" Grid.Row="1"
Grid.Column="6" Grid.Column="5"
Width="100" Width="100"
Height="40" Height="40"
Margin="10" Margin="10"
......
...@@ -301,6 +301,38 @@ ...@@ -301,6 +301,38 @@
</b:Interaction.Behaviors> </b:Interaction.Behaviors>
</TextBox> </TextBox>
<TextBlock
Grid.Row="4"
Grid.Column="0"
VerticalAlignment="Center"
Foreground="White"
Text="bbox_min_h" />
<TextBox
Grid.Row="4"
Grid.Column="1"
Style="{StaticResource TextBoxStyle}"
Text="{Binding Bbox_min_h, Mode=TwoWay}">
<b:Interaction.Behaviors>
<local:TextBoxEnterKeyUpdateBehavior />
</b:Interaction.Behaviors>
</TextBox>
<TextBlock
Grid.Row="4"
Grid.Column="2"
VerticalAlignment="Center"
Foreground="White"
Text="bbox_min_w" />
<TextBox
Grid.Row="4"
Grid.Column="3"
Style="{StaticResource TextBoxStyle}"
Text="{Binding Bbox_min_w, Mode=TwoWay}">
<b:Interaction.Behaviors>
<local:TextBoxEnterKeyUpdateBehavior />
</b:Interaction.Behaviors>
</TextBox>
<CheckBox <CheckBox
Grid.Row="4" Grid.Row="4"
Grid.Column="5" Grid.Column="5"
......
...@@ -561,6 +561,34 @@ namespace VIZ.FGOUT.Module ...@@ -561,6 +561,34 @@ namespace VIZ.FGOUT.Module
} }
} }
private int _bbox_min_h = 0;
/// <summary>
/// 用来过滤框的高
/// </summary>
public int Bbox_min_h
{
get => _bbox_min_h;
set
{
_bbox_min_h = value;
this.RaisePropertyChanged(nameof(Bbox_min_h));
}
}
private int _bbox_min_w = 0;
/// <summary>
/// 用来过滤框的宽
/// </summary>
public int Bbox_min_w
{
get => _bbox_min_w;
set
{
_bbox_min_w = value;
this.RaisePropertyChanged(nameof(Bbox_min_w));
}
}
private bool _isBigModel; private bool _isBigModel;
/// <summary> /// <summary>
/// 是否是大模型 /// 是否是大模型
...@@ -598,6 +626,8 @@ namespace VIZ.FGOUT.Module ...@@ -598,6 +626,8 @@ namespace VIZ.FGOUT.Module
Pad_det_y = Pad_det_y, Pad_det_y = Pad_det_y,
Pad_det_square = Pad_det_square, Pad_det_square = Pad_det_square,
Scale = AScale, Scale = AScale,
Bbox_min_h = Bbox_min_h,
Bbox_min_w = Bbox_min_w,
Is_Big_Model = IsBigModel Is_Big_Model = IsBigModel
}; };
...@@ -735,6 +765,8 @@ namespace VIZ.FGOUT.Module ...@@ -735,6 +765,8 @@ namespace VIZ.FGOUT.Module
Pad_det_y = alPackage.Pad_det_y; Pad_det_y = alPackage.Pad_det_y;
Pad_det_square = alPackage.Pad_det_square; Pad_det_square = alPackage.Pad_det_square;
AScale = alPackage.Scale; AScale = alPackage.Scale;
Bbox_min_h = alPackage.Bbox_min_h;
Bbox_min_w = alPackage.Bbox_min_w;
IsBigModel = alPackage.Is_Big_Model; IsBigModel = alPackage.Is_Big_Model;
} }
......
...@@ -26,12 +26,12 @@ namespace VIZ.FGOUT.Module ...@@ -26,12 +26,12 @@ 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 List<PointCollection> _polygonsMark; //public List<PointCollection> _polygonsMark;
// public Rect rectEnd; // 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 Rect rectReplay; public Rect rectReplay;
// public Rectangle rectInvalid; // public Rectangle rectInvalid;
...@@ -282,23 +282,23 @@ namespace VIZ.FGOUT.Module ...@@ -282,23 +282,23 @@ namespace VIZ.FGOUT.Module
#endregion #endregion
if (vm.IsDrawInvalidPlace) //if (vm.IsDrawInvalidPlace)
{ //{
aa = new PathGeometry(); // aa = new PathGeometry();
if (!rectsInvalid.Contains(rectInvalid)) // if (!rectsInvalid.Contains(rectInvalid))
{ // {
aa.AddGeometry(new RectangleGeometry(rectInvalid)); // aa.AddGeometry(new RectangleGeometry(rectInvalid));
rectsInvalid.Add(rectInvalid); // rectsInvalid.Add(rectInvalid);
var myPath = new Path() // var myPath = new Path()
{ // {
Fill = Brushes.Transparent, // Fill = Brushes.Transparent,
Stroke = Brushes.Red, // Stroke = Brushes.Red,
StrokeThickness = 1, // StrokeThickness = 1,
Data = aa // Data = aa
}; // };
canvas1.Children.Add(myPath); // canvas1.Children.Add(myPath);
} // }
} //}
if (vm.IsReplay) if (vm.IsReplay)
{ {
...@@ -392,10 +392,11 @@ namespace VIZ.FGOUT.Module ...@@ -392,10 +392,11 @@ namespace VIZ.FGOUT.Module
DrawPolygon(e.GetPosition(this.canvas1), Brushes.Blue); DrawPolygon(e.GetPosition(this.canvas1), Brushes.Blue);
else if (vm.IsDrawEndPlace) else if (vm.IsDrawEndPlace)
DrawPolygon(e.GetPosition(this.canvas1), Brushes.Green); DrawPolygon(e.GetPosition(this.canvas1), Brushes.Green);
else if (vm.IsDrawInvalidPlace)
DrawPolygon(e.GetPosition(this.canvas1), Brushes.Red);
//else if(vm.IsMark) //else if(vm.IsMark)
// DrawDot(e.GetPosition(this.canvas1), Brushes.Red); // DrawDot(e.GetPosition(this.canvas1), Brushes.Red);
//else if (vm.IsDrawInvalidPlace)
// DrawPolygon(e.GetPosition(this.canvas1), Brushes.Red);
//else if (vm.IsManualDetect) //else if (vm.IsManualDetect)
//{ //{
...@@ -435,10 +436,10 @@ namespace VIZ.FGOUT.Module ...@@ -435,10 +436,10 @@ namespace VIZ.FGOUT.Module
// rectInvalid = new Rect(startPoint, e.GetPosition(this.canvas1)); // rectInvalid = new Rect(startPoint, e.GetPosition(this.canvas1));
//} //}
if (vm.IsDrawInvalidPlace) //if (vm.IsDrawInvalidPlace)
{ //{
rectInvalid = new Rect(startPoint, e.GetPosition(this.canvas1)); // rectInvalid = new Rect(startPoint, e.GetPosition(this.canvas1));
} //}
if (vm.IsReplay) if (vm.IsReplay)
{ {
...@@ -538,11 +539,11 @@ namespace VIZ.FGOUT.Module ...@@ -538,11 +539,11 @@ namespace VIZ.FGOUT.Module
polygonsEnd.RemoveAt(0); polygonsEnd.RemoveAt(0);
} }
} }
//else if (vm.IsDrawInvalidPlace) else if (vm.IsDrawInvalidPlace)
//{ {
// if(!polygonsInvalid.Contains(points)) if (!polygonsInvalid.Contains(points))
// polygonsInvalid.Add(points); polygonsInvalid.Add(points);
//} }
polygon = null; polygon = null;
} }
} }
......
...@@ -124,16 +124,21 @@ namespace VIZ.FGOUT.Module ...@@ -124,16 +124,21 @@ namespace VIZ.FGOUT.Module
//if (renderInfo == null) //if (renderInfo == null)
// return; // return;
// 视频的宽度
int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH);
// 视频的高度
int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
// 刷新跟踪框 // 刷新跟踪框
List<TrackingBoxInfo> infos = new List<TrackingBoxInfo>(); List<TrackingBoxInfo> infos = new List<TrackingBoxInfo>();
if (msg.bboxes != null) if (msg.bboxes != null)
{ {
foreach (RawRectangleF item in msg.bboxes) foreach (RawRectangleF item in msg.bboxes)
{ {
// 视频的宽度 //// 视频的宽度
int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH); //int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH);
// 视频的高度 //// 视频的高度
int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT); //int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
//RawRectangleF rect = RawRectangleFExpand.ClipInVideoFrame(item, 0, 0, renderInfo.Frame.Width, renderInfo.Frame.Height); //RawRectangleF rect = RawRectangleFExpand.ClipInVideoFrame(item, 0, 0, renderInfo.Frame.Width, renderInfo.Frame.Height);
RawRectangleF rect = RawRectangleFExpand.ClipInVideoFrame(item, 0, 0, resWith, resHeight); RawRectangleF rect = RawRectangleFExpand.ClipInVideoFrame(item, 0, 0, resWith, resHeight);
...@@ -151,8 +156,33 @@ namespace VIZ.FGOUT.Module ...@@ -151,8 +156,33 @@ namespace VIZ.FGOUT.Module
} }
} }
//刷新忽略框
if (msg.ignore_bboxes != null)
{
foreach (RawRectangleF item in msg.ignore_bboxes)
{
//// 视频的宽度
//int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH);
//// 视频的高度
//int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
RawRectangleF rect = RawRectangleFExpand.ClipInVideoFrame(item, 0, 0, resWith, resHeight);
if (!RawRectangleFExpand.IsEffective(rect))
continue;
TrackingBoxInfo info = new TrackingBoxInfo();
info.Type = TrackingBoxStyle.Rectangle;
info.SrcRect = rect;
info.DrawingBorderWidth = this.DETECT_BOX_BORDER_WIDTH;
// 检测框在显示目标框时显示,否则采用透明色
info.DrawingBorderColor = this.IsShowAlgorithmTargetBox ? this.IGNORE_BOX_BORDER_COLOR : this.DETECT_BOX_BORDER_COLOR_TRANSPARENT;
info.TimeCode = msg.timecode;
infos.Add(info);
}
}
// 更新裁切框信息 // 更新裁切框信息
// this.OnAlgorithmMessage__crop_roi__roi(msg, renderInfo, view); // this.OnAlgorithmMessage__crop_roi__roi(msg, renderInfo, view);
// 更新视频控件跟踪框信息 // 更新视频控件跟踪框信息
view.video.UpdateTrackingBox(infos); view.video.UpdateTrackingBox(infos);
......
...@@ -60,6 +60,11 @@ namespace VIZ.FGOUT.Module ...@@ -60,6 +60,11 @@ namespace VIZ.FGOUT.Module
private readonly RawColor4 DETECT_BOX_BORDER_COLOR = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, RawColor4>(p => p.VIDEO_DETECT_BOX_BORDER_COLOR); private readonly RawColor4 DETECT_BOX_BORDER_COLOR = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, RawColor4>(p => p.VIDEO_DETECT_BOX_BORDER_COLOR);
/// <summary> /// <summary>
/// 忽略框边框颜色(格式:#AARRGGBB)
/// </summary>
private readonly RawColor4 IGNORE_BOX_BORDER_COLOR = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, RawColor4>(p => p.VIDEO_IGNORE_BOX_BORDER_COLOR);
/// <summary>
/// 检测框边框颜色 透明 /// 检测框边框颜色 透明
/// </summary> /// </summary>
private readonly RawColor4 DETECT_BOX_BORDER_COLOR_TRANSPARENT = SharpDxColorHelper.FromString("#00000000"); private readonly RawColor4 DETECT_BOX_BORDER_COLOR_TRANSPARENT = SharpDxColorHelper.FromString("#00000000");
......
...@@ -124,10 +124,10 @@ namespace VIZ.FGOUT.Module ...@@ -124,10 +124,10 @@ namespace VIZ.FGOUT.Module
// 算法初始化完成消息 // 算法初始化完成消息
ApplicationDomain.MessageManager.Register<AlgorithmMessage__checked_ok>(this, this.OnAlgorithmMessage__checked_ok); ApplicationDomain.MessageManager.Register<AlgorithmMessage__checked_ok>(this, this.OnAlgorithmMessage__checked_ok);
// 算法跟踪消息--检测 // 算法跟踪消息--检测(收到的是这个的消息)
ApplicationDomain.MessageManager.Register<AlgorithmMessage__detect>(this, this.OnAlgorithmMessage__detect); ApplicationDomain.MessageManager.Register<AlgorithmMessage__detect>(this, this.OnAlgorithmMessage__detect);
// 算法跟踪消息--裁切 // 算法跟踪消息--裁切(没有收到这个的消息)
ApplicationDomain.MessageManager.Register<AlgorithmMessage__crop_roi>(this, this.OnAlgorithmMessage__crop_roi); ApplicationDomain.MessageManager.Register<AlgorithmMessage__crop_roi>(this, this.OnAlgorithmMessage__crop_roi);
// 算法落盘开始、结束时间戳消息 // 算法落盘开始、结束时间戳消息
...@@ -140,11 +140,11 @@ namespace VIZ.FGOUT.Module ...@@ -140,11 +140,11 @@ namespace VIZ.FGOUT.Module
// 保存算法标记 // 保存算法标记
//ApplicationDomain.MessageManager.Register<SaveMarkModel>(this, this.SaveMark); //ApplicationDomain.MessageManager.Register<SaveMarkModel>(this, this.SaveMark);
// 开始的位置 // 开始位置的注册
ApplicationDomain.MessageManager.Register<StartPlaceModel>(this, this.StartPlace); ApplicationDomain.MessageManager.Register<StartPlaceModel>(this, this.StartPlace);
// 结束位置的 // 结束位置的注册
ApplicationDomain.MessageManager.Register<EndPlaceModel>(this, this.EndPlace); ApplicationDomain.MessageManager.Register<EndPlaceModel>(this, this.EndPlace);
// 无效区域的注册 // 无效区域的注册
...@@ -157,7 +157,9 @@ namespace VIZ.FGOUT.Module ...@@ -157,7 +157,9 @@ namespace VIZ.FGOUT.Module
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<SendPlaceModel>(this, this.SaveAndSendPlace);
// 保存位置发送命令 // 保存位置发送命令
ApplicationDomain.MessageManager.Register<SavePlaceModel>(this, this.SavePlace); ApplicationDomain.MessageManager.Register<SavePlaceModel>(this, this.SavePlace);
...@@ -372,45 +374,45 @@ namespace VIZ.FGOUT.Module ...@@ -372,45 +374,45 @@ namespace VIZ.FGOUT.Module
/// 算法标记命令 /// 算法标记命令
/// </summary> /// </summary>
/// <param name="markModel"></param> /// <param name="markModel"></param>
private void Mark(MarkModel markModel) //private void Mark(MarkModel markModel)
{ //{
if (this.ViewKey != NDIViewKeys.CAM_1) // if (this.ViewKey != NDIViewKeys.CAM_1)
{ // {
IsMark = false; // IsMark = false;
return; // return;
} // }
var nDIView = this.GetView<NDIView>(); // var nDIView = this.GetView<NDIView>();
nDIView.dotPoints = new PointCollection(); // nDIView.dotPoints = new PointCollection();
nDIView._polygonsMark = new List<PointCollection>(); // nDIView._polygonsMark = new List<PointCollection>();
IsMark = markModel.IsMark; // IsMark = markModel.IsMark;
} //}
/// <summary> /// <summary>
/// 发送算法标记 /// 发送算法标记
/// </summary> /// </summary>
/// <param name="saveMarkModel"></param> /// <param name="saveMarkModel"></param>
private void SaveMark(SaveMarkModel saveMarkModel) //private void SaveMark(SaveMarkModel saveMarkModel)
{ //{
if (this.ViewKey != NDIViewKeys.CAM_1) // if (this.ViewKey != NDIViewKeys.CAM_1)
return; // return;
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1); // UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (manager == null) // if (manager == null)
return; // return;
NDIView nDIView = this.GetView<NDIView>(); // NDIView nDIView = this.GetView<NDIView>();
var srcWidth = nDIView.video.ActualWidth; // var srcWidth = nDIView.video.ActualWidth;
var srcHeight = nDIView.video.ActualHeight; // var srcHeight = nDIView.video.ActualHeight;
nDIView._polygonsMark.Add(nDIView.dotPoints); // nDIView._polygonsMark.Add(nDIView.dotPoints);
AlgorithmPackage_Figout_new_model package = new AlgorithmPackage_Figout_new_model(); // AlgorithmPackage_Figout_new_model package = new AlgorithmPackage_Figout_new_model();
package.mark = Coordinate(nDIView._polygonsMark, srcWidth, srcHeight); // package.mark = Coordinate(nDIView._polygonsMark, srcWidth, srcHeight);
manager.SendJson(package); // manager.SendJson(package);
MessageBoxEx.ShowDialog("算法标记保存成功"); // MessageBoxEx.ShowDialog("算法标记保存成功");
} //}
public bool IsDrawStartPlace; public bool IsDrawStartPlace;
/// <summary> /// <summary>
...@@ -506,9 +508,11 @@ namespace VIZ.FGOUT.Module ...@@ -506,9 +508,11 @@ namespace VIZ.FGOUT.Module
if (setPlaceNewConfig.InvlidPlace.Count > 0) if (setPlaceNewConfig.InvlidPlace.Count > 0)
{ {
ndiView.rectsInvalid = setPlaceNewConfig.InvlidPlace; //ndiView.rectsInvalid = setPlaceNewConfig.InvlidPlace;
ndiView.polygonsInvalid = setPlaceNewConfig.InvlidPlace;
foreach (var points in setPlaceNewConfig.InvlidPlace) foreach (var points in setPlaceNewConfig.InvlidPlace)
AddRects(ndiView, points, Brushes.Red); AddPoints(ndiView, points, Brushes.Red);
//AddRects(ndiView, points, Brushes.Red);
} }
} }
...@@ -534,14 +538,61 @@ namespace VIZ.FGOUT.Module ...@@ -534,14 +538,61 @@ namespace VIZ.FGOUT.Module
ndiView.polygonsStart.Clear(); ndiView.polygonsStart.Clear();
ndiView.polygonsEnd.Clear(); ndiView.polygonsEnd.Clear();
//nDIView.polygonsInvalid.Clear(); ndiView.polygonsInvalid.Clear();
ndiView.rectsInvalid.Clear(); //ndiView.rectsInvalid.Clear();
ndiView.canvas1.Children.Clear(); ndiView.canvas1.Children.Clear();
ndiView.polygon = null; ndiView.polygon = null;
} }
/// <summary> /// <summary>
/// 保存并发送位置命令
/// </summary>
/// <param name="sendPlaceModel"></param>
private void SaveAndSendPlace(SendPlaceModel sendPlaceModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
return;
NDIView nDIView = this.GetView<NDIView>();
#region 保存位置部分
this.setPlaceNewConfig = ApplicationDomainEx.LiteDbContext.SetPlaceNewConfig.FindOne(p => p.SportCode == this.viewConfig.GameName);
if (setPlaceNewConfig == null)
setPlaceNewConfig = new SetPlaceNewConfig();
setPlaceNewConfig.SportCode = viewConfig.GameName;
setPlaceNewConfig.StartPlace = nDIView.polygonsStart;
setPlaceNewConfig.EndPlace = nDIView.polygonsEnd;
setPlaceNewConfig.InvlidPlace = nDIView.polygonsInvalid;
ApplicationDomainEx.LiteDbContext.SetPlaceNewConfig.Upsert(setPlaceNewConfig);
#endregion
#region 发送位置部分
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (manager == null)
return;
var srcWidth = nDIView.video.ActualWidth;
var srcHeight = nDIView.video.ActualHeight;
AlgorithmPackage_Figout_new_model package = new AlgorithmPackage_Figout_new_model();
package.start = Coordinate(nDIView.polygonsStart, srcWidth, srcHeight);
package.end = Coordinate(nDIView.polygonsEnd, srcWidth, srcHeight);
package.ignore = Coordinate(nDIView.polygonsInvalid, srcWidth, srcHeight);
manager.SendJson(package);
MessageBoxEx.ShowDialog("发送成功");
#endregion
}
/// <summary>
/// 发送位置命令 /// 发送位置命令
/// </summary> /// </summary>
/// <param name="sendPlaceModel"></param> /// <param name="sendPlaceModel"></param>
...@@ -572,8 +623,8 @@ namespace VIZ.FGOUT.Module ...@@ -572,8 +623,8 @@ namespace VIZ.FGOUT.Module
AlgorithmPackage_Figout_new_model package = new AlgorithmPackage_Figout_new_model(); AlgorithmPackage_Figout_new_model package = new AlgorithmPackage_Figout_new_model();
package.start = Coordinate(nDIView.polygonsStart, srcWidth, srcHeight); package.start = Coordinate(nDIView.polygonsStart, srcWidth, srcHeight);
package.end = Coordinate(nDIView.polygonsEnd, srcWidth, srcHeight); package.end = Coordinate(nDIView.polygonsEnd, srcWidth, srcHeight);
//package.ignore = Coordinate(nDIView.polygonsInvalid, srcWidth, srcHeight); package.ignore = Coordinate(nDIView.polygonsInvalid, srcWidth, srcHeight);
package.ignore = Coordinate(nDIView.rectsInvalid, srcWidth, srcHeight); //package.ignore = Coordinate(nDIView.rectsInvalid, srcWidth, srcHeight);
//if (rectStart.Width == 0 && rectStart.Height == 0) //if (rectStart.Width == 0 && rectStart.Height == 0)
//{ //{
...@@ -690,11 +741,11 @@ namespace VIZ.FGOUT.Module ...@@ -690,11 +741,11 @@ namespace VIZ.FGOUT.Module
//setPlaceConfig.EndPlace = endPlace; //setPlaceConfig.EndPlace = endPlace;
//setPlaceConfig.InvlidPlace = invalid; //setPlaceConfig.InvlidPlace = invalid;
setPlaceNewConfig.SportCode = this.viewConfig.GameName; setPlaceNewConfig.SportCode = viewConfig.GameName;
setPlaceNewConfig.StartPlace = nDIView.polygonsStart; setPlaceNewConfig.StartPlace = nDIView.polygonsStart;
setPlaceNewConfig.EndPlace = nDIView.polygonsEnd; setPlaceNewConfig.EndPlace = nDIView.polygonsEnd;
//setPlaceNewConfig.InvlidPlace = nDIView.polygonsInvalid; setPlaceNewConfig.InvlidPlace = nDIView.polygonsInvalid;
setPlaceNewConfig.InvlidPlace = nDIView.rectsInvalid; // setPlaceNewConfig.InvlidPlace = nDIView.rectsInvalid;
//ApplicationDomainEx.LiteDbContext.SetPlaceConfig.Upsert(setPlaceConfig); //ApplicationDomainEx.LiteDbContext.SetPlaceConfig.Upsert(setPlaceConfig);
ApplicationDomainEx.LiteDbContext.SetPlaceNewConfig.Upsert(setPlaceNewConfig); ApplicationDomainEx.LiteDbContext.SetPlaceNewConfig.Upsert(setPlaceNewConfig);
...@@ -1028,30 +1079,32 @@ namespace VIZ.FGOUT.Module ...@@ -1028,30 +1079,32 @@ namespace VIZ.FGOUT.Module
if (this.manualConfig != null && !this.manualConfig.IsManual) if (this.manualConfig != null && !this.manualConfig.IsManual)
{ {
NDIView view = this.GetView<NDIView>(); NDIView view = this.GetView<NDIView>();
if(view == null) return; if (view == null) return;
//WPFHelper.Invoke(() => //WPFHelper.Invoke(() =>
//{ //{
// try // try
// { // {
if (setPlaceNewConfig.StartPlace.Count > 0) if (setPlaceNewConfig.StartPlace.Count > 0)
{ {
view.polygonsStart = setPlaceNewConfig.StartPlace; view.polygonsStart = setPlaceNewConfig.StartPlace;
foreach (var points in setPlaceNewConfig.StartPlace) foreach (var points in setPlaceNewConfig.StartPlace)
AddPoints(view, points, Brushes.Blue); AddPoints(view, points, Brushes.Blue);
} }
if (setPlaceNewConfig.EndPlace.Count > 0) if (setPlaceNewConfig.EndPlace.Count > 0)
{ {
view.polygonsEnd = setPlaceNewConfig.EndPlace; view.polygonsEnd = setPlaceNewConfig.EndPlace;
foreach (var points in setPlaceNewConfig.EndPlace) foreach (var points in setPlaceNewConfig.EndPlace)
AddPoints(view, points, Brushes.Green); AddPoints(view, points, Brushes.Green);
} }
if (setPlaceNewConfig.InvlidPlace.Count > 0) if (setPlaceNewConfig.InvlidPlace.Count > 0)
{ {
view.rectsInvalid = setPlaceNewConfig.InvlidPlace; //view.rectsInvalid = setPlaceNewConfig.InvlidPlace;
foreach (var points in setPlaceNewConfig.InvlidPlace) view.polygonsInvalid = setPlaceNewConfig.InvlidPlace;
AddRects(view, points, Brushes.Red); foreach (var points in setPlaceNewConfig.InvlidPlace)
} AddPoints(view, points, Brushes.Red);
//AddRects(view, points, Brushes.Red);
}
// } // }
// catch (Exception ex) // catch (Exception ex)
// { // {
...@@ -1416,8 +1469,10 @@ namespace VIZ.FGOUT.Module ...@@ -1416,8 +1469,10 @@ namespace VIZ.FGOUT.Module
view.polygonsStart.RemoveAt(view.polygonsStart.Count - 1); view.polygonsStart.RemoveAt(view.polygonsStart.Count - 1);
else if (IsDrawEndPlace && view.polygonsEnd.Count > 0) else if (IsDrawEndPlace && view.polygonsEnd.Count > 0)
view.polygonsEnd.RemoveAt(view.polygonsEnd.Count - 1); view.polygonsEnd.RemoveAt(view.polygonsEnd.Count - 1);
else if (IsDrawInvalidPlace && view.rectsInvalid.Count > 0) //else if (IsDrawInvalidPlace && view.rectsInvalid.Count > 0)
view.rectsInvalid.RemoveAt(view.rectsInvalid.Count - 1); // view.rectsInvalid.RemoveAt(view.rectsInvalid.Count - 1);
else if (IsDrawInvalidPlace && view.polygonsInvalid.Count > 0)
view.polygonsInvalid.RemoveAt(view.polygonsInvalid.Count - 1);
else if (IsReplay && view.rectsReplay.Count > 0) else if (IsReplay && view.rectsReplay.Count > 0)
view.rectsReplay.RemoveAt(view.rectsReplay.Count - 1); view.rectsReplay.RemoveAt(view.rectsReplay.Count - 1);
...@@ -1436,11 +1491,16 @@ namespace VIZ.FGOUT.Module ...@@ -1436,11 +1491,16 @@ namespace VIZ.FGOUT.Module
foreach (var points in view.polygonsEnd) foreach (var points in view.polygonsEnd)
AddPoints(view, points, Brushes.Green); AddPoints(view, points, Brushes.Green);
} }
if (view.rectsInvalid.Count > 0) if (view.polygonsInvalid.Count > 0)
{ {
foreach (var points in view.rectsInvalid) foreach (var points in view.polygonsInvalid)
AddRects(view, points, Brushes.Red); AddPoints(view, points, Brushes.Red);
} }
//if (view.rectsInvalid.Count > 0)
//{
// foreach (var points in view.rectsInvalid)
// AddRects(view, points, Brushes.Red);
//}
//if (view.rectsReplay.Count > 0) //if (view.rectsReplay.Count > 0)
//{ //{
// foreach (var points in view.rectsReplay) // foreach (var points in view.rectsReplay)
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C90FE303D44366A3840C034023AD6A60CC1E9C5DC635831D9CB7335A937227AE" #pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "841D2ADFBDE7B19B7DFA60A2653D5E0D29FEC0AE46BB26DAD0A13D7DCCB89417"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C90FE303D44366A3840C034023AD6A60CC1E9C5DC635831D9CB7335A937227AE" #pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "841D2ADFBDE7B19B7DFA60A2653D5E0D29FEC0AE46BB26DAD0A13D7DCCB89417"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDISettingView\View\AlgorithmSettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F19EA6F5F1FB80AFB0D5E5F094B32D142B11D3339C6D2987D25E6FAB7F9F9026" #pragma checksum "..\..\..\..\..\NDISettingView\View\AlgorithmSettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F062D90B148837AB6667D5262C07FC39A30EF037B533E1693A1B7557742A7F2D"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDISettingView\View\AlgorithmSettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F19EA6F5F1FB80AFB0D5E5F094B32D142B11D3339C6D2987D25E6FAB7F9F9026" #pragma checksum "..\..\..\..\..\NDISettingView\View\AlgorithmSettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F062D90B148837AB6667D5262C07FC39A30EF037B533E1693A1B7557742A7F2D"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <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;;
......
...@@ -30,7 +30,7 @@ namespace VIZ.FGOUT.Storage ...@@ -30,7 +30,7 @@ namespace VIZ.FGOUT.Storage
/// <summary> /// <summary>
/// 无效位置 /// 无效位置
/// </summary> /// </summary>
//public List<PointCollection> InvlidPlace { get; set; } = new List<PointCollection>(); public List<PointCollection> InvlidPlace { get; set; } = new List<PointCollection>();
public List<Rect> InvlidPlace { get; set; } = new List<Rect>(); //public List<Rect> InvlidPlace { get; set; } = new List<Rect>();
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -28,6 +28,8 @@ VIDEO_TRACKING_BOX_BORDER_COLOR=#FFFF0000 ...@@ -28,6 +28,8 @@ VIDEO_TRACKING_BOX_BORDER_COLOR=#FFFF0000
VIDEO_DETECT_BOX_BORDER_WIDTH=2 VIDEO_DETECT_BOX_BORDER_WIDTH=2
;检测框边框颜色(格式:#AARRGGBB) ;检测框边框颜色(格式:#AARRGGBB)
VIDEO_DETECT_BOX_BORDER_COLOR=#FFFF7373 VIDEO_DETECT_BOX_BORDER_COLOR=#FFFF7373
;忽略框边框颜色(格式:#AARRGGBB)
VIDEO_IGNORE_BOX_BORDER_COLOR=#FF808080
;视频框选边框宽度(单位:像素) ;视频框选边框宽度(单位:像素)
VIDEO_FRAME_SELECTION_BORDER_WIDTH=4 VIDEO_FRAME_SELECTION_BORDER_WIDTH=4
;视频框选边框颜色(格式:#AARRGGBB) ;视频框选边框颜色(格式:#AARRGGBB)
......
...@@ -28,6 +28,8 @@ VIDEO_TRACKING_BOX_BORDER_COLOR=#FFFF0000 ...@@ -28,6 +28,8 @@ VIDEO_TRACKING_BOX_BORDER_COLOR=#FFFF0000
VIDEO_DETECT_BOX_BORDER_WIDTH=2 VIDEO_DETECT_BOX_BORDER_WIDTH=2
;检测框边框颜色(格式:#AARRGGBB) ;检测框边框颜色(格式:#AARRGGBB)
VIDEO_DETECT_BOX_BORDER_COLOR=#FFFF7373 VIDEO_DETECT_BOX_BORDER_COLOR=#FFFF7373
;忽略框边框颜色(格式:#AARRGGBB)
VIDEO_IGNORE_BOX_BORDER_COLOR=#FF808080
;视频框选边框宽度(单位:像素) ;视频框选边框宽度(单位:像素)
VIDEO_FRAME_SELECTION_BORDER_WIDTH=4 VIDEO_FRAME_SELECTION_BORDER_WIDTH=4
;视频框选边框颜色(格式:#AARRGGBB) ;视频框选边框颜色(格式:#AARRGGBB)
......
using SharpDX.Mathematics.Interop; using SharpDX.Mathematics.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Core namespace VIZ.Framework.Core
{ {
......
...@@ -50,6 +50,12 @@ namespace VIZ.Framework.Storage ...@@ -50,6 +50,12 @@ namespace VIZ.Framework.Storage
public string VIDEO_DETECT_BOX_BORDER_COLOR { get; set; } public string VIDEO_DETECT_BOX_BORDER_COLOR { get; set; }
/// <summary> /// <summary>
/// 忽略框边框颜色(格式:#AARRGGBB)
/// </summary>
[Ini(Section = "Video", DefaultValue = "#FF080808", Type = typeof(RawColor4))]
public string VIDEO_IGNORE_BOX_BORDER_COLOR { get; set; }
/// <summary>
/// 框选框边框宽度(单位:像素) /// 框选框边框宽度(单位:像素)
/// </summary> /// </summary>
[Ini(Section = "Video", DefaultValue = "4", Type = typeof(int))] [Ini(Section = "Video", DefaultValue = "4", Type = typeof(int))]
......
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