Skip to content

Commit

Permalink
Update core
Browse files Browse the repository at this point in the history
Update showInfo for HDN level
  • Loading branch information
TianZerL committed Aug 7, 2020
1 parent 803d2ef commit 8fd6f8c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Anime4KCore/src/Anime4K.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ void Anime4KCPP::Anime4K::loadImage(int rows, int cols, unsigned char* r, unsign
{
inputYUV = false;
cv::merge(std::vector<cv::Mat>{
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;
Expand Down Expand Up @@ -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<cv::Mat>{ dstY,dstU,dstV }, dstImg);
cv::merge(std::vector<cv::Mat>{ dstY, dstU, dstV }, dstImg);
cv::cvtColor(dstImg, dstImg, cv::COLOR_YUV2BGR);
}
else
Expand All @@ -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<cv::Mat>{ dstY,dstU,dstV }, dstImg);
cv::merge(std::vector<cv::Mat>{ dstY, dstU, dstV }, dstImg);
else
throw "Only YUV444 can be saved to opencv Mat";
}
Expand Down Expand Up @@ -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<cv::Mat>{ dstY,dstU,dstV }, dstImg);
cv::merge(std::vector<cv::Mat>{ dstY, dstU, dstV }, dstImg);
else
throw "Only YUV444 can be saved to data pointer";
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -542,7 +548,7 @@ void Anime4KCPP::Anime4K::showImage(bool R2B)
{
if (dstY.size() == dstU.size() && dstU.size() == dstV.size())
{
cv::merge(std::vector<cv::Mat>{ dstY,dstU,dstV }, tmpImg);
cv::merge(std::vector<cv::Mat>{ dstY, dstU, dstV }, tmpImg);
cv::cvtColor(tmpImg, tmpImg, cv::COLOR_YUV2BGR);
}
else
Expand Down

0 comments on commit 8fd6f8c

Please sign in to comment.