136 lines
8.1 KiB
XML
136 lines
8.1 KiB
XML
<UserControl x:Class="Views.Vision.V_OCR"
|
|
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:local="clr-namespace:Views.Vision"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:model="clr-namespace:Model.Vision;assembly=Model"
|
|
xmlns:myconver="clr-namespace:Community;assembly=Community"
|
|
d:DesignHeight="300" d:DesignWidth="500" mc:Ignorable="d">
|
|
<GroupBox Name="GB" Header="{Binding SelectVEI.VEIname}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Border>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Button Grid.Row="1" Grid.ColumnSpan="4" Margin="0,2"
|
|
Background="{Binding BorderBrush, ElementName=TAB1}"
|
|
Command="{Binding GetImageCommand}"
|
|
Content="相机采集" FontSize="20"
|
|
Style="{DynamicResource commBtn}" />
|
|
<TextBox Grid.ColumnSpan="3" VerticalContentAlignment="Center" Background="Transparent" Foreground="White" IsReadOnly="True" Text="{Binding ImgPath}" />
|
|
<Button Grid.Column="4" Grid.ColumnSpan="2" Margin="1,3"
|
|
Background="{Binding BorderBrush, ElementName=TAB1}"
|
|
Command="{Binding LoadingImageCommand}"
|
|
Content="加载图片"
|
|
Style="{DynamicResource commBtn}" />
|
|
|
|
<CheckBox Grid.Row="2" Grid.ColumnSpan="4"
|
|
HorizontalAlignment="Center"
|
|
BorderBrush="{Binding BorderBrush, ElementName=GB}"
|
|
Content="使用本地图像" Foreground="White"
|
|
IsChecked="{Binding EnableLocalImage}"
|
|
Style="{StaticResource CheckBoxStyle1}" />
|
|
<!--<RadioButton Grid.Row="3" Grid.ColumnSpan="2" Content="绘制圆形ROI" IsChecked="{Binding DrawCircles}" Background="Transparent" Foreground="White"/>
|
|
<RadioButton Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" Content="绘制矩形ROI" IsChecked="True" Background="Transparent" Foreground="White"/>-->
|
|
<RadioButton Grid.Row="3" Background="Transparent"
|
|
Command="{Binding RoiShapeSelectCommand}"
|
|
CommandParameter="R1" Content="矩形" Foreground="White"
|
|
GroupName="A" />
|
|
<RadioButton Grid.Row="3" Grid.Column="1" Background="Transparent"
|
|
Command="{Binding RoiShapeSelectCommand}"
|
|
CommandParameter="R2" Content="矩形2" Foreground="White"
|
|
GroupName="A" />
|
|
<RadioButton Grid.Row="3" Grid.Column="2" Background="Transparent"
|
|
Command="{Binding RoiShapeSelectCommand}"
|
|
CommandParameter="C" Content="圆形" Foreground="White"
|
|
GroupName="A" />
|
|
|
|
<TextBlock Grid.Row="4" Grid.ColumnSpan="2" HorizontalAlignment="Right"
|
|
VerticalAlignment="Center" FontSize="20" Foreground="White"
|
|
Text="识别系数" />
|
|
<ComboBox x:Name="coe" Grid.Row="4" Grid.Column="2"
|
|
Grid.ColumnSpan="2" VerticalAlignment="Center"
|
|
VerticalContentAlignment="Center" Background="Transparent"
|
|
FontSize="16"
|
|
ItemsSource="{Binding CoeList}"
|
|
SelectedItem="{Binding SelectVEI. ImageCorrectionRM.MyROI.RecognitionCoefficient}" />
|
|
|
|
<Button Grid.Row="5" Grid.ColumnSpan="2" Margin="1"
|
|
Background="{Binding BorderBrush, ElementName=TAB1}"
|
|
Command="{Binding CreateImageCorrectionModelCommand}"
|
|
Content="校正设置"
|
|
Style="{DynamicResource commBtn}" />
|
|
<Button Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" Margin="1"
|
|
Background="{Binding BorderBrush, ElementName=TAB1}"
|
|
Command="{Binding ImageCorrectionTestCommand}"
|
|
Content="校正测试"
|
|
Style="{DynamicResource commBtn}" />
|
|
|
|
</Grid>
|
|
</Border>
|
|
<Border Grid.Column="1">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<GroupBox Grid.RowSpan="4" Grid.ColumnSpan="2" Grid.IsSharedSizeScope="True" Header="字符识别项">
|
|
<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" ItemsSource="{Binding SelectModel.MyRoiList}" SelectedItem="{Binding SelectOcrRoi}">
|
|
<DataGrid.ContextMenu>
|
|
<ContextMenu IsEnabled="True" StaysOpen="False">
|
|
<MenuItem Command="{Binding AddOcrRoiCommand}" FontFamily="楷体" FontSize="20" FontWeight="Bold" Header="新增" />
|
|
<MenuItem Command="{Binding SaveOcrRoiCommand}" FontFamily="楷体" FontSize="20" FontWeight="Bold" Header="保存" />
|
|
</ContextMenu>
|
|
</DataGrid.ContextMenu>
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Binding="{Binding ID}" Header="ID" />
|
|
<DataGridTextColumn Width="*" Binding="{Binding Notes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="预设字符" />
|
|
<DataGridCheckBoxColumn Binding="{Binding Enable, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="启用" />
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</GroupBox>
|
|
<Button Grid.Row="4" Margin="1"
|
|
Background="{Binding BorderBrush, ElementName=TAB1}"
|
|
Command="{Binding FontTrainingCommand}"
|
|
Content="字体训练" FontSize="20"
|
|
Style="{DynamicResource commBtn}" />
|
|
<Button Grid.Row="4" Grid.Column="1" Margin="1"
|
|
Background="{Binding BorderBrush, ElementName=TAB1}"
|
|
Command="{Binding OcrReadTestCommand}"
|
|
Content="识别测试" FontSize="20"
|
|
Style="{DynamicResource commBtn}" />
|
|
</Grid>
|
|
|
|
</Border>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
</UserControl>
|