Commit 91b2a119 by liulongfei

1. 居中模式鼠标移动

2. 目标选择框颜色调整
parent f55bde89
......@@ -32,6 +32,7 @@ namespace VIZ.H2V.Connection
AlgorithmMessage__detect message = new AlgorithmMessage__detect();
message.AlgorithmID = package.id;
message.timecode = package.timecode;
if (package.bboxes != null && package.bboxes.Count > 0)
{
foreach (List<int> src in package.bboxes)
......@@ -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);
}
}
......
......@@ -18,6 +18,16 @@ namespace VIZ.H2V.Connection
public override string signal { get; set; } = AlgorithmPackageSignal.detect;
/// <summary>
/// 裁切坐标(左上角x,y,右下角x,y)
/// </summary>
public List<int> roi { get; set; }
/// <summary>
/// 时间码
/// </summary>
public long timecode { get; set; }
/// <summary>
/// 检测数据框(左上角x,y,右下角x,y)
/// </summary>
public List<List<int>> bboxes { get; set; }
......
......@@ -11,7 +11,7 @@ namespace VIZ.H2V.Domain
/// <summary>
/// 算法消息 -- 裁切
/// </summary>
public class AlgorithmMessage__crop_roi : AlgorithmMessageBase
public class AlgorithmMessage__crop_roi : AlgorithmMessageBase, IAlgorithmMessage__roi
{
/// <summary>
/// 裁切坐标
......
......@@ -10,11 +10,21 @@ namespace VIZ.H2V.Domain
/// <summary>
/// 算法消息 -- 检测
/// </summary>
public class AlgorithmMessage__detect : AlgorithmMessageBase
public class AlgorithmMessage__detect : AlgorithmMessageBase, IAlgorithmMessage__roi
{
/// <summary>
/// 裁剪框
/// </summary>
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 @@
<Compile Include="Enum\ServiceKeys.cs" />
<Compile Include="Info\AlgorithmInfo_borderpoint.cs" />
<Compile Include="Info\AlgorithmInfo_borderline.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessageBase.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessage__detect.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessage__crop_roi.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessage__checked_ok.cs" />
<Compile Include="Message\Algorithm\Implementation\AlgorithmMessageBase.cs" />
<Compile Include="Message\Algorithm\Implementation\AlgorithmMessage__detect.cs" />
<Compile Include="Message\Algorithm\Implementation\AlgorithmMessage__crop_roi.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="Model\Algorithm\AlgorithmProcessModel.cs" />
<Compile Include="Model\Algorithm\AlgorithmBorderScenceModel.cs" />
......
......@@ -54,5 +54,10 @@ namespace VIZ.H2V.Module
/// </summary>
/// <param name="clipX">剪切X值</param>
void Reset(double clipX);
/// <summary>
/// 重置自动移动
/// </summary>
void ResetAutoMoving();
}
}
......@@ -185,6 +185,15 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 重置自动移动
/// </summary>
public void ResetAutoMoving()
{
this.IsClipBoxAutoMoving = false;
this.ClipBoxAutoMovingFrame = 0;
}
/// <summary>
/// 获取居中模式计算值
/// </summary>
/// <param name="min">最小值</param>
......
......@@ -129,24 +129,26 @@
IsChecked="{Binding Path=IsUseClip,Mode=TwoWay}"
Style="{StaticResource CheckBox_NdiView}"></CheckBox>
<Rectangle Grid.Row="1" Grid.RowSpan="10" Fill="#ff181d2b"></Rectangle>
<Grid Grid.Row="1" IsEnabled="{Binding IsUseClip,Mode=OneWay}">
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions>
<RadioButton Content="{Binding Path=StrategyDisplayName,Mode=OneWay}" Grid.Row="0" FontSize="16" Foreground="White"
Style="{StaticResource RadioButton_NdiView}" IsChecked="{Binding IsAutoModeChecked,Mode=TwoWay}">
</RadioButton>
<RadioButton Content="居中" Grid.Row="1" FontSize="16" Foreground="White"
Style="{StaticResource RadioButton_NdiView}" IsChecked="{Binding IsCenterModeChecked,Mode=TwoWay}">
</RadioButton>
<RadioButton Content="手动" Grid.Row="2" FontSize="16" Foreground="White"
IsEnabled="{Binding Path=IsManualModeEnabled,Mode=OneWay}"
IsChecked="{Binding Path=IsManualModeChecked,Mode=TwoWay}"
Style="{StaticResource RadioButton_NdiView}">
</RadioButton>
</Grid>
<Border Grid.Row="1" IsEnabled="{Binding IsUseClip,Mode=OneWay}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions>
<RadioButton Content="{Binding Path=StrategyDisplayName,Mode=OneWay}" Grid.Row="0" FontSize="16" Foreground="White"
Style="{StaticResource RadioButton_NdiView}" IsChecked="{Binding IsAutoModeChecked,Mode=TwoWay}">
</RadioButton>
<RadioButton Content="居中" Grid.Row="1" FontSize="16" Foreground="White"
Style="{StaticResource RadioButton_NdiView}" IsChecked="{Binding IsCenterModeChecked,Mode=TwoWay}">
</RadioButton>
<RadioButton Content="手动" Grid.Row="2" FontSize="16" Foreground="White"
IsEnabled="{Binding Path=IsManualModeEnabled,Mode=OneWay}"
IsChecked="{Binding Path=IsManualModeChecked,Mode=TwoWay}"
Style="{StaticResource RadioButton_NdiView}">
</RadioButton>
</Grid>
</Border>
</Grid>
</Grid>
<StackPanel Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,20,0,0" Orientation="Horizontal">
......@@ -200,7 +202,7 @@
</RadioButton>-->
<!-- 近景机位 & 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}}">
<RadioButton Style="{StaticResource RadioButton_NdiView_None}"
Height="{Binding ElementName=uc,Path=DataContext.StrategyType,Converter={StaticResource AlgorithmStrategyType2FootballFieldHeightConverter}}"
......@@ -219,7 +221,7 @@
Orientation="{Binding ElementName=uc,Path=DataContext.StrategyType,Converter={StaticResource AlgorithmStrategyType2FootballFieldOrientationConverter}}">
</common:FootballFieldPanel>
</RadioButton>
</Border>-->
</Border>
<!-- 居中模式 按钮组-->
<Grid Grid.Row="1" Background="{x:Null}">
......
......@@ -129,8 +129,8 @@ namespace VIZ.H2V.Module
// 边线检测插件
SideCheckPolygonPlugin sideCheckPolygonPlugin = new SideCheckPolygonPlugin(view.video);
// -----------------------------------------------------------------------------------------
// 新的边线检测算法不需要校准
//sideCheckPolygonPlugin.Click += SideCheckPolygonPlugin_Click;
// 新的边线检测算法不需要校准 <新算法暂未上线>
sideCheckPolygonPlugin.Click += SideCheckPolygonPlugin_Click;
// -----------------------------------------------------------------------------------------
view.video.AttachPlugin(sideCheckPolygonPlugin);
......
......@@ -114,13 +114,17 @@ namespace VIZ.H2V.Module
TrackingBoxInfo info = new TrackingBoxInfo();
info.SrcRect = rect;
info.DrawingBorderWidth = this.TRACKING_BOX_BORDER_WIDTH;
info.DrawingBorderColor = this.TRACKING_BOX_BORDER_COLOR;
info.DrawingBorderWidth = this.DETECT_BOX_BORDER_WIDTH;
info.DrawingBorderColor = this.DETECT_BOX_BORDER_COLOR;
infos.Add(info);
}
}
// 更新裁切框信息
this.OnAlgorithmMessage__crop_roi__roi(msg, renderInfo, view);
// 更新视频控件跟踪框信息
view.video.UpdateTrackingBox(infos);
// 更新算法帧率统计
......@@ -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);
......@@ -176,7 +180,7 @@ namespace VIZ.H2V.Module
/// <param name="msg">裁切消息</param>
/// <param name="renderInfo">渲染信息</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)
......
......@@ -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);
/// <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>
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
// 停止3D鼠标更新
this.ManualController.ClipBoxSmooth.IsEnabled = false;
// 重置自动移动状态
this.ManualController.ResetAutoMoving();
// 如果之前的模式为居中模式,那么记录居中模式的裁切框位置
if (this.StrategyMode == AlgorithmStrategyMode.center_mode)
{
......
......@@ -24,6 +24,10 @@ VIDEO_RECTANGLE_BORDER_COLOR=#FFFF0000
VIDEO_TRACKING_BOX_BORDER_WIDTH=2
;视频跟踪框边框颜色
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
;视频框选边框颜色(格式:#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