From 8fd6f8c7be7ce91e1f509b9ee03bece3742df251 Mon Sep 17 00:00:00 2001 From: TianZerL Date: Fri, 7 Aug 2020 15:13:19 +0800 Subject: [PATCH] Update core Update showInfo for HDN level --- Anime4KCore/src/Anime4K.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Anime4KCore/src/Anime4K.cpp b/Anime4KCore/src/Anime4K.cpp index e01f1a10..0faadb01 100644 --- a/Anime4KCore/src/Anime4K.cpp +++ b/Anime4KCore/src/Anime4K.cpp @@ -176,10 +176,10 @@ void Anime4KCPP::Anime4K::loadImage(int rows, int cols, unsigned char* r, unsign { inputYUV = false; cv::merge(std::vector{ - cv::Mat(rows, cols, CV_8UC1, b), - cv::Mat(rows, cols, CV_8UC1, g), - cv::Mat(rows, cols, CV_8UC1, r) }, - orgImg); + cv::Mat(rows, cols, CV_8UC1, b), + cv::Mat(rows, cols, CV_8UC1, g), + cv::Mat(rows, cols, CV_8UC1, r) }, + orgImg); dstImg = orgImg; } orgH = rows; @@ -212,7 +212,7 @@ void Anime4KCPP::Anime4K::saveImage(const std::string& dstFile) { if (dstY.size() == dstU.size() && dstU.size() == dstV.size()) { - cv::merge(std::vector{ dstY,dstU,dstV }, dstImg); + cv::merge(std::vector{ dstY, dstU, dstV }, dstImg); cv::cvtColor(dstImg, dstImg, cv::COLOR_YUV2BGR); } else @@ -228,7 +228,7 @@ void Anime4KCPP::Anime4K::saveImage(cv::Mat& dstImage) if (inputYUV) { if (dstY.size() == dstU.size() && dstU.size() == dstV.size()) - cv::merge(std::vector{ dstY,dstU,dstV }, dstImg); + cv::merge(std::vector{ dstY, dstU, dstV }, dstImg); else throw "Only YUV444 can be saved to opencv Mat"; } @@ -263,7 +263,7 @@ void Anime4KCPP::Anime4K::saveImage(unsigned char*& data) if (inputYUV) { if (dstY.size() == dstU.size() && dstU.size() == dstV.size()) - cv::merge(std::vector{ dstY,dstU,dstV }, dstImg); + cv::merge(std::vector{ dstY, dstU, dstV }, dstImg); else throw "Only YUV444 can be saved to data pointer"; } @@ -334,6 +334,9 @@ void Anime4KCPP::Anime4K::showInfo() std::cout << "Zoom Factor: " << zf << std::endl << "HDN Mode: " << std::boolalpha << HDN << std::endl; + if (HDN) + std::cout + << "HDN level: " << HDNLevel << std::endl; break; } std::cout << "----------------------------------------------" << std::endl; @@ -438,6 +441,9 @@ std::string Anime4KCPP::Anime4K::getInfo() case ProcessorType::GPUCNN: oss << "Zoom Factor: " << zf << std::endl << "HDN Mode: " << std::boolalpha << HDN << std::endl; + if (HDN) + oss + << "HDN level: " << HDNLevel << std::endl; break; } oss << "----------------------------------------------" << std::endl; @@ -542,7 +548,7 @@ void Anime4KCPP::Anime4K::showImage(bool R2B) { if (dstY.size() == dstU.size() && dstU.size() == dstV.size()) { - cv::merge(std::vector{ dstY,dstU,dstV }, tmpImg); + cv::merge(std::vector{ dstY, dstU, dstV }, tmpImg); cv::cvtColor(tmpImg, tmpImg, cv::COLOR_YUV2BGR); } else