基于OPENCV的SEAMFINDER函数,对已知左上右下坐标的待镶嵌两图像进行镶嵌

本文介绍如何利用OPENCV的SEAMFINDER函数,针对具有左上右下坐标信息的两幅遥感影像进行精准的镶嵌操作,探讨在遥感影像处理中的应用。
摘要由CSDN通过智能技术生成
#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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值