Пример #1
0
        public MainWindow()
        {
            InitializeComponent();

            // Set the logical focus to the window to correct initialize Commands in context menu
            Focus();

            m_matcher        = new ContoursMatcher();
            m_preprocessor   = new ImagePreprocessor();
            m_filter         = new ContourFilter();
            m_mainWorkerTask = Task.Factory.StartNew(() => DoWorkerJob());

            IEnumerable <DependencyPropertyDescriptor> activeDescriptors =
                new DependencyPropertyDescriptor[]
            {
                m_winSizeDescriptor,
                m_thresholdSubConstantDescriptor,
                m_showContoursDescriptor,
                m_minAreaDescriptor,
                m_minNSPDescriptor,
                m_minACF_NSPDescriptor,
                m_targetLenDescriptor,
                m_showAngleDescriptor,
                m_showBoundingDescriptor,
                m_showAccuracyDescriptor,
                m_useBlurDescriptor,
                m_retriveOnlyExternalContoursDescriptor
            };

            activeDescriptors.ToList()
            .ForEach(d => d.AddValueChanged(this, OnDependencyPropertyChanged));
        }
Пример #2
0
        public MainForm()
        {
            InitializeComponent();

            m_findedContours = new List <FindedContourInfo>();
            m_matcher        = new ContoursMatcher();

            m_workerThread = new Thread(DoWorkerJob);
            m_workerThread.Start();
        }
        public MainWindow()
        {
            InitializeComponent();

            Contours = new ObservableCollection <ContourInformation>();
            Contours.CollectionChanged += (s, a) => m_updateState = UpdateState.Needed; // update request when collection changed

            m_matcher = new ContoursMatcher()
            {
                MinNSP = 0.0f, MinACF_NSP = 0.0f
            };
            m_matcher.FamiliarContours = Contours;

            ContourInput.ContourChanged += new EventHandler(ContourInput_ContourChanged);
        }