Commit cc5641a4 by 王永辉

标记像素点坐标值改为4K屏的整数坐标值

parent 8d20a4c2

//------------------------------------------------------------------------------
// <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
false
21870986562
2-725104376
31364711570
171166775462
3947974750
17-424547842
Themes\Generic.xaml;Widgets\FootballFieldPanel\FootballFieldPanel.xaml;
False
True
......@@ -24,20 +24,20 @@ namespace VIZ.FGOUT.Connection
/// <summary>
/// startPlace
/// </summary>
public List<PointCollection> start { get; set; }
public List<List<List<int>>> start { get; set; }
/// <summary>
/// endPalce
/// </summary>
public List<PointCollection> end { get; set; }
public List<List<List<int>>> end { get; set; }
/// <summary>
/// InValidPalce
/// </summary>
public List<PointCollection> ignore { get; set; }
public List<List<List<int>>> ignore { get; set; }
/// <summary>
/// 跟踪框的坐标
......
......@@ -10,11 +10,11 @@ none
false
DEBUG;TRACE
18560433975
1470602451
11-350624472
241319896476
181380438361
1-1441241311
11-1602666439
23304678694
Style\Button\Button_NdiView.xaml;Style\Button\Button_Setting.xaml;Style\Button\Button_WindowTop.xaml;Style\CheckBox\CheckBox_NdiView.xaml;Style\CheckBox\CheckBox_Setting.xaml;Style\CheckBox\CheckBox_WindowTop.xaml;Style\ComboBox\ComboBox_Setting.xaml;Style\HotkeyBox\HotkeyBox_Setting.xaml;Style\MessageBox\MessageBoxEx.xaml;Style\RadioButton\RadioButton_FootballSide.xaml;Style\RadioButton\RadioButton_NdiView.xaml;Style\RadioButton\RadioButton_Setting.xaml;Style\Slider\Slider_Setting.xaml;Style\TextBlock\TextBlock_Setting.xaml;Style\TextBox\TextBox_Setting.xaml;Style\ToogleButton\ToogleButton_Setting.xaml;Themes\Generic.xaml;Toolkit\NumericUpDown\NumericUpDown.xaml;
False
True
......@@ -175,8 +175,9 @@
<WrapPanel
Grid.Row="1"
Grid.Column="1"
Margin="125,0,0,0">
Grid.Column="0"
Margin="0,0,40,0"
HorizontalAlignment="Right">
<Grid>
......
using OpenCvSharp.ML;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
using VIZ.Framework.Storage;
namespace VIZ.FGOUT.Module
{
......
......@@ -491,7 +491,8 @@ namespace VIZ.FGOUT.Module
lock (GlobalUsedPorts)
{
string ip = clientIP;
//string ip = clientIP;
string ip = "192.168.31.70";
int port = 8001;
//NetHelper.GetAvailableUdpPort(8200, 9200, GlobalUsedPorts);
GlobalUsedPorts.Add(port);
......
......@@ -59,11 +59,11 @@ namespace VIZ.FGOUT.Module
//rectEnd.Name = "rectEnd1";
//this.canvas1.Children.Add(rectEnd);
myPath.Fill = Brushes.Transparent;
myPath.Stroke = Brushes.Blue;
myPath.StrokeThickness = 1;
// myPath.Data = aa;
this.canvas1.Children.Add(myPath);
// myPath.Fill = Brushes.Transparent;
// myPath.Stroke = Brushes.Blue;
// myPath.StrokeThickness = 1;
//// myPath.Data = aa;
// this.canvas1.Children.Add(myPath);
//myPath1.Fill = Brushes.Transparent;
//myPath1.Stroke = Brushes.Red;
......@@ -204,60 +204,61 @@ namespace VIZ.FGOUT.Module
//{
// myPath.Stroke = Brushes.Green;
//}
if (vm.IsDrawStartPlace || vm.IsDrawEndPlace || vm.IsDrawInvalidPlace)
DrawPolygon(e.GetPosition(this.canvas1));
if (vm.IsDrawStartPlace)
DrawPolygon(e.GetPosition(this.canvas1), Brushes.Blue);
else if (vm.IsDrawEndPlace)
DrawPolygon(e.GetPosition(this.canvas1), Brushes.Green);
else if (vm.IsDrawInvalidPlace)
DrawPolygon(e.GetPosition(this.canvas1), Brushes.Red);
//if(e.ClickCount == 2)
// polygon = null;
}
List<Rect> rectStarts = new List<Rect>();
private void Border_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseDown)
{
if (vm.IsDrawStartPlace)
{
//DrawPath(startPoint, e.GetPosition(this.canvas1));
DrawPolygon(e.GetPosition(this.canvas1));
//rectStart = new Rect(startPoint, e.GetPosition(this.canvas1));
//rectStarts.Add(new Rect(startPoint, e.GetPosition(this.canvas1)));
//rectStart.Margin = new Thickness(rect.Left, rect.Top, 0, 0);
//rectStart.Width = rect.Width;
//rectStart.Height = rect.Height;
}
else if(vm.IsDrawEndPlace)
{
rectEnd = new Rect(startPoint, e.GetPosition(this.canvas1));
//rectEnd.Margin = new Thickness(rect.Left, rect.Top, 0, 0);
//rectEnd.Width = rect.Width;
//rectEnd.Height = rect.Height;
}
else if(vm.IsDrawInvalidPlace)
{
rectInvalid=new Rect(startPoint, e.GetPosition(this.canvas1));
}
}
//if (isMouseDown)
//{
// if (vm.IsDrawStartPlace)
// {
// //DrawPath(startPoint, e.GetPosition(this.canvas1));
// //DrawPolygon(e.GetPosition(this.canvas1));
// //rectStart = new Rect(startPoint, e.GetPosition(this.canvas1));
// //rectStart.Margin = new Thickness(rect.Left, rect.Top, 0, 0);
// //rectStart.Width = rect.Width;
// //rectStart.Height = rect.Height;
// }
// else if(vm.IsDrawEndPlace)
// {
// rectEnd = new Rect(startPoint, e.GetPosition(this.canvas1));
// //rectEnd.Margin = new Thickness(rect.Left, rect.Top, 0, 0);
// //rectEnd.Width = rect.Width;
// //rectEnd.Height = rect.Height;
// }
// else if(vm.IsDrawInvalidPlace)
// {
// rectInvalid=new Rect(startPoint, e.GetPosition(this.canvas1));
// }
//}
}
public Polygon polygon;
public PointCollection points;
private void DrawPolygon(Point point)
private void DrawPolygon(Point point, Brush brush)
{
if (polygon == null)
{
polygon = new Polygon
{
Stroke = Brushes.Blue,
Stroke = brush,
StrokeThickness = 1,
Fill = Brushes.Transparent
};
points = new PointCollection();
this.canvas1.Children.Add(polygon);
}
points.Add(point);
polygon.Points = points;
}
......
using log4net;
using OpenCvSharp;
using SharpDX.Mathematics.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
using VIZ.FGOUT.Connection;
......@@ -13,6 +15,7 @@ using VIZ.FGOUT.Storage;
using VIZ.Framework.Common;
using VIZ.Framework.Connection;
using VIZ.Framework.Core;
using VIZ.Framework.Storage;
namespace VIZ.FGOUT.Module
{
......@@ -164,26 +167,17 @@ namespace VIZ.FGOUT.Module
/// </summary>
private void Replay(ReplayModel replayModel)
{
if (this.ViewKey != "CAM_1")
{
return;
}
ReplayPanelView replayPanelView = new ReplayPanelView();
RePlayPanelViewModel rePlayPanelViewModel = replayPanelView.DataContext as RePlayPanelViewModel;
rePlayPanelViewModel.timecode = timecode;
replayPanelView.Show();
}
/// <summary>
/// 开始位置命令
/// </summary>
......@@ -203,7 +197,6 @@ namespace VIZ.FGOUT.Module
IsCleanPlace = false;
}
/// <summary>
/// 结束位置命令
/// </summary>
......@@ -282,36 +275,31 @@ namespace VIZ.FGOUT.Module
private void SendPlace(SendPlaceModel sendPlaceModel)
{
// 对结束值进行组装
NDIView nDIView = this.GetView<NDIView>();
if (this.ViewKey != "CAM_1")
return;
var renderInfo = nDIView.video.GetRenderInfo();
//var renderInfo = nDIView.video.GetRenderInfo();
//var rectStart = nDIView.rectStart;
var rectEnd = nDIView.rectEnd;
var rectInvalid = nDIView.rectInvalid;
//var rectEnd = nDIView.rectEnd;
//var rectInvalid = nDIView.rectInvalid;
var srcWidth = nDIView.video.ActualWidth;
var srcHeight = nDIView.video.ActualHeight;
// ConnectionManager.UdpConnection.AddEndpointManager(new UdpEndpointManager("CAM_1", "192.168.31.95", 8001));
// ConnectionManager.UdpConnection.AddEndpointManager(new UdpEndpointManager("CAM_1", "192.168.31.95", 8001));
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager("CAM_1");
//AlgorithmPackage_Figout_model package = new AlgorithmPackage_Figout_model();
AlgorithmPackage_Figout_new_model package = new AlgorithmPackage_Figout_new_model();
package.start = nDIView.polygonsStart;
package.end = nDIView.polygonsEnd;
package.ignore = nDIView.polygonsInvalid;
package.start = Coordinate(nDIView.polygonsStart, srcWidth, srcHeight);
package.end = Coordinate(nDIView.polygonsEnd, srcWidth, srcHeight);
package.ignore = Coordinate(nDIView.polygonsInvalid, srcWidth, srcHeight);
//if (rectStart.Width == 0 && rectStart.Height == 0)
//{
// package.startPlace = null;
......@@ -341,12 +329,31 @@ namespace VIZ.FGOUT.Module
if (manager == null)
return;
manager.SendJson(package);
MessageBoxEx.ShowDialog("发送成功");
}
private List<List<List<int>>> Coordinate(List<PointCollection> points, double srcWidth, double srcHeight)
{
// 视频的宽度
int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WITH);
// 视频的高度
int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
double xp = srcWidth / resWith;
double xy = srcHeight / resHeight;
var listOuterMost = new List<List<List<int>>>();
foreach (var pcPoint in points)
{
var listMiddle = new List<List<int>>();
if (pcPoint.Count > 0)
foreach (var point in pcPoint)
listMiddle.Add(new List<int>() { Convert.ToInt32(point.X / xp), Convert.ToInt32(point.Y / xy) });
listOuterMost.Add(listMiddle);
}
return listOuterMost;
}
/// <summary>
/// 保存配置命令
/// </summary>
......@@ -400,16 +407,12 @@ namespace VIZ.FGOUT.Module
MessageBoxEx.ShowDialog("保存成功");
}
//private List<List<int>> Coordinate(Rect rect, VideoRenderInfo renderInfo, double srcWidth, double srcHeight)
//{
// // 视频的宽度
// int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WITH);
// // 视频的高度
// int resHeight= ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
// int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
// //int resHeight= ApplicationDomainEx.IniStorage.GetValue<ResConfig, int>(p => p.RES_HIEGHT);
// double xp = srcWidth / resWith;
......@@ -429,12 +432,10 @@ namespace VIZ.FGOUT.Module
// int x4 = dx;
// int y4 = dy + height;
// List<List<int>> coordinates = new List<List<int>>() { new List<int>() { dx, dy }, new List<int>() { x2, y2 }, new List<int>() { x3, y3 }, new List<int>(){ x4, y4 } };
// List<List<int>> coordinates = new List<List<int>>() { new List<int>() { dx, dy }, new List<int>() { x2, y2 }, new List<int>() { x3, y3 }, new List<int>() { x4, y4 } };
// return coordinates;
//}
/// <summary>
/// 初始化属性
/// </summary>
......@@ -447,9 +448,6 @@ namespace VIZ.FGOUT.Module
// 算法FPS统计
this.AlgorithmFPS = new FPSHelper();
this.AlgorithmFPS.Start();
}
/// <summary>
......@@ -667,7 +665,7 @@ namespace VIZ.FGOUT.Module
//view.rectStart = new Rect(setPlaceConfig.StartPlace[0], setPlaceConfig.StartPlace[1], setPlaceConfig.StartPlace[2], setPlaceConfig.StartPlace[3]);
//view.aa.AddGeometry(new RectangleGeometry(view.rectStart));
foreach (var points in setPlaceNewConfig.StartPlace)
AddPoints(view, points);
AddPoints(view, points, Brushes.Blue);
}
if (setPlaceNewConfig.EndPlace.Count > 0)
......@@ -676,7 +674,7 @@ namespace VIZ.FGOUT.Module
//view.rectEnd = new Rect(setPlaceConfig.EndPlace[0], setPlaceConfig.EndPlace[1], setPlaceConfig.EndPlace[2], setPlaceConfig.EndPlace[3]);
//view.aa.AddGeometry(new RectangleGeometry(view.rectEnd));
foreach (var points in setPlaceNewConfig.EndPlace)
AddPoints(view, points);
AddPoints(view, points, Brushes.Green);
}
if (setPlaceNewConfig.InvlidPlace.Count > 0)
......@@ -685,7 +683,7 @@ namespace VIZ.FGOUT.Module
//view.rectInvalid = new Rect(setPlaceConfig.InvlidPlace[0], setPlaceConfig.InvlidPlace[1], setPlaceConfig.InvlidPlace[2], setPlaceConfig.InvlidPlace[3]);
//view.aa.AddGeometry(new RectangleGeometry(view.rectInvalid));
foreach (var points in setPlaceNewConfig.InvlidPlace)
AddPoints(view, points);
AddPoints(view, points, Brushes.Red);
}
//view.myPath.Data = view.aa;
......@@ -693,11 +691,11 @@ namespace VIZ.FGOUT.Module
}
private void AddPoints(NDIView view, PointCollection points)
private void AddPoints(NDIView view, PointCollection points, Brush brush)
{
Polygon polygon = new Polygon
{
Stroke = Brushes.Blue,
Stroke = brush,
StrokeThickness = 1,
Fill = Brushes.Transparent
};
......
......@@ -71,7 +71,7 @@ namespace VIZ.FGOUT.Module
//如果没有选择预设则不发送
if(PresetsItem == null) return;
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager($"UE");
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(_endpointKey);
if (manager == null) return;
UEPackage uePackage = new UEPackage();
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F17D6BBFCB868C891664C3375D890DAF01CAC7C6DE76035A166ABE8DF84CF8DA"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "01435BBE89EC4DCDB63849DA92F11980D271587C3E8D98E3488B2A1580DCC915"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -58,7 +58,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 305 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 306 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam1;
......@@ -66,7 +66,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 323 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 324 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F17D6BBFCB868C891664C3375D890DAF01CAC7C6DE76035A166ABE8DF84CF8DA"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "01435BBE89EC4DCDB63849DA92F11980D271587C3E8D98E3488B2A1580DCC915"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -58,7 +58,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 305 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 306 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam1;
......@@ -66,7 +66,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 323 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 324 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......
......@@ -10,11 +10,11 @@ none
false
DEBUG;TRACE
22-808211288
22-1559853185
90-747441034
150-1446398279
90-1236168610
150-2097665076
NDIMainView\View\NDIMainView.xaml;NDIPreviewView\View\NDIPreviewView.xaml;NDISettingView\View\AlgorithmSettingPanelView.xaml;NDISettingView\View\Algorithm\AlgorithmCablewayPanelView.xaml;NDISettingView\View\Algorithm\AlgorithmNearPanelView.xaml;NDISettingView\View\Algorithm\AlgorithmSinglePanelView.xaml;NDISettingView\View\Algorithm\AlgorithmSixteenPanelView.xaml;NDISettingView\View\Algorithm\AlgorithmTacticsPanelView.xaml;NDISettingView\View\NDISettingPanelView.xaml;NDISettingView\View\NDISettingView.xaml;NDIView\View\NDIView.xaml;SystemSetting\View\AboutPanelView.xaml;SystemSetting\View\CheckDataPanelView.xaml;SystemSetting\View\HotkeySettingPanelView.xaml;SystemSetting\View\MattingImagePanelView.xaml;SystemSetting\View\PackageSettingPanelView.xaml;SystemSetting\View\PreviewSettingPanelView.xaml;SystemSetting\View\ReplayPanelView.xaml;SystemSetting\View\StyleSettingPanelView.xaml;SystemSetting\View\SystemSettingView.xaml;SystemSetting\View\UEControlPanelView.xaml;SystemSetting\View\UESettingPanelView.xaml;
False
True
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Storage;
using VIZ.Framework.Storage;
namespace VIZ.FGOUT.Storage
{
......@@ -25,7 +19,5 @@ namespace VIZ.FGOUT.Storage
/// </summary>
[Ini(Section = "UDP", DefaultValue = "8100", Type = typeof(int))]
public string UDP_BINDING_PORT { get; set; }
}
}
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