Commit b9d8a1f5 by 鲁志-悦动

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

parent ffce85a8
......@@ -42,6 +42,17 @@ namespace VIZ.FGOUT.Connection
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;
}
else if (package.signal == "track")
......
......@@ -38,6 +38,8 @@ namespace VIZ.FGOUT.Connection
/// </summary>
public List<List<int>> bboxes { get; set; }
public List<List<int>> ignore_bboxes { get; set; }
/// <summary>
/// 跟踪框的定义
/// </summary>
......
......@@ -58,6 +58,20 @@ namespace VIZ.FGOUT.Connection
/// </summary>
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;
}
}
......@@ -13,6 +13,8 @@ namespace VIZ.FGOUT.Domain
/// </summary>
public List<RawRectangleF> bboxes { get; set; } = new List<RawRectangleF>();
public List<RawRectangleF> ignore_bboxes { get; set; } = new List<RawRectangleF>();
/// <summary>
/// 裁切坐标
/// </summary>
......
......@@ -570,7 +570,7 @@
IsEnabled="{Binding SendEnable}"
Style="{StaticResource ButtonStyle}" />
<Button
<!--<Button
Grid.Row="1"
Grid.Column="5"
Width="100"
......@@ -579,11 +579,11 @@
Command="{Binding Path=SavePalceCommand}"
Content="保存位置"
IsEnabled="{Binding SaveEnable}"
Style="{StaticResource ButtonStyle}" />
Style="{StaticResource ButtonStyle}" />-->
<Button
Grid.Row="1"
Grid.Column="6"
Grid.Column="5"
Width="100"
Height="40"
Margin="10"
......
......@@ -301,6 +301,38 @@
</b:Interaction.Behaviors>
</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
Grid.Row="4"
Grid.Column="5"
......
......@@ -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;
/// <summary>
/// 是否是大模型
......@@ -598,6 +626,8 @@ namespace VIZ.FGOUT.Module
Pad_det_y = Pad_det_y,
Pad_det_square = Pad_det_square,
Scale = AScale,
Bbox_min_h = Bbox_min_h,
Bbox_min_w = Bbox_min_w,
Is_Big_Model = IsBigModel
};
......@@ -735,6 +765,8 @@ namespace VIZ.FGOUT.Module
Pad_det_y = alPackage.Pad_det_y;
Pad_det_square = alPackage.Pad_det_square;
AScale = alPackage.Scale;
Bbox_min_h = alPackage.Bbox_min_h;
Bbox_min_w = alPackage.Bbox_min_w;
IsBigModel = alPackage.Is_Big_Model;
}
......
......@@ -26,12 +26,12 @@ namespace VIZ.FGOUT.Module
//public Rect rectStart;
public List<PointCollection> polygonsStart = new List<PointCollection>();
public List<PointCollection> polygonsEnd = new List<PointCollection>();
// public List<PointCollection> polygonsInvalid= new List<PointCollection>();
public List<PointCollection> _polygonsMark;
public List<PointCollection> polygonsInvalid = new List<PointCollection>();
//public List<PointCollection> _polygonsMark;
// public Rect rectEnd;
public Rect rectInvalid;
// public Rectangle rectInvalid;
public List<Rect> rectsInvalid = new List<Rect>();
//public List<Rect> rectsInvalid = new List<Rect>();
public Rect rectReplay;
// public Rectangle rectInvalid;
......@@ -282,23 +282,23 @@ namespace VIZ.FGOUT.Module
#endregion
if (vm.IsDrawInvalidPlace)
{
aa = new PathGeometry();
if (!rectsInvalid.Contains(rectInvalid))
{
aa.AddGeometry(new RectangleGeometry(rectInvalid));
rectsInvalid.Add(rectInvalid);
var myPath = new Path()
{
Fill = Brushes.Transparent,
Stroke = Brushes.Red,
StrokeThickness = 1,
Data = aa
};
canvas1.Children.Add(myPath);
}
}
//if (vm.IsDrawInvalidPlace)
//{
// aa = new PathGeometry();
// if (!rectsInvalid.Contains(rectInvalid))
// {
// aa.AddGeometry(new RectangleGeometry(rectInvalid));
// rectsInvalid.Add(rectInvalid);
// var myPath = new Path()
// {
// Fill = Brushes.Transparent,
// Stroke = Brushes.Red,
// StrokeThickness = 1,
// Data = aa
// };
// canvas1.Children.Add(myPath);
// }
//}
if (vm.IsReplay)
{
......@@ -392,10 +392,11 @@ namespace VIZ.FGOUT.Module
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);
//else if(vm.IsMark)
// DrawDot(e.GetPosition(this.canvas1), Brushes.Red);
//else if (vm.IsDrawInvalidPlace)
// DrawPolygon(e.GetPosition(this.canvas1), Brushes.Red);
//else if (vm.IsManualDetect)
//{
......@@ -435,10 +436,10 @@ namespace VIZ.FGOUT.Module
// rectInvalid = new Rect(startPoint, e.GetPosition(this.canvas1));
//}
if (vm.IsDrawInvalidPlace)
{
rectInvalid = new Rect(startPoint, e.GetPosition(this.canvas1));
}
//if (vm.IsDrawInvalidPlace)
//{
// rectInvalid = new Rect(startPoint, e.GetPosition(this.canvas1));
//}
if (vm.IsReplay)
{
......@@ -538,11 +539,11 @@ namespace VIZ.FGOUT.Module
polygonsEnd.RemoveAt(0);
}
}
//else if (vm.IsDrawInvalidPlace)
//{
// if(!polygonsInvalid.Contains(points))
// polygonsInvalid.Add(points);
//}
else if (vm.IsDrawInvalidPlace)
{
if (!polygonsInvalid.Contains(points))
polygonsInvalid.Add(points);
}
polygon = null;
}
}
......
......@@ -124,16 +124,21 @@ namespace VIZ.FGOUT.Module
//if (renderInfo == null)
// 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>();
if (msg.bboxes != null)
{
foreach (RawRectangleF item in msg.bboxes)
{
// 视频的宽度
int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH);
// 视频的高度
int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
//// 视频的宽度
//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, renderInfo.Frame.Width, renderInfo.Frame.Height);
RawRectangleF rect = RawRectangleFExpand.ClipInVideoFrame(item, 0, 0, resWith, resHeight);
......@@ -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);
......
......@@ -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);
/// <summary>
/// 忽略框边框颜色(格式:#AARRGGBB)
/// </summary>
private readonly RawColor4 IGNORE_BOX_BORDER_COLOR = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, RawColor4>(p => p.VIDEO_IGNORE_BOX_BORDER_COLOR);
/// <summary>
/// 检测框边框颜色 透明
/// </summary>
private readonly RawColor4 DETECT_BOX_BORDER_COLOR_TRANSPARENT = SharpDxColorHelper.FromString("#00000000");
......
#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>
// 此代码由工具生成。
......
#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>
// 此代码由工具生成。
......
#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>
// 此代码由工具生成。
......
#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>
// 此代码由工具生成。
......

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\NDIPreviewView\View\NDIPreviewView.xaml;;
......
......@@ -30,7 +30,7 @@ namespace VIZ.FGOUT.Storage
/// <summary>
/// 无效位置
/// </summary>
//public List<PointCollection> InvlidPlace { get; set; } = new List<PointCollection>();
public List<Rect> InvlidPlace { get; set; } = new List<Rect>();
public List<PointCollection> InvlidPlace { get; set; } = new List<PointCollection>();
//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
VIDEO_DETECT_BOX_BORDER_WIDTH=2
;检测框边框颜色(格式:#AARRGGBB)
VIDEO_DETECT_BOX_BORDER_COLOR=#FFFF7373
;忽略框边框颜色(格式:#AARRGGBB)
VIDEO_IGNORE_BOX_BORDER_COLOR=#FF808080
;视频框选边框宽度(单位:像素)
VIDEO_FRAME_SELECTION_BORDER_WIDTH=4
;视频框选边框颜色(格式:#AARRGGBB)
......
......@@ -28,6 +28,8 @@ VIDEO_TRACKING_BOX_BORDER_COLOR=#FFFF0000
VIDEO_DETECT_BOX_BORDER_WIDTH=2
;检测框边框颜色(格式:#AARRGGBB)
VIDEO_DETECT_BOX_BORDER_COLOR=#FFFF7373
;忽略框边框颜色(格式:#AARRGGBB)
VIDEO_IGNORE_BOX_BORDER_COLOR=#FF808080
;视频框选边框宽度(单位:像素)
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