#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/stitching/detail/seam_finders.hpp>
#include<iostream>
#include"functions.h"
using namespace cv;
using namespace cv::detail;
Mat MyStitcher()
{
FILE *leftData,*rightData;
double upLeftX,upLeftY,upRightX,upRightY,lowLeftX,lowLeftY,lowRightX,lowRightY,LpixelXsize,LpixelYsize,RpixelXsize,RpixelYsize;//定义两幅待镶嵌图像在显示器上的左上和右下坐标
leftData=fopen("../left.txt","r");//读入文件,并对以上参数赋值
if(leftData==NULL)
{
printf("fail to open the leftliner file");
fclose(leftData);
}
char strline[1024];
int count=0;
for(count=0;count<22;count++)
{
fgets(strline,1024,leftData);
}
char read1[256],read2[256],read3[256],read4[256],read5[256];
fscanf(leftData,"%s %s %s %s %s %lf",read1,read2,read3,read4,read5,&upLeftX);
fscanf(leftData,"%s %s %s %s %s %lf",read1,read2,read3,read4,read5,&lowLeftY);
fscanf(leftData,"%s %s %s %s %lf",read1,read2,read3,read4,&lowLeftX);
fscanf(leftData,"%s %s %s %s %lf",read1,read2,read3,read4,&upLeftY);
fscanf(leftData,"%s %s %s %s %lf",read1,read2,read3,read4,&LpixelXsize);
fscanf(leftData,"%s %s %s %s %lf",read1,read2,read3,read4,&LpixelYsize);
//printf("%lf, %lf, %lf %lf,%lf,%lf",upLeftX,upLeftY,lowLeftX,lowLeftY,LpixelXsize,LpixelYsize);
fclose(leftData);
rightData=fopen("../right.txt","r");
if(rightData==NULL)
{
printf("fail to open the leftliner file");
fclose(rightData);
}
for(count=0;count<22;count++)
{
fgets(strline,1024,rightData);
}
fscanf(rightData,"%s %s %s %s %s %lf",read1,read2,read3,read4,read5,&upRightX);
fscanf(rightData,"%s %s %s %s %s %lf",read1,read2,read3,read4,read5,&lowRightY);
fscanf(rightData,"%s %s %s %s %lf",read1,read2,read3,read4,&lowRightX);
fscanf(rightData,"%s %s %s %s %lf",re
基于OPENCV的SEAMFINDER函数,对已知左上右下坐标的待镶嵌两图像进行镶嵌
最新推荐文章于 2023-05-30 15:07:45 发布
本文介绍如何利用OPENCV的SEAMFINDER函数,针对具有左上右下坐标信息的两幅遥感影像进行精准的镶嵌操作,探讨在遥感影像处理中的应用。
摘要由CSDN通过智能技术生成