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

- Fix both stitching_detailed.cpp sample and cv::Stitcher.
pull/3965/head
Adi Shavit 11 years ago committed by Dikay900
parent d9b7b300b4
commit aad95c7d8c
  1. 2
      modules/stitching/src/stitcher.cpp
  2. 2
      samples/cpp/stitching_detailed.cpp

@ -478,7 +478,7 @@ void Stitcher::estimateCameraParams()
{
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];

@ -516,7 +516,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];

Loading…
Cancel
Save