/******************************************************************************
函数名:
readImageGDAL
功能:
读取图像
参数:
unsigned char **pImageData - 指向图像数据指针的指针,将由new操作符动态创建,需要在函数外部由调用者使用delete[]销毁,否则内存泄露
int &width,int &height - 图像宽度、高度,由于是引用,可以作为返回值。
nChannels - 图像通道,可选值为1或3。1代表灰度图像,3代表RGB图像,-1表示按照图像自身通道数目读取。
const char *filePath - 图像文件路径名称
说明:******************************************************************************/
bool readImageGDAL(unsigned char **pImageData,int &width,int &height,int &nChannels, const char *filePath)
{
GDALAllRegister();
GDALDataset *poDataset = NULL;
poDataset=(GDALDataset*) GDALOpen(filePath,GA_ReadOnly);
if(poDataset == NULL)
{