-
Notifications
You must be signed in to change notification settings - Fork 535
/
ConfigureProcessor.cs
101 lines (88 loc) · 4.25 KB
/
ConfigureProcessor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System;
using System.Drawing;
using System.Windows.Forms;
using iSpyApplication.Controls;
namespace iSpyApplication
{
public partial class ConfigureProcessor : Form
{
private readonly CameraWindow _cameraControl;
public ConfigureProcessor(CameraWindow cw)
{
InitializeComponent();
RenderResources();
_cameraControl = cw;
}
private void RenderResources()
{
chkKeepEdges.Text = LocRm.GetString("KeepEdges");
label47.Text = LocRm.GetString("Tracking");
label3.Text = LocRm.GetString("ObjectTrackingOptions");
label48.Text = LocRm.GetString("MinimumWidth");
label2.Text = LocRm.GetString("MinimumHeight");
chkHighlight.Text = LocRm.GetString("Highlight");
Text = LocRm.GetString("Configure");
button1.Text = LocRm.GetString("OK");
}
private void ConfigureProcessorLoad(object sender, EventArgs e)
{
cdTracking.Color = pnlTrackingColor.BackColor = ColorTranslator.FromHtml(_cameraControl.Camobject.detector.color);
chkKeepEdges.Checked = _cameraControl.Camobject.detector.keepobjectedges;
numWidth.Value = _cameraControl.Camobject.detector.minwidth;
numHeight.Value = _cameraControl.Camobject.detector.minheight;
chkHighlight.Checked = _cameraControl.Camobject.detector.highlight;
}
private void Button1Click(object sender, EventArgs e)
{
_cameraControl.Camobject.detector.keepobjectedges = chkKeepEdges.Checked;
_cameraControl.Camobject.detector.color = ColorTranslator.ToHtml(cdTracking.Color);
_cameraControl.Camobject.detector.highlight = chkHighlight.Checked;
//if (CameraControl.Camera != null && CameraControl.Camera.MotionDetector != null)
//{
// switch (CameraControl.Camobject.detector.postprocessor)
// {
// case "Grid Processing":
// ((GridMotionAreaProcessing)CameraControl.Camera.MotionDetector.MotionProcessingAlgorithm).
// HighlightColor = ColorTranslator.FromHtml(CameraControl.Camobject.detector.color);
// break;
// case "Object Tracking":
// ((BlobCountingObjectsProcessing)
// CameraControl.Camera.MotionDetector.MotionProcessingAlgorithm).HighlightColor =
// ColorTranslator.FromHtml(CameraControl.Camobject.detector.color);
// break;
// case "Object Tracking (no overlay)":
// ((BlobCountingObjectsProcessing)
// CameraControl.Camera.MotionDetector.MotionProcessingAlgorithm).HighlightMotionRegions =
// false;
// break;
// case "Border Highlighting":
// ((MotionBorderHighlighting)CameraControl.Camera.MotionDetector.MotionProcessingAlgorithm).
// HighlightColor = ColorTranslator.FromHtml(CameraControl.Camobject.detector.color);
// break;
// case "Area Highlighting":
// ((MotionAreaHighlighting)CameraControl.Camera.MotionDetector.MotionProcessingAlgorithm).
// HighlightColor = ColorTranslator.FromHtml(CameraControl.Camobject.detector.color);
// break;
// case "None":
// break;
// }
//}
_cameraControl.Camobject.detector.minwidth = (int)numWidth.Value;
_cameraControl.Camobject.detector.minheight = (int)numHeight.Value;
DialogResult = DialogResult.OK;
Close();
}
private void pnlTrackingColor_Click(object sender, EventArgs e)
{
ShowTrackingColor();
}
private void ShowTrackingColor()
{
cdTracking.Color = pnlTrackingColor.BackColor;
if (cdTracking.ShowDialog(this) == DialogResult.OK)
{
pnlTrackingColor.BackColor = cdTracking.Color;
}
}
}
}