#include <fmt/core.h> // for print
#include <opencv2/core/hal/interface.h> // for CV_8U, CV_32FC1
#include <opencv2/core.hpp> // for normalize, merge, split, dft
#include <opencv2/highgui.hpp> // for imshow, waitKey, namedWindow
#include <opencv2/imgproc.hpp> // for circle
namespace db {
void imshow(const cv::String &winName_, const cv::Mat& img_) {
#ifdef DEBUG
if (img_.depth() == CV_8U) {
cv::imshow(winName_, img_);
} else {
double min_ = 0, max_ = 0;
cv::Point2i min_pt, max_pt;
cv::Mat temp;
cv::minMaxLoc(img_, &min_, &max_, &min_pt, &max_pt, cv::noArray());
cv::normalize(img_, temp, 0, 255, cv::NORM_MINMAX, CV_8U, {
});
cv::imshow(winName_, temp);
if (min_ < 0 || max_ > 1) {
fmt::print("[DEBUG] {} is not of any showing formats, a makeshift image "
"is create.\nOriginal states:\n",
winName_);
fmt::print("minVal: {} at point ({},{})\n", min_, min_pt.x, min_pt.y);
fmt::print("maxVal: {} at point ({},{})\n\n"
傅立叶变换去除周期噪声及其注意事项
最新推荐文章于 2022-12-07 11:50:55 发布