-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
82 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
language: cpp | ||
dist: bionic | ||
dist: focal | ||
sudo: required | ||
|
||
addons: | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
Дополнительный функционал для отладки. | ||
*/ | ||
|
||
#ifndef __DEBUG_HPP__ | ||
#define __DEBUG_HPP__ | ||
|
||
#include <opencv2/core.hpp> | ||
|
||
#define ___DEBUG___ 1 | ||
|
||
#if ___DEBUG___ | ||
#include <string> | ||
#include <filesystem> | ||
|
||
#include <opencv2/imgproc.hpp> | ||
#include <opencv2/highgui.hpp> | ||
#endif // ___DEBUG___ | ||
|
||
// В режиме отладки: запись изображения в каталог отладки. | ||
template<class String> | ||
void imageWrite(const String& win_name, const cv::Mat& mat) | ||
{ | ||
#if ___DEBUG___ | ||
namespace fs = std::filesystem; | ||
static size_t debug_frame_counter = 0; | ||
if (win_name == std::string("Input")) | ||
++debug_frame_counter; | ||
|
||
const fs::path debug_dir = "../result/"; | ||
fs::create_directory(debug_dir); | ||
fs::path image_dir = debug_dir / win_name; | ||
fs::create_directory(image_dir); | ||
std::string file_name = std::to_string(debug_frame_counter) + ".png"; | ||
fs::path image_path = image_dir / file_name; | ||
cv::imwrite(image_path, mat); | ||
#endif // ___DEBUG___ | ||
} | ||
|
||
// В режиме отладки: запись изображения в каталог отладки. | ||
// В обычном режиме: вывод изображения на экран. | ||
template<class String> | ||
void imageShow(const String& win_name, const cv::Mat& image) | ||
{ | ||
imshow(win_name, image); | ||
|
||
#if ___DEBUG___ | ||
if (image.channels() == 1) | ||
{ | ||
cv::Mat bin_image = image.clone(); | ||
const uchar BackGround = 0; | ||
const uchar ForeGround = 255; | ||
cv::threshold(image, bin_image, BackGround, ForeGround, cv::THRESH_BINARY); | ||
imageWrite(win_name, bin_image); | ||
} | ||
else | ||
{ | ||
imageWrite(win_name, image); | ||
} | ||
#endif // ___DEBUG___ | ||
} | ||
|
||
#endif // __DEBUG_HPP__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 017c63b..668a33e 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1,4 +1,4 @@ | ||
-cmake_minimum_required(VERSION 2.8 FATAL_ERROR) | ||
+cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) | ||
project("pbcvt") | ||
|
||
#----------------------------CMAKE & GLOBAL PROPERTIES-------------------------# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.