From c72a855214ca4d7d285dfc36039aa3d3e3d68ac6 Mon Sep 17 00:00:00 2001 From: Quentin Chateau Date: Wed, 2 Jan 2019 18:41:26 +0100 Subject: [PATCH] Fixed uninitialized value and naming --- .../include/opencv2/stitching/detail/exposure_compensate.hpp | 5 +++-- modules/stitching/src/exposure_compensate.cpp | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp b/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp index bb958a4..e78c088 100644 --- a/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp @@ -60,6 +60,7 @@ namespace detail { class CV_EXPORTS_W ExposureCompensator { public: + ExposureCompensator(): updateGain(true) {} virtual ~ExposureCompensator() {} enum { NO, GAIN, GAIN_BLOCKS, CHANNELS, CHANNELS_BLOCKS }; @@ -189,7 +190,7 @@ public: CV_WRAP BlocksGainCompensator(int bl_width = 32, int bl_height = 32) : BlocksGainCompensator(bl_width, bl_height, 1) {} CV_WRAP BlocksGainCompensator(int bl_width, int bl_height, int nr_feeds) - : BlocksCompensator(bl_width, bl_height, nr_feeds) {setUpdateGain(true);} + : BlocksCompensator(bl_width, bl_height, nr_feeds) {} void feed(const std::vector &corners, const std::vector &images, const std::vector > &masks) CV_OVERRIDE; @@ -210,7 +211,7 @@ class CV_EXPORTS_W BlocksChannelsCompensator : public BlocksCompensator { public: CV_WRAP BlocksChannelsCompensator(int bl_width=32, int bl_height=32, int nr_feeds=1) - : BlocksCompensator(bl_width, bl_height, nr_feeds) {setUpdateGain(true);} + : BlocksCompensator(bl_width, bl_height, nr_feeds) {} void feed(const std::vector &corners, const std::vector &images, const std::vector > &masks) CV_OVERRIDE; diff --git a/modules/stitching/src/exposure_compensate.cpp b/modules/stitching/src/exposure_compensate.cpp index 5b5a501..2cd1eee 100644 --- a/modules/stitching/src/exposure_compensate.cpp +++ b/modules/stitching/src/exposure_compensate.cpp @@ -62,11 +62,10 @@ Ptr ExposureCompensator::createDefault(int type) e = makePtr(); else if (type == CHANNELS_BLOCKS) e = makePtr(); + if (e.get() != nullptr) - { - e->setUpdateGain(true); return e; - } + CV_Error(Error::StsBadArg, "unsupported exposure compensation method"); } -- 2.7.4