I have this code:
#include <opencv2\stitching\stitcher.hpp>
int Stitching()
{
Stitcher m_stitcher = m_stitcher.createDefault(false);
vector<Mat> images;
Mat img1 = imread("0.jpg"); //read image 0
Mat img2 = imread("1.jpg"); //read image 1
Mat Result;
//add images to the array
images.push_back(img1);
images.push_back(img2);
m_stitcher.stitch(images, Result);
imwrite("panorama.jpg",Result);
return 0;
}
After build I get this error:
Error 4 error C2248: ‘cv::Stitcher::Stitcher’ : cannot access private
member declared in class
‘cv::Stitcher’ C:\Users\Desktop\Projects\SamplePanorama –
PanoramaStitch\SamplePanorama \StitchEngine.cpp 602
What should i add to make the stitch() work correctly?
It would appear that your class
Stitcherdoes not have a public constructor. If this were a class you owned, you would need to give it a public constructor in order to be able to construct an instance ofStitcher. However, it seems that this is a third party library, a quick google search tells you about the presence of this method inStitcher:In order to create an instance of
Stitcheryou would probably have to do something like:Edit:
In order to fix your linker errors, you probably need to add the correct lib files to the list of inputs to your linker. This link should help you set that up, http://opencv.willowgarage.com/wiki/InstallGuide