问题
I am trying to stitch a large number of images which have good amount overlap like these: ExampleImage1 and ExampleImage2.
Firstly, i want a 1D line of a grass patch. Something like this: Result. This is a screenshot of the original result, the original picture is more than 2MB. Hence couldnt upload it. This was achieved by breaking down 300 images into small sets and stitching them. Like this example but in a larger scale with more heirarchies - 0.jpg,1.jpg,2.jpg images in stitch1.jpg, 2,3,4 in stitch2.jpg and later stitching stitch1.jpg and stitch2.jpg together
Now i want to get the same result by stitching images like: 0.jpg + 1.jpg = result.jpg, result.jpg + 2.jpg = result.jpg ..... and so on.
I am using the region of interest concept to make sure that the overlapping region is more than 20% all the time.The code looks like below. The code is the body of a for loop. It only explains the core part of the algorithm and not the exact code.
After running this, i am getting an artifact such as: Result2. This looks like because the post processing of the stitching pipeline is not observed in the whole image because of the region of interest concept which is used.
Can anyone tell me how to tackle this problem?
Also, is there a way to see the detected features in opencv stitching pipeline?
for (int j = 4; j < 100; j = j + 1) {
image2 = imread("result.jpg"); // result of stitching 0.jpg, 1.jpg,2.jpg and 3.jpg
image1 = imread(j + ".jpg");
Rect rect2 = new Rect(0,0, (int)(image1.cols()*0.5),image2.rows());
Rect rect1 = new Rect(0,0,(int)(image1.cols()*0.5),image1.rows());
imgs.resize(imgs.size() + 1);
imgs.put(imgs.size() - 1, image2);
Roi.push_back(new RectVector(rect2));
imgs.resize(imgs.size() + 1);
imgs.put(imgs.size() - 1, image1);
Roi.push_back(new RectVector(rect1));
int status = stitcher.stitch(imgs, Roi, pano);
}
来源:https://stackoverflow.com/questions/53669581/how-to-stitch-100s-of-images-using-opencv-javacv-most-of-the-current-solutions