mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
不要なメモリ確保をなくした
This commit is contained in:
parent
a0055a14d3
commit
9d8b44116e
@ -533,14 +533,10 @@ Waifu2x::eWaifu2xError Waifu2x::ReconstructImage(boost::shared_ptr<caffe::Net<fl
|
|||||||
|
|
||||||
cv::Mat someimg = im(cv::Rect(x, y, width, height));
|
cv::Mat someimg = im(cv::Rect(x, y, width, height));
|
||||||
|
|
||||||
cv::Mat someimg_tmp;
|
|
||||||
someimg.copyTo(someimg_tmp);
|
|
||||||
someimg.release();
|
|
||||||
|
|
||||||
cv::Mat someborderimg;
|
cv::Mat someborderimg;
|
||||||
// 画像を中央にパディング。余白はcv::BORDER_REPLICATEで埋める
|
// 画像を中央にパディング。余白はcv::BORDER_REPLICATEで埋める
|
||||||
cv::copyMakeBorder(someimg_tmp, someborderimg, top, bottom, left, right, cv::BORDER_REPLICATE);
|
cv::copyMakeBorder(someimg, someborderimg, top, bottom, left, right, cv::BORDER_REPLICATE);
|
||||||
someimg_tmp.release();
|
someimg.release();
|
||||||
|
|
||||||
// 画像を直列に変換
|
// 画像を直列に変換
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user