Ask Your Question

Revision history [back]

How to use multiband blender in opencv c++

I am working in a stitching task from 2 input cameras My pipeline is the following : 1- synchronize the cameras 2- find keyPoints and descriptors from each image using sift 3- match the keyPoints using BFMathcer and KNN 4- warp the right image 5- stack the left image to it My issue is that the colors from each camera has a large different from the other one I tried to use cv::detail::MultiBandBlender but there is no explained document of how to use it even the very limited examples online didn't help at all

what I tried until now

    cv::Mat final_res;
    cv::detail::MultiBandBlender blender;
    cv::Rect bounding_box(0,0, left_frame.cols+right_frame.cols,
                                                  left_frame.rows);
    blender.prepare(bounding_box);

    cv::warpPerspective(right_frame, result_stitching,  homography_right,
                                                       cv::Size( bounding_box.size()));
    cv::Mat mask = cv::Mat::ones( bounding_box.size(), CV_8U);

    cv::Mat insetImage( result_stitching, cv::Rect(0, 0, 
                                                             left_frame.cols,    
                                                             left_frame.rows));
    left_frame.copyTo(insetImage);

    blender.feed(result_stitching.clone(),mask , cv::Point(0, 0));
    blender.blend(final_res, mask);
    final_res.convertTo(final_res, (final_res.type() / 8) * 8);

with this I have 2 images:

  • result_stitching( stitching results without blending)

  • final_res( stitching results with blending)

    the blending results is turned to black image I need to know how to use MultiBandBlender in a correct way even if anyone knows how to blend the results using any way in c++ I am open to any solution, the target is to make the total image colors balanced

How to use multiband blender in opencv c++

I am working in a stitching task from 2 input cameras My pipeline is the following : 1- synchronize the cameras 2- find keyPoints and descriptors from each image using sift 3- match the keyPoints using BFMathcer and KNN 4- warp the right image 5- stack the left image to it My issue is that the colors from each camera has a large different from the other one I tried to use cv::detail::MultiBandBlender but there is no explained document of how to use it even the very limited examples online didn't help at all

what I tried until now

    cv::Mat final_res;
    cv::detail::MultiBandBlender blender;
    cv::Rect bounding_box(0,0, left_frame.cols+right_frame.cols,
                                                  left_frame.rows);
    blender.prepare(bounding_box);

    cv::warpPerspective(right_frame, result_stitching,  homography_right,
                                                       cv::Size( bounding_box.size()));
    cv::Mat mask = cv::Mat::ones( bounding_box.size(), CV_8U);

    cv::Mat insetImage( result_stitching, cv::Rect(0, 0, 
                                                             left_frame.cols,    
                                                             left_frame.rows));
    left_frame.copyTo(insetImage);

    blender.feed(result_stitching.clone(),mask , cv::Point(0, 0));
    blender.blend(final_res, mask);
    final_res.convertTo(final_res, (final_res.type() / 8) * 8);

with this I have 2 images:

  • result_stitching( stitching results without blending)blending) https://drive.google.com/open?id=11QQUq5rmCXhrQvoFKO5IukQ-GG5Lvp9l

  • final_res( stitching results with blending)blending) https://drive.google.com/open?id=1Qy8AsoEz1koHrM2QvhbtrisMrwfuPJ2c

    the blending results is turned to black image I need to know how to use MultiBandBlender in a correct way even if anyone knows how to blend the results using any way in c++ I am open to any solution, the target is to make the total image colors balanced balanced

How to use multiband blender in opencv c++

I am working in a stitching task from 2 input cameras My pipeline is the following : 1- 1. synchronize the cameras 2- 2. find keyPoints and descriptors from each image using sift 3- 3. match the keyPoints using BFMathcer and KNN 4- 4. warp the right image 5- 5. stack the left image to it

My issue is that the colors from each camera has a large different from the other one I tried to use cv::detail::MultiBandBlender but there is no explained document of how to use it even the very limited examples online didn't help at all

what I tried until now

    cv::Mat final_res;
    cv::detail::MultiBandBlender blender;
    cv::Rect bounding_box(0,0, left_frame.cols+right_frame.cols,
                                                  left_frame.rows);
    blender.prepare(bounding_box);

    cv::warpPerspective(right_frame, result_stitching,  homography_right,
                                                       cv::Size( bounding_box.size()));
    cv::Mat mask = cv::Mat::ones( bounding_box.size(), CV_8U);

    cv::Mat insetImage( result_stitching, cv::Rect(0, 0, 
                                                             left_frame.cols,    
                                                             left_frame.rows));
    left_frame.copyTo(insetImage);

    blender.feed(result_stitching.clone(),mask , cv::Point(0, 0));
    blender.blend(final_res, mask);
    final_res.convertTo(final_res, (final_res.type() / 8) * 8);

with this I have 2 images:

  • result_stitching( stitching results without blending) https://drive.google.com/open?id=11QQUq5rmCXhrQvoFKO5IukQ-GG5Lvp9lblending)

  • final_res( stitching results with blending) https://drive.google.com/open?id=1Qy8AsoEz1koHrM2QvhbtrisMrwfuPJ2cblending)

    the blending results is turned to black image I need to know how to use MultiBandBlender in a correct way even if anyone knows how to blend the results using any way in c++ I am open to any solution, the target is to make the total image colors balanced

How to use multiband blender in opencv c++

I am working in a stitching task from 2 input cameras My pipeline is the following : 1. synchronize the cameras 2. find keyPoints and descriptors from each image using sift 3. match the keyPoints using BFMathcer and KNN 4. warp the right image 5. stack the left image to it

My issue is that the colors from each camera has a large different from the other one I tried to use cv::detail::MultiBandBlender but there is no explained document of how to use it even the very limited examples online didn't help at all

what I tried until now

    cv::Mat final_res;
    cv::detail::MultiBandBlender blender;
    cv::Rect bounding_box(0,0, left_frame.cols+right_frame.cols,
                                                  left_frame.rows);
    blender.prepare(bounding_box);

    cv::warpPerspective(right_frame, result_stitching,  homography_right,
                                                       cv::Size( bounding_box.size()));
    cv::Mat mask = cv::Mat::ones( bounding_box.size(), CV_8U);

    cv::Mat insetImage( result_stitching, cv::Rect(0, 0, 
                                                             left_frame.cols,    
                                                             left_frame.rows));
    left_frame.copyTo(insetImage);

    blender.feed(result_stitching.clone(),mask , cv::Point(0, 0));
    blender.blend(final_res, mask);
    final_res.convertTo(final_res, (final_res.type() / 8) * 8);

with this I have 2 images:

  • result_stitching( stitching results without blending)blending) https://drive.google.com/open?id=11QQUq5rmCXhrQvoFKO5IukQ-GG5Lvp9l

  • final_res( stitching results with blending)blending) https://drive.google.com/open?id=1Qy8AsoEz1koHrM2QvhbtrisMrwfuPJ2c

    the blending results is turned to black image I need to know how to use MultiBandBlender in a correct way even if anyone knows how to blend the results using any way in c++ I am open to any solution, the target is to make the total image colors balanced