Commit 91b2a119 by liulongfei

1. 居中模式鼠标移动

2. 目标选择框颜色调整
parent f55bde89
...@@ -32,6 +32,7 @@ namespace VIZ.H2V.Connection ...@@ -32,6 +32,7 @@ namespace VIZ.H2V.Connection
AlgorithmMessage__detect message = new AlgorithmMessage__detect(); AlgorithmMessage__detect message = new AlgorithmMessage__detect();
message.AlgorithmID = package.id; message.AlgorithmID = package.id;
message.timecode = package.timecode;
if (package.bboxes != null && package.bboxes.Count > 0) if (package.bboxes != null && package.bboxes.Count > 0)
{ {
foreach (List<int> src in package.bboxes) foreach (List<int> src in package.bboxes)
...@@ -44,6 +45,11 @@ namespace VIZ.H2V.Connection ...@@ -44,6 +45,11 @@ namespace VIZ.H2V.Connection
} }
} }
if (package.roi != null && package.roi.Count == 4)
{
message.roi = new RawRectangleF(package.roi[0], package.roi[1], package.roi[2], package.roi[3]);
}
ApplicationDomainEx.MessageManager.Send(message); ApplicationDomainEx.MessageManager.Send(message);
} }
} }
......
...@@ -18,6 +18,16 @@ namespace VIZ.H2V.Connection ...@@ -18,6 +18,16 @@ namespace VIZ.H2V.Connection
public override string signal { get; set; } = AlgorithmPackageSignal.detect; public override string signal { get; set; } = AlgorithmPackageSignal.detect;
/// <summary> /// <summary>
/// 裁切坐标(左上角x,y,右下角x,y)
/// </summary>
public List<int> roi { get; set; }
/// <summary>
/// 时间码
/// </summary>
public long timecode { get; set; }
/// <summary>
/// 检测数据框(左上角x,y,右下角x,y) /// 检测数据框(左上角x,y,右下角x,y)
/// </summary> /// </summary>
public List<List<int>> bboxes { get; set; } public List<List<int>> bboxes { get; set; }
......
...@@ -11,7 +11,7 @@ namespace VIZ.H2V.Domain ...@@ -11,7 +11,7 @@ namespace VIZ.H2V.Domain
/// <summary> /// <summary>
/// 算法消息 -- 裁切 /// 算法消息 -- 裁切
/// </summary> /// </summary>
public class AlgorithmMessage__crop_roi : AlgorithmMessageBase public class AlgorithmMessage__crop_roi : AlgorithmMessageBase, IAlgorithmMessage__roi
{ {
/// <summary> /// <summary>
/// 裁切坐标 /// 裁切坐标
......
...@@ -10,11 +10,21 @@ namespace VIZ.H2V.Domain ...@@ -10,11 +10,21 @@ namespace VIZ.H2V.Domain
/// <summary> /// <summary>
/// 算法消息 -- 检测 /// 算法消息 -- 检测
/// </summary> /// </summary>
public class AlgorithmMessage__detect : AlgorithmMessageBase public class AlgorithmMessage__detect : AlgorithmMessageBase, IAlgorithmMessage__roi
{ {
/// <summary> /// <summary>
/// 裁剪框 /// 裁剪框
/// </summary> /// </summary>
public List<RawRectangleF> bboxes { get; set; } = new List<RawRectangleF>(); public List<RawRectangleF> bboxes { get; set; } = new List<RawRectangleF>();
/// <summary>
/// 裁切坐标
/// </summary>
public RawRectangleF? roi { get; set; }
/// <summary>
/// 时间码
/// </summary>
public long timecode { get; set; }
} }
} }
using SharpDX.Mathematics.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.H2V.Domain
{
/// <summary>
/// 算法消息,包含裁切框信息的算法消息
/// </summary>
public interface IAlgorithmMessage__roi
{
/// <summary>
/// 时间码
/// </summary>
long timecode { get; set; }
/// <summary>
/// 裁切坐标
/// </summary>
RawRectangleF? roi { get; set; }
}
}
...@@ -69,10 +69,11 @@ ...@@ -69,10 +69,11 @@
<Compile Include="Enum\ServiceKeys.cs" /> <Compile Include="Enum\ServiceKeys.cs" />
<Compile Include="Info\AlgorithmInfo_borderpoint.cs" /> <Compile Include="Info\AlgorithmInfo_borderpoint.cs" />
<Compile Include="Info\AlgorithmInfo_borderline.cs" /> <Compile Include="Info\AlgorithmInfo_borderline.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessageBase.cs" /> <Compile Include="Message\Algorithm\Implementation\AlgorithmMessageBase.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessage__detect.cs" /> <Compile Include="Message\Algorithm\Implementation\AlgorithmMessage__detect.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessage__crop_roi.cs" /> <Compile Include="Message\Algorithm\Implementation\AlgorithmMessage__crop_roi.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessage__checked_ok.cs" /> <Compile Include="Message\Algorithm\Implementation\AlgorithmMessage__checked_ok.cs" />
<Compile Include="Message\Algorithm\Interface\IAlgorithmMessage__roi.cs" />
<Compile Include="Message\NDI\AlgorithmStrategyChangedToManualMessage.cs" /> <Compile Include="Message\NDI\AlgorithmStrategyChangedToManualMessage.cs" />
<Compile Include="Model\Algorithm\AlgorithmProcessModel.cs" /> <Compile Include="Model\Algorithm\AlgorithmProcessModel.cs" />
<Compile Include="Model\Algorithm\AlgorithmBorderScenceModel.cs" /> <Compile Include="Model\Algorithm\AlgorithmBorderScenceModel.cs" />
......
...@@ -54,5 +54,10 @@ namespace VIZ.H2V.Module ...@@ -54,5 +54,10 @@ namespace VIZ.H2V.Module
/// </summary> /// </summary>
/// <param name="clipX">剪切X值</param> /// <param name="clipX">剪切X值</param>
void Reset(double clipX); void Reset(double clipX);
/// <summary>
/// 重置自动移动
/// </summary>
void ResetAutoMoving();
} }
} }
...@@ -185,6 +185,15 @@ namespace VIZ.H2V.Module ...@@ -185,6 +185,15 @@ namespace VIZ.H2V.Module
} }
/// <summary> /// <summary>
/// 重置自动移动
/// </summary>
public void ResetAutoMoving()
{
this.IsClipBoxAutoMoving = false;
this.ClipBoxAutoMovingFrame = 0;
}
/// <summary>
/// 获取居中模式计算值 /// 获取居中模式计算值
/// </summary> /// </summary>
/// <param name="min">最小值</param> /// <param name="min">最小值</param>
......
...@@ -129,24 +129,26 @@ ...@@ -129,24 +129,26 @@
IsChecked="{Binding Path=IsUseClip,Mode=TwoWay}" IsChecked="{Binding Path=IsUseClip,Mode=TwoWay}"
Style="{StaticResource CheckBox_NdiView}"></CheckBox> Style="{StaticResource CheckBox_NdiView}"></CheckBox>
<Rectangle Grid.Row="1" Grid.RowSpan="10" Fill="#ff181d2b"></Rectangle> <Rectangle Grid.Row="1" Grid.RowSpan="10" Fill="#ff181d2b"></Rectangle>
<Grid Grid.Row="1" IsEnabled="{Binding IsUseClip,Mode=OneWay}"> <Border Grid.Row="1" IsEnabled="{Binding IsUseClip,Mode=OneWay}">
<Grid.RowDefinitions> <Grid>
<RowDefinition Height="60"></RowDefinition> <Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions> <RowDefinition Height="60"></RowDefinition>
<RadioButton Content="{Binding Path=StrategyDisplayName,Mode=OneWay}" Grid.Row="0" FontSize="16" Foreground="White" </Grid.RowDefinitions>
Style="{StaticResource RadioButton_NdiView}" IsChecked="{Binding IsAutoModeChecked,Mode=TwoWay}"> <RadioButton Content="{Binding Path=StrategyDisplayName,Mode=OneWay}" Grid.Row="0" FontSize="16" Foreground="White"
</RadioButton> Style="{StaticResource RadioButton_NdiView}" IsChecked="{Binding IsAutoModeChecked,Mode=TwoWay}">
<RadioButton Content="居中" Grid.Row="1" FontSize="16" Foreground="White" </RadioButton>
Style="{StaticResource RadioButton_NdiView}" IsChecked="{Binding IsCenterModeChecked,Mode=TwoWay}"> <RadioButton Content="居中" Grid.Row="1" FontSize="16" Foreground="White"
</RadioButton> Style="{StaticResource RadioButton_NdiView}" IsChecked="{Binding IsCenterModeChecked,Mode=TwoWay}">
<RadioButton Content="手动" Grid.Row="2" FontSize="16" Foreground="White" </RadioButton>
IsEnabled="{Binding Path=IsManualModeEnabled,Mode=OneWay}" <RadioButton Content="手动" Grid.Row="2" FontSize="16" Foreground="White"
IsChecked="{Binding Path=IsManualModeChecked,Mode=TwoWay}" IsEnabled="{Binding Path=IsManualModeEnabled,Mode=OneWay}"
Style="{StaticResource RadioButton_NdiView}"> IsChecked="{Binding Path=IsManualModeChecked,Mode=TwoWay}"
</RadioButton> Style="{StaticResource RadioButton_NdiView}">
</Grid> </RadioButton>
</Grid>
</Border>
</Grid> </Grid>
</Grid> </Grid>
<StackPanel Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,20,0,0" Orientation="Horizontal"> <StackPanel Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,20,0,0" Orientation="Horizontal">
...@@ -200,7 +202,7 @@ ...@@ -200,7 +202,7 @@
</RadioButton>--> </RadioButton>-->
<!-- 近景机位 & 16米机位 & 战术机位 ===== 边线检测选择面板 --> <!-- 近景机位 & 16米机位 & 战术机位 ===== 边线检测选择面板 -->
<!--<Border Grid.Row="1" Background="{x:Null}" <Border Grid.Row="1" Background="{x:Null}"
Visibility="{Binding Path=AlgorithmConfig.IsShowBorder,Mode=OneWay,Converter={StaticResource Bool2VisibilityConverter}}"> Visibility="{Binding Path=AlgorithmConfig.IsShowBorder,Mode=OneWay,Converter={StaticResource Bool2VisibilityConverter}}">
<RadioButton Style="{StaticResource RadioButton_NdiView_None}" <RadioButton Style="{StaticResource RadioButton_NdiView_None}"
Height="{Binding ElementName=uc,Path=DataContext.StrategyType,Converter={StaticResource AlgorithmStrategyType2FootballFieldHeightConverter}}" Height="{Binding ElementName=uc,Path=DataContext.StrategyType,Converter={StaticResource AlgorithmStrategyType2FootballFieldHeightConverter}}"
...@@ -219,7 +221,7 @@ ...@@ -219,7 +221,7 @@
Orientation="{Binding ElementName=uc,Path=DataContext.StrategyType,Converter={StaticResource AlgorithmStrategyType2FootballFieldOrientationConverter}}"> Orientation="{Binding ElementName=uc,Path=DataContext.StrategyType,Converter={StaticResource AlgorithmStrategyType2FootballFieldOrientationConverter}}">
</common:FootballFieldPanel> </common:FootballFieldPanel>
</RadioButton> </RadioButton>
</Border>--> </Border>
<!-- 居中模式 按钮组--> <!-- 居中模式 按钮组-->
<Grid Grid.Row="1" Background="{x:Null}"> <Grid Grid.Row="1" Background="{x:Null}">
......
...@@ -129,8 +129,8 @@ namespace VIZ.H2V.Module ...@@ -129,8 +129,8 @@ namespace VIZ.H2V.Module
// 边线检测插件 // 边线检测插件
SideCheckPolygonPlugin sideCheckPolygonPlugin = new SideCheckPolygonPlugin(view.video); SideCheckPolygonPlugin sideCheckPolygonPlugin = new SideCheckPolygonPlugin(view.video);
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
// 新的边线检测算法不需要校准 // 新的边线检测算法不需要校准 <新算法暂未上线>
//sideCheckPolygonPlugin.Click += SideCheckPolygonPlugin_Click; sideCheckPolygonPlugin.Click += SideCheckPolygonPlugin_Click;
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
view.video.AttachPlugin(sideCheckPolygonPlugin); view.video.AttachPlugin(sideCheckPolygonPlugin);
......
...@@ -114,13 +114,17 @@ namespace VIZ.H2V.Module ...@@ -114,13 +114,17 @@ namespace VIZ.H2V.Module
TrackingBoxInfo info = new TrackingBoxInfo(); TrackingBoxInfo info = new TrackingBoxInfo();
info.SrcRect = rect; info.SrcRect = rect;
info.DrawingBorderWidth = this.TRACKING_BOX_BORDER_WIDTH; info.DrawingBorderWidth = this.DETECT_BOX_BORDER_WIDTH;
info.DrawingBorderColor = this.TRACKING_BOX_BORDER_COLOR; info.DrawingBorderColor = this.DETECT_BOX_BORDER_COLOR;
infos.Add(info); infos.Add(info);
} }
} }
// 更新裁切框信息
this.OnAlgorithmMessage__crop_roi__roi(msg, renderInfo, view);
// 更新视频控件跟踪框信息
view.video.UpdateTrackingBox(infos); view.video.UpdateTrackingBox(infos);
// 更新算法帧率统计 // 更新算法帧率统计
...@@ -157,11 +161,11 @@ namespace VIZ.H2V.Module ...@@ -157,11 +161,11 @@ namespace VIZ.H2V.Module
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// 更新边线检测框 // 更新边线检测框
//this.OnAlgorithmMessage__crop_roi__borderline(msg, renderInfo, view); this.OnAlgorithmMessage__crop_roi__borderline(msg, renderInfo, view);
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// 更新边线检测框(新算法) // 更新边线检测框(新算法)<新算法暂未上线>
this.OnAlgorithmMessage__crop_roi__field_border(msg, renderInfo, view); //this.OnAlgorithmMessage__crop_roi__field_border(msg, renderInfo, view);
// 更新手动校准区域 // 更新手动校准区域
this.OnAlgorithmMessage__crop_roi__correction_area(msg, renderInfo, view); this.OnAlgorithmMessage__crop_roi__correction_area(msg, renderInfo, view);
...@@ -176,7 +180,7 @@ namespace VIZ.H2V.Module ...@@ -176,7 +180,7 @@ namespace VIZ.H2V.Module
/// <param name="msg">裁切消息</param> /// <param name="msg">裁切消息</param>
/// <param name="renderInfo">渲染信息</param> /// <param name="renderInfo">渲染信息</param>
/// <param name="view">视图</param> /// <param name="view">视图</param>
private void OnAlgorithmMessage__crop_roi__roi(AlgorithmMessage__crop_roi msg, VideoRenderInfo renderInfo, NDIView view) private void OnAlgorithmMessage__crop_roi__roi(IAlgorithmMessage__roi msg, VideoRenderInfo renderInfo, NDIView view)
{ {
// 裁切框在手动模式或居中模式下由客户端控制,不需要处理算法给的裁切框 // 裁切框在手动模式或居中模式下由客户端控制,不需要处理算法给的裁切框
if (msg.roi == null || this.StrategyMode == AlgorithmStrategyMode.manual_mode || this.StrategyMode == AlgorithmStrategyMode.center_mode) if (msg.roi == null || this.StrategyMode == AlgorithmStrategyMode.manual_mode || this.StrategyMode == AlgorithmStrategyMode.center_mode)
......
...@@ -64,6 +64,16 @@ namespace VIZ.H2V.Module ...@@ -64,6 +64,16 @@ namespace VIZ.H2V.Module
private readonly int TRACKING_BOX_BORDER_WIDTH = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_TRACKING_BOX_BORDER_WIDTH); private readonly int TRACKING_BOX_BORDER_WIDTH = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_TRACKING_BOX_BORDER_WIDTH);
/// <summary> /// <summary>
/// 检测框边框颜色(格式:#AARRGGBB)
/// </summary>
private readonly RawColor4 DETECT_BOX_BORDER_COLOR = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, RawColor4>(p => p.VIDEO_DETECT_BOX_BORDER_COLOR);
/// <summary>
/// 检测边框宽度(单位:像素)
/// </summary>
private readonly int DETECT_BOX_BORDER_WIDTH = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_DETECT_BOX_BORDER_WIDTH);
/// <summary>
/// 视频边线检测多边形区域透明度 /// 视频边线检测多边形区域透明度
/// </summary> /// </summary>
private readonly double VIDEO_SIDE_CHECK_POLYGON_OPACITY = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, double>(p => p.VIDEO_SIDE_CHECK_POLYGON_OPACITY); private readonly double VIDEO_SIDE_CHECK_POLYGON_OPACITY = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, double>(p => p.VIDEO_SIDE_CHECK_POLYGON_OPACITY);
......
...@@ -137,6 +137,9 @@ namespace VIZ.H2V.Module ...@@ -137,6 +137,9 @@ namespace VIZ.H2V.Module
// 停止3D鼠标更新 // 停止3D鼠标更新
this.ManualController.ClipBoxSmooth.IsEnabled = false; this.ManualController.ClipBoxSmooth.IsEnabled = false;
// 重置自动移动状态
this.ManualController.ResetAutoMoving();
// 如果之前的模式为居中模式,那么记录居中模式的裁切框位置 // 如果之前的模式为居中模式,那么记录居中模式的裁切框位置
if (this.StrategyMode == AlgorithmStrategyMode.center_mode) if (this.StrategyMode == AlgorithmStrategyMode.center_mode)
{ {
......
...@@ -24,6 +24,10 @@ VIDEO_RECTANGLE_BORDER_COLOR=#FFFF0000 ...@@ -24,6 +24,10 @@ VIDEO_RECTANGLE_BORDER_COLOR=#FFFF0000
VIDEO_TRACKING_BOX_BORDER_WIDTH=2 VIDEO_TRACKING_BOX_BORDER_WIDTH=2
;视频跟踪框边框颜色 ;视频跟踪框边框颜色
VIDEO_TRACKING_BOX_BORDER_COLOR=#FFFF0000 VIDEO_TRACKING_BOX_BORDER_COLOR=#FFFF0000
;检测边框宽度(单位:像素)
VIDEO_DETECT_BOX_BORDER_WIDTH=2
;检测框边框颜色(格式:#AARRGGBB)
VIDEO_DETECT_BOX_BORDER_COLOR=#FFFF7373
;视频框选边框宽度(单位:像素) ;视频框选边框宽度(单位:像素)
VIDEO_FRAME_SELECTION_BORDER_WIDTH=4 VIDEO_FRAME_SELECTION_BORDER_WIDTH=4
;视频框选边框颜色(格式:#AARRGGBB) ;视频框选边框颜色(格式:#AARRGGBB)
......
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