| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cstddef> | ||
| 4 | #include <cstdint> | ||
| 5 | #include <vector> | ||
| 6 | |||
| 7 | #include "dorogin_v_bin_img_conv_hull_TBB/common/include/common.hpp" | ||
| 8 | #include "task/include/task.hpp" | ||
| 9 | |||
| 10 | namespace dorogin_v_bin_img_conv_hull_tbb { | ||
| 11 | |||
| 12 | class DoroginVImgConvHullTBB : public BaseTask { | ||
| 13 | public: | ||
| 14 | static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { | ||
| 15 | return ppc::task::TypeOfTask::kTBB; | ||
| 16 | } | ||
| 17 | |||
| 18 | explicit DoroginVImgConvHullTBB(const InputType &input); | ||
| 19 | |||
| 20 | private: | ||
| 21 | bool ValidationImpl() override; | ||
| 22 | bool PreProcessingImpl() override; | ||
| 23 | bool RunImpl() override; | ||
| 24 | bool PostProcessingImpl() override; | ||
| 25 | |||
| 26 | static size_t PixelIndex(int row, int col, int cols) { | ||
| 27 |
5/6✓ Branch 0 taken 296 times.
✓ Branch 1 taken 5752 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 44 times.
✓ Branch 4 taken 700 times.
✓ Branch 5 taken 484 times.
|
7276 | return (static_cast<size_t>(row) * static_cast<size_t>(cols)) + static_cast<size_t>(col); |
| 28 | } | ||
| 29 | |||
| 30 | static int64_t Cross(const PixelPoint &a, const PixelPoint &b, const PixelPoint &c); | ||
| 31 | static std::vector<PixelPoint> ComputeConvexHull(const std::vector<PixelPoint> &points); | ||
| 32 | |||
| 33 | void BinarizeImage(uint8_t threshold = 127); | ||
| 34 | void FloodFillComponent(int row_start, int col_start, std::vector<bool> *visited, | ||
| 35 | std::vector<PixelPoint> *component) const; | ||
| 36 | void ExtractComponentsAndHulls(); | ||
| 37 | |||
| 38 | InputType image_; | ||
| 39 | }; | ||
| 40 | |||
| 41 | } // namespace dorogin_v_bin_img_conv_hull_tbb | ||
| 42 |