1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #14150 from TolyaTalamanov:at/computation-doesnt-work-with-out-vector

G-API: GComputation doesn't work with output vector<cv::Mat> (#14150)

* Fix bug with gcomputation output vector

* Add test fixture

* Fix comments to review

* Fix alignment
This commit is contained in:
atalaman
2019-05-22 19:13:15 +03:00
committed by Alexander Alekhin
parent 935c02c0a3
commit d9dac9cd1b
3 changed files with 73 additions and 6 deletions
+3 -5
View File
@@ -159,16 +159,14 @@ void cv::GComputation::apply(cv::Mat in1, cv::Mat in2, cv::Scalar &out, GCompile
}
void cv::GComputation::apply(const std::vector<cv::Mat> &ins,
const std::vector<cv::Mat> &outs,
std::vector<cv::Mat> &outs,
GCompileArgs &&args)
{
GRunArgs call_ins;
GRunArgsP call_outs;
// Make a temporary copy of vector outs - cv::Mats are copies anyway
auto tmp = outs;
for (const cv::Mat &m : ins) { call_ins.emplace_back(m); }
for ( cv::Mat &m : tmp) { call_outs.emplace_back(&m); }
for (const cv::Mat &m : ins) { call_ins.emplace_back(m); }
for ( cv::Mat &m : outs) { call_outs.emplace_back(&m); }
apply(std::move(call_ins), std::move(call_outs), std::move(args));
}