FOSSredder 0.5.0
Loading...
Searching...
No Matches
CropAdapter.h
Go to the documentation of this file.
1
5
6#pragma once
7
10#include <memory>
11#include <filesystem>
12#include <opencv2/opencv.hpp>
13
14namespace core::ports::diagnostics { class IDiagnostics; }
15
16namespace opencv {
17
19
21public:
33 static std::vector<std::filesystem::path> cropImages(const std::string& imagePath,
34 const std::vector<ports::Rect>& rects,
35 const std::filesystem::path& outputDir,
36 ports::CropRequest::OutputFormat fmt,
37 int jpegQuality = 92,
38 std::shared_ptr<core::ports::diagnostics::IDiagnostics> debugger = nullptr,
39 const std::string& filePrefix = "");
40
53 static std::vector<std::filesystem::path> cropImages(const cv::Mat& img,
54 const std::vector<ports::Rect>& rects,
55 const std::filesystem::path& outputDir,
56 ports::CropRequest::OutputFormat fmt,
57 int jpegQuality = 92,
58 std::vector<std::vector<uint8_t>>* outBytes = nullptr,
59 std::shared_ptr<core::ports::diagnostics::IDiagnostics> debugger = nullptr,
60 const std::string& filePrefix = "");
61};
62
63} // namespace opencv
Request types for document image processing operations.
Result types for document image processing operations.
Port for writing optional diagnostic artifacts.
static std::vector< std::filesystem::path > cropImages(const std::string &imagePath, const std::vector< ports::Rect > &rects, const std::filesystem::path &outputDir, ports::CropRequest::OutputFormat fmt, int jpegQuality=92, std::shared_ptr< core::ports::diagnostics::IDiagnostics > debugger=nullptr, const std::string &filePrefix="")
Crops multiple rectangles from an image file and writes the results to disk.