From 685b795effad6a88d7734989b342892a7baf9b75 Mon Sep 17 00:00:00 2001 From: gyc990326 Date: Thu, 15 Jun 2017 02:55:54 +0800 Subject: [PATCH] Debug version support (#70) * Create openCv.cpp * Create fileSystem.cpp --- src/openpose/utilities/fileSystem.cpp | 2 +- src/openpose/utilities/openCv.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/openpose/utilities/fileSystem.cpp b/src/openpose/utilities/fileSystem.cpp index 498fc0de..1a87cb69 100644 --- a/src/openpose/utilities/fileSystem.cpp +++ b/src/openpose/utilities/fileSystem.cpp @@ -57,7 +57,7 @@ namespace op if (!directoryPath.empty()) { std::replace(directoryPath.begin(), directoryPath.end(), '\\', '/'); // replace all '\\' to '/'; - if (*directoryPath.cend() != '/') + if (*(directoryPath.cend() - 1) != '/') directoryPath = directoryPath + "/"; } return directoryPath; diff --git a/src/openpose/utilities/openCv.cpp b/src/openpose/utilities/openCv.cpp index afc69aa6..a0188215 100644 --- a/src/openpose/utilities/openCv.cpp +++ b/src/openpose/utilities/openCv.cpp @@ -39,12 +39,11 @@ namespace op const auto offsetChannelC = c*offsetBetweenChannels; for (auto y = 0; y < resolutionSize.y; y++) { - const auto cvMatOffsetY = y*resolutionSize.x; const auto floatImageOffsetY = offsetChannelC + y*resolutionSize.x; for (auto x = 0; x < resolutionSize.x; x++) { const auto value = uchar( fastTruncate(intRound(floatImage[floatImageOffsetY + x]), 0, 255) ); - cvMat.at(resolutionChannels*(cvMatOffsetY + x) + c) = value; + *(cvMat.ptr(y) + x*resolutionChannels + c) = value; } } } -- GitLab