我正在尝试使用OpenCV Java API将两个图像拼接在一起.但是,我得到的输出错误,因此无法解决问题.我使用以下步骤:
1.检测特征
2.提取特征
3.比赛功能.
4.找到单应性
5.找到透视变换
6.翘曲角度
7.将2幅图像“缝制”为组合图像.
但是我哪里出错了.我认为这是我整理两张图片的方式,但是我不确定.我在2张图像之间获得了214个良好的功能匹配,但是无法拼接它们?
public class ImageStitching {
static Mat image1;
static Mat image2;
static FeatureDetector fd;
static DescriptorExtractor fe;
static DescriptorMatcher fm;
public static void initialise(){
fd = FeatureDetector.create(FeatureDetector.BRISK);
fe = DescriptorExtractor.create(DescriptorExtractor.SURF);
fm = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE);
//images
image1 = Highgui.imread("room2.jpg");
image2 = Highgui.imread("room3.jpg");
//structures for the keypoints from the 2 images
MatOfK