opencv 多波段融合

  


    vectorcorners;
	vectorimgs;

	imgs.push_back(cv::imread("testImg/house.jpg"));
	imgs.push_back(cv::imread("testImg/cat.jpg"));
	imgs.push_back(cv::imread("testImg/dog.jpg"));



 	//待融合图像左上角在pano中的坐标
	corners.push_back(cv::Point(200, 200));
	corners.push_back(cv::Point(100, 100));
	corners.push_back(cv::Point(400, 400));



	cv::detail::MultiBandBlender blender(true,10);

    
	blender.prepare(cv::Rect(0, 0, 1000, 1000));

	vectormasks(imgs.size());
	for (int i = 0; i < imgs.size(); i++)
	{
		masks[i].create(imgs[i].size(), CV_8U);
		masks[i].setTo(cv::Scalar::all(255));
		blender.feed(imgs[i], masks[i], corners[i]);

	}
	cv::Mat pano;
	cv::Mat panoMask;
	panoMask.create(cv::Size(1000,1000), CV_8U);
	panoMask.setTo(cv::Scalar::all(255));

	blender.blend(pano, panoMask);

	cv::imwrite("pano.jpg",pano);

opencv 多波段融合_第1张图片

opencv 多波段融合_第2张图片
        

你可能感兴趣的:(算法)