Commit 32af1cbb by 鲁志-悦动

在手动模式绘制无效区域的时候,不给算法发送鼠标按下的坐标点 And 点击清除位置按钮加再次确认提示

parent 1acd09de
//------------------------------------------------------------------------------ 
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}
...@@ -10,11 +10,11 @@ none ...@@ -10,11 +10,11 @@ none
false false
2-725104376 21870986562
3947974750 31364711570
17-1462717611 17-1683084370
Themes\Generic.xaml;Widgets\FootballFieldPanel\FootballFieldPanel.xaml; Themes\Generic.xaml;Widgets\FootballFieldPanel\FootballFieldPanel.xaml;
True False
 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;;
......
...@@ -53,6 +53,17 @@ namespace VIZ.FGOUT.Connection ...@@ -53,6 +53,17 @@ namespace VIZ.FGOUT.Connection
message.ignore_bboxes.Add(target); message.ignore_bboxes.Add(target);
} }
} }
if (package.roi_bbox != null && package.roi_bbox.Count > 0)
{
foreach (List<int> src in package.roi_bbox)
{
if (src == null || src.Count != 4)
continue;
RawRectangleF target = new RawRectangleF(src[0], src[1], src[2], src[3]);
message.roi_bbox.Add(target);
}
}
Signal = AlgorithmPackageSignal.detect; Signal = AlgorithmPackageSignal.detect;
} }
else if (package.signal == "track") else if (package.signal == "track")
......
...@@ -40,6 +40,8 @@ namespace VIZ.FGOUT.Connection ...@@ -40,6 +40,8 @@ namespace VIZ.FGOUT.Connection
public List<List<int>> ignore_bboxes { get; set; } public List<List<int>> ignore_bboxes { get; set; }
public List<List<int>> roi_bbox { get; set; }
/// <summary> /// <summary>
/// 跟踪框的定义 /// 跟踪框的定义
/// </summary> /// </summary>
......
...@@ -15,6 +15,8 @@ namespace VIZ.FGOUT.Domain ...@@ -15,6 +15,8 @@ namespace VIZ.FGOUT.Domain
public List<RawRectangleF> ignore_bboxes { get; set; } = new List<RawRectangleF>(); public List<RawRectangleF> ignore_bboxes { get; set; } = new List<RawRectangleF>();
public List<RawRectangleF> roi_bbox { get; set; } = new List<RawRectangleF>();
/// <summary> /// <summary>
/// 裁切坐标 /// 裁切坐标
/// </summary> /// </summary>
......
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
...@@ -339,15 +340,16 @@ namespace VIZ.FGOUT.Module ...@@ -339,15 +340,16 @@ namespace VIZ.FGOUT.Module
{ {
foreach (var info in NDIViewModel._cam3StaticInfos) foreach (var info in NDIViewModel._cam3StaticInfos)
{ {
if (info.SrcRect.Left > 0 && info.SrcRect.Right > 0 && info.SrcRect.Top > 0 && info.SrcRect.Bottom > 0) //if (info.SrcRect.Left > 0 && info.SrcRect.Right > 0 && info.SrcRect.Top > 0 && info.SrcRect.Bottom > 0)
{ //{
var difference = (startPoint.X - info.SrcRect.Left) + (info.SrcRect.Right - startPoint.X); var difference = Math.Abs(startPoint.X - info.SrcRect.Left) + Math.Abs(info.SrcRect.Right - startPoint.X)
+ Math.Abs(startPoint.Y - info.SrcRect.Top) + Math.Abs(info.SrcRect.Bottom - startPoint.Y);
if (difference < minDistance) if (difference < minDistance)
{ {
saveInfo = info; saveInfo = info;
minDistance = difference; minDistance = difference;
} }
} //}
} }
} }
} }
......
...@@ -178,6 +178,9 @@ namespace VIZ.FGOUT.Module ...@@ -178,6 +178,9 @@ namespace VIZ.FGOUT.Module
/// </summary> /// </summary>
private void TrackingBoxPlugin_TrackingBoxClick(object sender, TrackingBoxClickEventArgs e) private void TrackingBoxPlugin_TrackingBoxClick(object sender, TrackingBoxClickEventArgs e)
{ {
//无效位置按钮按下时,不发送坐标
if(IsDrawInvalidPlace)
return;
if (e.HitTrackingBoxInfo == null) if (e.HitTrackingBoxInfo == null)
return; return;
this.AlgorithmControllerDic[this.StrategyType].Tracking(e.VideoPointCenter); this.AlgorithmControllerDic[this.StrategyType].Tracking(e.VideoPointCenter);
......
...@@ -23,7 +23,7 @@ namespace VIZ.FGOUT.Module ...@@ -23,7 +23,7 @@ namespace VIZ.FGOUT.Module
private readonly FrameBuffer _frameBuffer = new FrameBuffer(TimeSpan.FromSeconds(10)); private readonly FrameBuffer _frameBuffer = new FrameBuffer(TimeSpan.FromSeconds(10));
private readonly TrackingBoxInfoBuffer _trackingBoxInfoBuffer = private readonly TrackingBoxInfoBuffer _trackingBoxInfoBuffer =
new TrackingBoxInfoBuffer(TimeSpan.FromSeconds(10)); new TrackingBoxInfoBuffer(TimeSpan.FromSeconds(30));
public List<TrackingBoxInfo> _cam3Infos = new List<TrackingBoxInfo>(); public List<TrackingBoxInfo> _cam3Infos = new List<TrackingBoxInfo>();
...@@ -285,7 +285,10 @@ namespace VIZ.FGOUT.Module ...@@ -285,7 +285,10 @@ namespace VIZ.FGOUT.Module
view3.video.UpdateVideoFrame(dsExtend, true); view3.video.UpdateVideoFrame(dsExtend, true);
// 更新视频控件跟踪框信息 // 更新视频控件跟踪框信息
if (_cam3Infos.Count > 0) if (_cam3Infos.Count > 0)
{
_cam3StaticInfos = _cam3Infos;
view3.video.UpdateTrackingBox(_cam3Infos); view3.video.UpdateTrackingBox(_cam3Infos);
}
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -423,7 +426,7 @@ namespace VIZ.FGOUT.Module ...@@ -423,7 +426,7 @@ namespace VIZ.FGOUT.Module
{ {
buffer.Enqueue(frame); buffer.Enqueue(frame);
// 如果缓冲区超过容量,则移除最旧的帧 // 如果缓冲区超过容量,则移除最旧的帧
if (buffer.Count > 500) if (buffer.Count > 1500)
buffer.Dequeue(); buffer.Dequeue();
} }
......
...@@ -150,7 +150,7 @@ namespace VIZ.FGOUT.Module ...@@ -150,7 +150,7 @@ namespace VIZ.FGOUT.Module
// 无效区域的注册 // 无效区域的注册
ApplicationDomain.MessageManager.Register<InvalidPlaceModel>(this, this.InvalidPlaceModel); ApplicationDomain.MessageManager.Register<InvalidPlaceModel>(this, this.InvalidPlaceModel);
// 清除开始、结束、无效位置 // (清空位置)清除开始、结束、无效位置
ApplicationDomain.MessageManager.Register<CleanPlaceModel>(this, this.CleanPlace); ApplicationDomain.MessageManager.Register<CleanPlaceModel>(this, this.CleanPlace);
// 显示无效位置 // 显示无效位置
...@@ -297,7 +297,7 @@ namespace VIZ.FGOUT.Module ...@@ -297,7 +297,7 @@ namespace VIZ.FGOUT.Module
////延时2秒 ////延时2秒
//Thread.Sleep(2000); //Thread.Sleep(2000);
manager.SendJson(replayPackage); manager.SendJson(replayPackage);
MessageBoxEx.ShowDialog("Replay Start OK."); //MessageBoxEx.ShowDialog("Replay Start OK.");
} }
private void CleanInPoints(CleanInPointsModel cleanInPointsModel) private void CleanInPoints(CleanInPointsModel cleanInPointsModel)
...@@ -585,6 +585,11 @@ namespace VIZ.FGOUT.Module ...@@ -585,6 +585,11 @@ namespace VIZ.FGOUT.Module
{ {
if (this.ViewKey != NDIViewKeys.CAM_1) if (this.ViewKey != NDIViewKeys.CAM_1)
return; return;
MessageBoxExResult result = MessageBoxEx.ShowDialog("提示", "确定清空位置?", MessageBoxExButtons.YES_CANCEL, this.GetWindow());
if (result != MessageBoxExResult.YES)
return;
var ndiView = this.GetView<NDIView>(); var ndiView = this.GetView<NDIView>();
if (ndiView == null) if (ndiView == null)
return; return;
......
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