Example #1
0
 public WorkerService(IServiceProvider serviceProvider, ILogger <WorkerService> logger, ITelegramBotClient telegramBotClient, ImageDocumentDetectionService imageDocumentDetectionService) : base(serviceProvider)
 {
     _logger                        = logger;
     _telegramBotClient             = telegramBotClient;
     _imageDocumentDetectionService = imageDocumentDetectionService;
     _queue = new ConcurrentQueue <WorkItem>();
 }
Example #2
0
 public ImageDetectionTests()
 {
     _service = new ImageDocumentDetectionService(
         new IImagePreProcessor[] { new ResizeImagePreProcessor(1600), new SimpleCannyImagePreProcessor() },
         new SimplePerspectiveTransformImageExtractor(),
         new IContourDetector[]
     {
         new SimpleContourDetector(20, 0.005), new SimpleContourDetector(15, 0.03),
         new ConvexHullContourDetector(10, 0.03)
     },
         new IResultScorer[]
         { new FourEdgesScorer(), new ConvexityScorer(), new AreaScorer(10), new HoughLinesScorer() },
         new IImagePostProcessor[] { });
 }