164 lines
9.4 KiB
XML
164 lines
9.4 KiB
XML
<UserControl x:Class="PLCSharp.VVMs.Vision.VisionFlowHandler.Algorithm.GalleryClassifier"
|
|
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:vision="clr-namespace:PLCSharp.VVMs.Vision"
|
|
mc:Ignorable="d"
|
|
d:DataContext="{d:DesignInstance Type=vision:VisionConfigViewModel}"
|
|
d:DesignHeight="500" d:DesignWidth="300">
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
<StackPanel>
|
|
<!-- ========== ROI 区域(选区用于分类,不影响原图) ========== -->
|
|
<GroupBox Header="ROI 区域(选区用于分类,不影响原图)">
|
|
<StackPanel>
|
|
<Button Height="25" Margin="5" Command="{Binding DrawGalleryRoiCommand}" Content="画选区" />
|
|
<Grid Margin="5">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Margin="5,0" Text="Left" VerticalAlignment="Center" />
|
|
<TextBox Grid.Column="1" Text="{Binding SelectVisionFlow.DoubleParams[GalleryRoiLeft], Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
|
|
<TextBlock Grid.Column="2" Margin="5,0" Text="Top" VerticalAlignment="Center" />
|
|
<TextBox Grid.Column="3" Text="{Binding SelectVisionFlow.DoubleParams[GalleryRoiTop], Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
|
|
<TextBlock Grid.Row="1" Margin="5,0" Text="宽度" VerticalAlignment="Center" />
|
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding SelectVisionFlow.DoubleParams[GalleryRoiWidth], Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
|
|
<TextBlock Grid.Row="1" Grid.Column="2"
|
|
Margin="5,0"
|
|
Text="高度"
|
|
VerticalAlignment="Center" />
|
|
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding SelectVisionFlow.DoubleParams[GalleryRoiHeight], Mode=TwoWay, UpdateSourceTrigger=LostFocus}" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- ========== 训练操作 ========== -->
|
|
<GroupBox Header="训练">
|
|
<StackPanel>
|
|
<Grid Margin="5">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Button Grid.Row="0" Grid.Column="0"
|
|
Height="32" Margin="0,0,3,3"
|
|
Content="训练为 OK"
|
|
Command="{Binding TrainGalleryOkCommand}"
|
|
Background="LimeGreen" Foreground="White" />
|
|
<Button Grid.Row="0" Grid.Column="1"
|
|
Height="32" Margin="3,0,0,3"
|
|
Content="训练为 NG"
|
|
Command="{Binding TrainGalleryNgCommand}"
|
|
Background="Red" Foreground="White" />
|
|
<Button Grid.Row="1" Grid.Column="0"
|
|
Height="28" Margin="0,0,3,3"
|
|
FontSize="11"
|
|
Content="纠正为 OK"
|
|
Command="{Binding CorrectGalleryToOkCommand}" />
|
|
<Button Grid.Row="1" Grid.Column="1"
|
|
Height="28" Margin="3,0,0,3"
|
|
FontSize="11"
|
|
Content="纠正为 NG"
|
|
Command="{Binding CorrectGalleryToNgCommand}" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- ========== 画廊状态 ========== -->
|
|
<GroupBox Header="画廊状态">
|
|
<StackPanel>
|
|
<Grid Margin="5">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="80" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="OK 库" VerticalAlignment="Center" />
|
|
<TextBox Grid.Column="1" Text="{Binding GalleryOkCount, Mode=OneWay}" IsReadOnly="True" Background="#FFF0F0F0" />
|
|
<TextBlock Grid.Row="1" Text="NG 库" VerticalAlignment="Center" />
|
|
<TextBox Grid.Row="1" Grid.Column="1"
|
|
Text="{Binding GalleryNgCount, Mode=OneWay}"
|
|
IsReadOnly="True" Background="#FFF0F0F0" />
|
|
<TextBlock Grid.Row="2" Text="状态" VerticalAlignment="Center" />
|
|
<TextBox Grid.Row="2" Grid.Column="1"
|
|
Text="{Binding GalleryStatus, Mode=OneWay}"
|
|
IsReadOnly="True" Background="#FFF0F0F0" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<!-- ========== 结果 ========== -->
|
|
<GroupBox Header="分类结果">
|
|
<Grid Margin="5">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.ColumnSpan="2" Text="— 最近一次推理 —" FontWeight="Bold" HorizontalAlignment="Center" />
|
|
<TextBlock Grid.Row="1" Margin="5,0" Text="结果" VerticalAlignment="Center" />
|
|
<TextBox Grid.Row="1" Grid.Column="1"
|
|
Text="{Binding SelectedVisionFunction.ResultString, Mode=OneWay}"
|
|
IsReadOnly="True" Background="#FFF0F0F0" />
|
|
<TextBlock Grid.Row="2" Margin="5,0" Text="OK 距离" VerticalAlignment="Center" />
|
|
<TextBox Grid.Row="2" Grid.Column="1"
|
|
Text="{Binding SelectedVisionFunction.Params.ResultDoubles[Gallery_OKDist], Mode=OneWay}"
|
|
IsReadOnly="True" Background="#FFF0F0F0" />
|
|
<TextBlock Grid.Row="3" Margin="5,0" Text="NG 距离" VerticalAlignment="Center" />
|
|
<TextBox Grid.Row="3" Grid.Column="1"
|
|
Text="{Binding SelectedVisionFunction.Params.ResultDoubles[Gallery_NGDist], Mode=OneWay}"
|
|
IsReadOnly="True" Background="#FFF0F0F0" />
|
|
<TextBlock Grid.Row="4" Margin="5,0" Text="置信度" VerticalAlignment="Center" />
|
|
<TextBox Grid.Row="4" Grid.Column="1"
|
|
Text="{Binding SelectedVisionFunction.Params.ResultDoubles[Gallery_Confidence], Mode=OneWay}"
|
|
IsReadOnly="True" Background="#FFF0F0F0" />
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<!-- ========== 文件 ========== -->
|
|
<GroupBox Header="文件">
|
|
<Grid Margin="5">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Button Height="28" Margin="0,0,3,3" Content="导出" Command="{Binding ExportGalleryCommand}" />
|
|
<Button Grid.Column="1"
|
|
Height="28" Margin="3,0,0,3"
|
|
Content="导入"
|
|
Command="{Binding ImportGalleryCommand}" />
|
|
<TextBlock Grid.Row="1"
|
|
Grid.ColumnSpan="2"
|
|
Margin="0,3,0,0"
|
|
Text="{Binding GalleryFileStatus, Mode=OneWay}"
|
|
FontSize="12" />
|
|
</Grid>
|
|
</GroupBox>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</UserControl> |