public LearningPathViewModel(/*ICommand renderXnaCmd, */DatabaseService db, ICommand returnToMainWindowCmd) { ReturnToMainWindowCmd = returnToMainWindowCmd; MDetector md = new MDetector(); Image<Bgr, Byte> img = new Image<Bgr, Byte>(640, 480, new Bgr(255, 255, 0)); PiktoViewDB piktodb = new PiktoViewDB(db); pictoViewManager = new PiktoViewManager(piktodb); ToolArtNetwork toolNetwork = new ToolArtNetwork(piktodb.getImageIdDic()); MarkerPosition3D pos = new MarkerPosition3D(80.0f, 640.0f, 640, 480); RenderXnaCmd = new BasicCommand(p => { md.findMarkers(img.Convert<Gray, Byte>()); if (md.isMarker()) { int id = toolNetwork.recognitionPictograms(md.markers[0].getSymbolImage()); if (id != -1) { pos.estimate(md.markers[0]); pictoViewManager.viewSceneMarker(id, pos.getTransformatinMatrix(), img.ToBitmap()); } } else { pictoViewManager.updateDisplayCameraLayer(img.ToBitmap()); } displayComponent.displaySetContent(); }); }
public MainWindow() { InitializeComponent(); img = new Image<Bgr, byte>(640, 480, new Bgr(255, 255, 0)); db = new Database.DatabaseService(); pictoRecognitionAndXnaView = new PiktoRecognitionAndXNAViewer(); pictoRecognitionAndXnaView.initialize(db); }
public PiktoViewDB(Database.DatabaseService db,string catagory = "none") { this.catagory = catagory; this.db=db; idMedia=new Dictionary<int,string>(); idObjectType = new Dictionary<int,string>(); idImage=new Dictionary<int,Image<Gray,byte>>(); getDBInfo(); int i = 0; }
private IDictionary<ViewType, ViewTypeManager<FrameworkElement>> PrepareMapping(ContentManagementService cms, IParameterTransfer parameterTransfer) { var mapping = new Dictionary<ViewType, ViewTypeManager<FrameworkElement>>(); mapping[ViewType.Default] = new ViewTypeDefaultManager(); mapping[ViewType.Test] = new ViewTypeTestManager(); mapping[ViewType.MainWindow] = new ViewTypeMainWindowManager(cms.OpenLearningPathPromptCommand, cms.OpenExaminationPathWizardCommand, cms.OpenSettingsWindowCommand, cms.ShowAboutWindowCommand, cms.CloseApplicationCommand); mapping[ViewType.LearningPathPrompt] = new ViewTypeLearningPathPromptManager(cms.StartLearningPathCommand); mapping[ViewType.ExaminationPathWizard] = new ViewTypeExaminationPathWizardManager(vt => { cms.RefreshSecondaryView(ViewType.ExaminationPathWizard, vt); }, cms.HideSecondaryWindowCommand, cms.StartExaminationPathCommand); mapping[ViewType.SettingsWindow] = new ViewTypeSettingsWindowManager(cms.OpenPictogramsManagementWizardCommand, cms.OpenCategoriesManagementWizardCommand, cms.OpenCameraCalibrationToolCommand, cms.ReturnToMainWindowCommand); mapping[ViewType.AboutWindow] = new ViewTypeAboutManager(cms.HideSecondaryWindowCommand); DatabaseService databaseService = new DatabaseService(); mapping[ViewType.LearningPath] = new ViewTypeLearningPathManager(databaseService, cms.LoadMainPageCommand); mapping[ViewType.ExaminationPath] = new ViewTypeExaminationPathManager(cms.ToExaminationPathPipe); mapping[ViewType.PictogramsManagementWizard] = new ViewTypePictogramsManagementWizardManager(vt => { cms.RefreshSecondaryView(ViewType.PictogramsManagementWizard, vt); }, cms.HideSecondaryWindowCommand, cms.OpenSettingsWindowCommand); mapping[ViewType.CategoriesManagementWizard] = new ViewTypeCategoriesManagementWizardManager(vt => { cms.RefreshSecondaryView(ViewType.CategoriesManagementWizard, vt); }, cms.HideSecondaryWindowCommand, cms.OpenSettingsWindowCommand); mapping[ViewType.CalibrationWindow] = new ViewTypeCalibrationManager(); return mapping; }
public PictogramsManagementPathViewModel() { db = new DatabaseService(); SelectedIndex = -1; }
public CategoriesManagementPathViewModel() { db = new DatabaseService(); SelectedIndex = -1; }