Qt + gdal geotiff 헤더 읽기

1837 단어 화상 처리
Qt + gdal geotiff 헤더 읽기
.pro 파일 증가:
INCLUDEPATH += E:/opencv/build/include
CONFIG(debug, debug|release):{
LIBS += -LE:/opencv/build/x86/vc10/lib \
-lopencv_core2411d \
-lopencv_imgproc2411d \
-lopencv_highgui2411d \
-lopencv_ml2411d \
-lopencv_video2411d \
-lopencv_features2d2411d \
-lopencv_calib3d2411d \
-lopencv_objdetect2411d \
-lopencv_contrib2411d \
-lopencv_legacy2411d \
-lopencv_flann2411d
}
else:CONFIG(release, debug|release): {
LIBS += -LE:/opencv/build/x86/vc10/lib \
-lopencv_core2411 \
-lopencv_imgproc2411 \
-lopencv_highgui2411 \
-lopencv_ml2411 \
-lopencv_video2411 \
-lopencv_features2d2411 \
-lopencv_calib3d2411 \
-lopencv_objdetect2411 \
-lopencv_contrib2411 \
-lopencv_legacy2411 \
-lopencv_flann2411
}


win32: LIBS += -LE:/GDAL/lib/ -lgdal_i
INCLUDEPATH +=E:/GDAL/include
DEPENDPATH +=E:/GDAL/include

코드
#pragma execution_cha
racter_set("utf-8")
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include "gdal_priv.h"
#include 
#include < QTextCodec >
#include < QFile >

using namespace std;

void main(int argc, char *argv[])
{
    GDALAllRegister();
    CPLSetConfigOption("GDAL_FILENAME_IS_UTF8","NO");
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("GBK"));
    GDALDataset *pData=NULL;
    QString filename = "H:/SAR_1_8.tif";
    QFile ff(filename);
    if(!ff.exists())
    {
        qDebug()<GetRasterCount();//   
    qDebug()<GetRasterXSize();
    qDebug()<GetRasterYSize();
    double adfGeoTransform[6];
    pData->GetGeoTransform( adfGeoTransform);

    qDebug()<

좋은 웹페이지 즐겨찾기