private ImageProcessor InitializeImageProcessor() { string objectDetectionSettingsFullpath = Path.Combine(RootDirectory, ObjectDetectionFactory.ObjectDetectionSettingsFileName); string objectDetectionSettingsStr = File.ReadAllText(objectDetectionSettingsFullpath); objectDetectionSettingsStr = objectDetectionSettingsStr.Replace("\\", "\\\\"); ObjectDetectionSettings settings = Newtonsoft.Json.JsonConvert.DeserializeObject <ObjectDetectionSettings>(objectDetectionSettingsStr); IObjectDetection objDetector = ObjectDetectionFactory.CreateObjectDetector(settings); ImageProcessor imgProcessor = new ImageProcessor(objDetector); imgProcessor.ObjectDetectionResult += ObjectDetectionResult; imgProcessor.LogErrorDelegate += LogError; imgProcessor.LogTraceDelegate += LogTrace; return(imgProcessor); }
public ObjectDetectionController(IObjectDetection objectDetection) { _objectDetection = objectDetection; }