public:
MultiBandBlender(int num_bands = 7) : num_bands_(num_bands) {}
+ int numBands() const { return num_bands_; }
+ void setNumBands(int val) { num_bands_ = val; }
+
private:
cv::Point blend(const std::vector<cv::Mat> &src, const std::vector<cv::Point> &corners, const std::vector<cv::Mat> &masks,
cv::Mat& dst, cv::Mat& dst_mask);
\r
t = getTickCount();\r
LOGLN("Blending images...");\r
- Mat result, result_mask;\r
Ptr<Blender> blender = Blender::createDefault(blend_type);\r
+ if (blend_type == Blender::MULTI_BAND)\r
+ // Ensure last pyramid layer area is about 1 pix \r
+ dynamic_cast<MultiBandBlender*>((Blender*)(blender))\r
+ ->setNumBands(static_cast<int>(ceil(log(static_cast<double>(images_f[0].size().area())) \r
+ / log(4.0))));\r
+ Mat result, result_mask;\r
(*blender)(images_f, corners, masks_warped, result, result_mask);\r
LOGLN("Blending images, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");\r
\r