资源简介
主要利用图像控制点校正卫星遥感图像,主要为开源技术的体现

代码片段和文件信息
// CRectifier.cpp: implementation of the CRectifier class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “CRectifier.h“
#include “.\include\cpl_conv.h“
#include “.\include\cpl_string.h“
#include “.\include\ogrsf_frmts.h“
#include “.\include\gdalwarper.h“
#pragma comment(lib“lib\\gdal_i.lib“)
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CRectifier::CRectifier()
{
}
CRectifier::CRectifier(CString filename)
{
SetScrFileName(filename);
}
CRectifier::~CRectifier()
{
}
VOID CRectifier::AddGCPS(double* gcpsint nCount)
{
m_Count = nCount;
m_Gcps = new GDAL_GCP[m_Count];
for (int i=0;i {
char pszId[5];
sprintf(pszId“GCP-%d“i);
m_Gcps[i].pszId = pszId;
m_Gcps[i].pszInfo=““;
m_Gcps[i].dfGCPPixel = gcps[4*i];
m_Gcps[i].dfGCPLine = gcps[4*i+1];
m_Gcps[i].dfGCPX = gcps[4*i+2];
m_Gcps[i].dfGCPY = gcps[4*i+3];
m_Gcps[i].dfGCPZ = 0;
}
}
VOID CRectifier:: SetScrFileName(CString filename)
{
m_ScrFileName = filename;
int index = m_ScrFileName.ReverseFind(‘.‘) + 1;
m_DestFileName = m_ScrFileName.Left(index) + “_Dest“;
m_DestFileName += m_ScrFileName.Right(m_ScrFileName.GetLength() - index );
}
CString CRectifier::GetDestFileName()
{
return m_DestFileName;
}
BOOL CRectifier::Transform()
{
GDALDatasetH hSrcDS hDstDS;
GDALDriverH hDriver;
GDALDataType eDT;
try
{
GDALAllRegister();
// Open the source file.
hSrcDS = GDALOpen( m_ScrFileName GA_ReadOnly );
CPLAssert( hSrcDS != NULL );
GDALSetGCPs(hSrcDSm_Countm_GcpsNULL);
// Create output with same datatype as first input band.
eDT = GDALGetRasterDataType(GDALGetRasterBand(hSrcDS1));
// Get output driver (GeoTIFF format)
hDriver = GDALGetDriverByName( “GTiff“ );
CPLAssert( hDriver != NULL );
// Get Source coordinate system.
const char *pszSrcWKT = NULL;
//
// pszSrcWKT = GDALGetProjectionRef( hSrcDS );
// CPLAssert( pszSrcWKT != NULL && strlen(pszSrcWKT) > 0 );
//
// // Setup output coordinate system that is input by user.
//
char *pszDstWKT = NULL;
//
// oTargetSRS.exportToWkt( &pszDstWKT );
// CPLAssert( pszDstWKT != NULL && strlen(pszDstWKT) > 0 );
// Create a transformer that maps from source pixel/line coordinates
// to destination georeferenced coordinates (not destination
// pixel line). We do that by omitting the destination dataset
// handle (setting it to NULL).
void *hTransformArg;
hTransformArg =
GDALCreateGenImgProjTransformer( hSrcDS pszSrcWKT NULL pszDstWKT
FALSE 0 1 );
CPLAssert( hTransformArg != NULL );
// Get appro
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5756 2009-09-14 22:46 CRectifier.cpp
文件 1017 2009-09-15 09:49 CRectifier.h
文件 4820 2007-08-30 23:15 RasterRectifierDlg.cpp
----------- --------- ---------- ----- ----
11593 3
- 上一篇:高精度动态称重算法与实现
- 下一篇:桌面助手,不会后悔的
相关资源
- GDAL读写shp文件代码
- vc2010下编译好的gdal2.2.4库,支持wms、
- 使用GDAL库处理雷达影像
- gdal_ogr2.0.3.zip
- 使用gdal来显示图像
- 编译好的VS2012使用的gdal库
- 特征点提取Moravec、Forstner、Harris算法
- GeoserverTerrainProvider填坑简易教程
- 一套基于QT、GDAL、OpenGL的遥感影像显
- GDAL,geos联合编译的库,版本为1.8.0
- GDAL百分比截断拉伸调亮影像
- Qt+GDAL图像显示基本功能
- CHM格式的GDAL的帮助文档
- GDAL源码剖析(李民录).pdf
- VS2010下编译的GDAL1.9.1最新版
- 基于GDAL读写影像并做线性拉伸,调整
- gdal工具exe
- 编译好的GDAL库
- Cesium生成离线terrain地形数据所需所有
- GDAL-2.2.4-cp27-cp27m-win32.whl
- GDAL读取SHP文件完美解决中文无乱码,
- qt结合gdal实现图像读取操作
- GDAL打开ESRI FileGDB格式数据
- GDAL1.11 X86 X64
- QTMinGw下已经编译好的gdal库
- 编译可调试版的GDAL 2.2.1,并且添加
- 《GDAL源码剖析与开发指南》书籍代码
- GDAL1.10编译完成版
- 编译好的gdal,仅适用于VS2017
- GDAL源码剖析与开发指南
评论
共有 条评论