Added call to clone() to avoid unexpected change to external data.

- Fix both stitching_detailed.cpp sample and cv::Stitcher.
This commit is contained in:
Adi Shavit 2014-07-03 22:14:58 +03:00
parent 964b260937
commit 7674f3ddbf
2 changed files with 2 additions and 2 deletions

View File

@ -522,7 +522,7 @@ Stitcher::Status Stitcher::estimateCameraParams()
{
std::vector<Mat> rmats;
for (size_t i = 0; i < cameras_.size(); ++i)
rmats.push_back(cameras_[i].R);
rmats.push_back(cameras_[i].R.clone());
detail::waveCorrect(rmats, wave_correct_kind_);
for (size_t i = 0; i < cameras_.size(); ++i)
cameras_[i].R = rmats[i];

View File

@ -527,7 +527,7 @@ int main(int argc, char* argv[])
{
vector<Mat> rmats;
for (size_t i = 0; i < cameras.size(); ++i)
rmats.push_back(cameras[i].R);
rmats.push_back(cameras[i].R.clone());
waveCorrect(rmats, wave_correct);
for (size_t i = 0; i < cameras.size(); ++i)
cameras[i].R = rmats[i];