版本260406
This commit is contained in:
201
OrpaonVision.SiteApp/OptimizedMainWindow.xaml
Normal file
201
OrpaonVision.SiteApp/OptimizedMainWindow.xaml
Normal file
@@ -0,0 +1,201 @@
|
||||
<Window x:Class="OrpaonVision.SiteApp.OptimizedMainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:OrpaonVision.SiteApp"
|
||||
xmlns:controls="clr-namespace:OrpaonVision.SiteApp.Controls"
|
||||
mc:Ignorable="d"
|
||||
Title="OrpaonVision 运行端 - 实时图像检测" Height="800" Width="1200" MinHeight="600" MinWidth="800">
|
||||
<Grid Margin="16">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,12">
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Text="运行端 - 实时图像检测" VerticalAlignment="Center" />
|
||||
<TextBlock Margin="20,0,0,0" FontSize="12" Foreground="#666666" Text="优化版 - 支持实时图像显示和检测框可视化" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 控制面板 -->
|
||||
<Border Grid.Row="1" BorderBrush="#DDDDDD" BorderThickness="1" CornerRadius="6" Padding="12" Margin="0,0,0,12">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 基本控制 -->
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<Button Width="100" Height="32" Margin="0,0,8,0" Content="执行一轮检测" Click="OnRunOneCycleClicked" />
|
||||
<Button Width="100" Height="32" Margin="0,0,8,0" Content="切换下一层" Click="OnMoveNextLayerClicked" />
|
||||
<Button Width="80" Height="32" Content="重置状态" Click="OnResetRuntimeClicked" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 自动运行控制 -->
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<Button Width="120" Height="32" Margin="0,0,8,0" Content="{Binding IsAutoRunning, Converter={StaticResource BoolToAutoRunTextConverter}}"
|
||||
Click="OnToggleAutoRunClicked" Background="{Binding IsAutoRunning, Converter={StaticResource BoolToAutoRunColorConverter}}" />
|
||||
<TextBlock Text="帧率:" VerticalAlignment="Center" Margin="0,0,4,0" />
|
||||
<ComboBox Width="80" Height="32" SelectedValue="{Binding FrameRate}">
|
||||
<ComboBoxItem Content="1" Tag="1" />
|
||||
<ComboBoxItem Content="5" Tag="5" />
|
||||
<ComboBoxItem Content="10" Tag="10" />
|
||||
<ComboBoxItem Content="20" Tag="20" />
|
||||
<ComboBoxItem Content="30" Tag="30" />
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 显示控制 -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<CheckBox Content="显示检测框" IsChecked="{Binding ShowDetectionBoxes}" Margin="0,0,12,0" VerticalAlignment="Center" />
|
||||
<ComboBox Width="100" Height="32" SelectedValue="{Binding DisplayMode}" Margin="0,0,8,0">
|
||||
<ComboBoxItem Content="适应" Tag="Fit" />
|
||||
<ComboBoxItem Content="填充" Tag="Fill" />
|
||||
<ComboBoxItem Content="原始" Tag="Original" />
|
||||
</ComboBox>
|
||||
<Button Width="80" Height="32" Content="保存图像" Click="OnSaveImageClicked" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 主显示区域 -->
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 图像显示区域 -->
|
||||
<Border Grid.Column="0" BorderBrush="#DDDDDD" BorderThickness="1" CornerRadius="6" Padding="8" Margin="0,0,8,0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" FontSize="14" FontWeight="SemiBold" Text="实时图像显示" Margin="0,0,0,8" />
|
||||
|
||||
<controls:RealTimeImageDisplay Grid.Row="1"
|
||||
ImageSource="{Binding CurrentImage}"
|
||||
DisplayMode="{Binding DisplayMode}"
|
||||
ShowDetectionBoxes="{Binding ShowDetectionBoxes}"
|
||||
DetectionResults="{Binding DetectionBoxes}" />
|
||||
|
||||
<!-- 图像信息 -->
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<TextBlock Text="帧率: " FontSize="12" />
|
||||
<TextBlock Text="{Binding ActualFrameRate, StringFormat={}{0:F1} FPS}" FontSize="12" FontWeight="Bold" Foreground="Blue" />
|
||||
<TextBlock Text=" | 总帧数: " FontSize="12" Margin="12,0,0,0" />
|
||||
<TextBlock Text="{Binding TotalFrames}" FontSize="12" FontWeight="Bold" />
|
||||
<TextBlock Text=" | 成功: " FontSize="12" Margin="12,0,0,0" />
|
||||
<TextBlock Text="{Binding SuccessFrames}" FontSize="12" FontWeight="Bold" Foreground="Green" />
|
||||
<TextBlock Text=" | 失败: " FontSize="12" Margin="12,0,0,0" />
|
||||
<TextBlock Text="{Binding FailedFrames}" FontSize="12" FontWeight="Bold" Foreground="Red" />
|
||||
<TextBlock Text=" | 成功率: " FontSize="12" Margin="12,0,0,0" />
|
||||
<TextBlock Text="{Binding SuccessRate, StringFormat={}{0:F1}%}" FontSize="12" FontWeight="Bold" Foreground="DarkGreen" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 状态和信息区域 -->
|
||||
<StackPanel Grid.Column="1">
|
||||
<!-- 运行状态 -->
|
||||
<Border BorderBrush="#DDDDDD" BorderThickness="1" CornerRadius="6" Padding="12" Margin="0,0,0,8">
|
||||
<StackPanel>
|
||||
<TextBlock FontSize="14" FontWeight="SemiBold" Text="运行状态" Margin="0,0,0,8" />
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="当前层:" Margin="0,0,8,4" />
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding LayerText}" Margin="0,0,0,4" />
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="推理结果:" Margin="0,0,8,4" />
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding InferenceText}" Margin="0,0,0,4" />
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="规则判定:" Margin="0,0,8,4" />
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding DecisionText}" TextWrapping="Wrap" Margin="0,0,0,4" />
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="运行状态:" Margin="0,0,8,0" />
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding StatusText}" TextWrapping="Wrap"
|
||||
Foreground="{Binding StatusBrush}" Margin="0,0,0,0" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 检测结果 -->
|
||||
<Border BorderBrush="#DDDDDD" BorderThickness="1" CornerRadius="6" Padding="12" Margin="0,0,0,8">
|
||||
<StackPanel>
|
||||
<TextBlock FontSize="14" FontWeight="SemiBold" Text="检测结果" Margin="0,0,0,8" />
|
||||
|
||||
<ScrollViewer Height="150" VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl ItemsSource="{Binding DetectionBoxes}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="#EEEEEE" BorderThickness="1" CornerRadius="4" Padding="8" Margin="0,0,0,4">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding ClassName}" FontWeight="Bold" FontSize="12" />
|
||||
<TextBlock Text="{Binding Confidence, StringFormat={}{0:P0}}" FontSize="10" Foreground="#666666" />
|
||||
<TextBlock Text="{Binding Label, StringFormat={}{0}}" FontSize="10" Foreground="#666666" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 图像滤镜 -->
|
||||
<Border BorderBrush="#DDDDDD" BorderThickness="1" CornerRadius="6" Padding="12">
|
||||
<StackPanel>
|
||||
<TextBlock FontSize="14" FontWeight="SemiBold" Text="图像滤镜" Margin="0,0,0,8" />
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Width="60" Height="28" Margin="0,0,4,4" Content="原图" Click="OnFilterNoneClicked" />
|
||||
<Button Width="60" Height="28" Margin="0,0,4,4" Content="灰度" Click="OnFilterGrayscaleClicked" />
|
||||
<Button Width="60" Height="28" Margin="0,0,4,4" Content="二值化" Click="OnFilterBinaryClicked" />
|
||||
<Button Width="60" Height="28" Margin="0,0,4,4" Content="边缘" Click="OnFilterEdgeClicked" />
|
||||
<Button Width="60" Height="28" Margin="0,0,0,4" Content="模糊" Click="OnFilterBlurClicked" />
|
||||
<Button Width="60" Height="28" Margin="0,0,0,0" Content="锐化" Click="OnFilterSharpenClicked" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- 状态栏 -->
|
||||
<StatusBar Grid.Row="3" Margin="0,12,0,0">
|
||||
<StatusBarItem>
|
||||
<TextBlock Text="OrpaonVision 运行端 v1.0 - 实时图像检测系统" />
|
||||
</StatusBarItem>
|
||||
<StatusBarItem HorizontalAlignment="Right">
|
||||
<TextBlock Text="{Binding StatusText}" Foreground="{Binding StatusBrush}" />
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
|
||||
<Window.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||
|
||||
<!-- 值转换器(需要实现) -->
|
||||
<local:BoolToAutoRunTextConverter x:Key="BoolToAutoRunTextConverter" />
|
||||
<local:BoolToAutoRunColorConverter x:Key="BoolToAutoRunColorConverter" />
|
||||
</Window.Resources>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user