private void button2_Click(object sender, EventArgs e) { toolStripStatusLabel1.Text = ""; panel1.CreateGraphics().Clear(Color.Transparent); if (mf != null) { mf.stopFlow(); mf = null; } TextMsgHandler csdtmh = new TextMsgHandler(SignDetectionTextMessageHandler); ADESPanel p1 = new ADESPanel(panel1); TextMsgDisplayProcessor tmdp = new TextMsgDisplayProcessor(new BasicMsgService(null), csdtmh); PanelDisplayProcessor pdp = new PanelDisplayProcessor(p1, new BasicMsgService(null)); MsgConsumer cnn = new NN_Processor(new DispatchMsgService(new MsgConsumer[] { pdp, tmdp }), Constants.SignType.circular); //MsgConsumer tnn = new NN_Processor(new DispatchMsgService(new MsgConsumer[] { pdp, tmdp }), Constants.SignType.triangular); MsgConsumer csdp = new CircularSignDetectorProcessor(new BasicMsgService(cnn), null); //MsgConsumer tsdp = new TriangularSignDetectorProcessor(new BasicMsgService(tnn), null); BitmapMemoryVisionSource bmps = new BitmapMemoryVisionSource(new DispatchMsgService(new MsgConsumer[] { csdp/*, tsdp*/ })); mf = new MessageFlow(); mf.addInitiator(bmps); mf.startFlow(); Bitmap bmp = new Bitmap(imgName); bmps.sendBmp(bmp); }
private void AdesDlg_Load(object sender, EventArgs e) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); cmbES.SelectedIndex = 0; serverHost.Text = getLocalIP(); imgServerHost.Text = getLocalIP(); unreal = new Unreal(appPath.Text); // Init ADES messageFlow for vision ADESPanel p1 = new ADESPanel(panel1); TextMsgHandler csdtmh = new TextMsgHandler(circularSignDetectionTextMessageHandler); mf = new MessageFlow(); TextMsgDisplayProcessor tmdp = new TextMsgDisplayProcessor(new BasicMsgService(null), csdtmh); PanelDisplayProcessor pdp = new PanelDisplayProcessor(p1, new BasicMsgService(null)); MsgConsumer cnn = new NN_Processor(new DispatchMsgService(new MsgConsumer[]{pdp, tmdp}), Constants.SignType.circular); CircularSignDetectorProcessor csdp = new CircularSignDetectorProcessor(new BasicMsgService(cnn), null); bmvs = new BitmapMemoryVisionSource(new BasicMsgService(csdp)); mf.addInitiator(bmvs); mf.startFlow(); }