public RecgnizationForm() { InitializeComponent(); _IImageSource = new ImageSets.ImageSource(); imageSourceManager1.ImageSource = _IImageSource; imageSourceManager1.TrainingImageDoubleClicked += imageSourceManager1_TrainingImageDoubleClicked; imageSourceManager1.RecgonizingImageDoubleClicked += imageSourceManager1_RecgonizingImageDoubleClicked; _Builder = new BitmapSetsBuilder(); _ColorClassification = new ColorClassifier(); _ColorClassification.KnownColors = new Color[1] { Color.Red }; _ColorClassification.KnownValues = new double[1] { 1 }; _ColorClassification.Update(); _RecognizerFactory = new RecognizerFactory(_Builder, _ColorClassification); _RecognizerFactory.Initialize(); cmb_Models.ComboBox.DisplayMember = "Name"; cmb_Models.ComboBox.DataSource = _RecognizerFactory.Models; cmb_Models.SelectedIndex = 1; }
/// <summary> /// Initializes a new instance of the <see cref="T:StructureRecognizerFactory"/> class. /// </summary> /// <param name="structures">Structures.</param> /// <param name="blockFactory">Block factory.</param> /// <param name="precision">Precision of structure recognition, influences how much blocks should be present there for it to be still recognized</param> public StructureRecognizerFactory(List <Structure> structures, RecognizerFactory blockFactory, float precision) { Structures = structures; Factory = blockFactory; this.precision = precision; }
public RootDialog(IConfiguration configuration, SettingProvider settingProvider, IIssueTrackingIntegrationService issueTrackingIntegrationService) : base(nameof(RootDialog)) { string[] paths = { ".", "Dialogs", "RootDialog", "RootDialog.lg" }; string fullPath = Path.Combine(paths); var rootDialog = new AdaptiveDialog(nameof(AdaptiveDialog)) { Generator = new TemplateEngineLanguageGenerator(Templates.ParseFile(fullPath)), Recognizer = RecognizerFactory.CreateRecognizer(configuration), Triggers = new List <OnCondition>() { new OnConversationUpdateActivity() { Actions = new List <Dialog>() { new SendActivity("${WelcomeCard()}") } }, new OnIntent("Root") { Actions = new List <Dialog>() { new SendActivity("${WelcomeCard()}") } }, new OnIntent("MainMenu") { Actions = new List <Dialog>() { new SendActivity("${MainMenuCard()}") } }, new OnIntent("Standup") { Actions = new List <Dialog>() { new BeginDialog(nameof(StandupRootDialog)), new SendActivity("${MainMenuCard()}") } }, new OnIntent("Planning") { Actions = new List <Dialog>() { new SendActivity("${NotAvailableFunctionalityMessage()}"), new SendActivity("${MainMenuCard()}") } }, new OnIntent("Grooming") { Actions = new List <Dialog>() { new SendActivity("${NotAvailableFunctionalityMessage()}"), new SendActivity("${MainMenuCard()}") } }, new OnIntent("Setup") { Actions = new List <Dialog>() { new SendActivity("${NotAvailableFunctionalityMessage()}"), new SendActivity("${MainMenuCard()}") } }, new OnIntent("Help") { Condition = "#Help.Score >= 0.8", Actions = new List <Dialog>() { new SendActivity("${HelpCard()}") } }, new OnIntent("Cancel") { Condition = "#Cancel.Score >= 0.8", Actions = new List <Dialog>() { new ConfirmInput() { Prompt = new ActivityTemplate("${Cancel.prompt()}"), Property = "turn.confirm", Value = "=@confirmation", AllowInterruptions = "!@confirmation" }, new IfCondition() { Condition = "turn.confirm == true", Actions = new List <Dialog>() { new SendActivity("Cancelling all dialogs.."), new SendActivity("${MainMenuCard()}"), new CancelAllDialogs(), }, ElseActions = new List <Dialog>() { new SendActivity("${CancelCancelled()}"), new SendActivity("${MainMenuCard()}") } } } } } }; AddDialog(rootDialog); AddDialog(new StandupRootDialog(issueTrackingIntegrationService, settingProvider)); InitialDialogId = nameof(AdaptiveDialog); }