资源简介
计算两幅单波段影像之间的偏差指数,可用于影像融合质量评价

代码片段和文件信息
#include
#include
#include
#define WIDTHBYTES(i) (((i) + 31) / 32 * 4)
//(nImageWidth*nBitCount+31)/32*4 i = nImageWidth*nBitCount
//读取2副真彩色位图,分别求3个波段对应的偏差指数
void main(int char ** char **)
{
FILE* pFile = fopen(“D:\\desktop\\融合数据\\TEST.bmp“ “rb“); //here is the fusion image
if (!pFile)
{
printf(“Oh\n“);
return;
}
fseek(pFile 14 SEEK_SET);
BITMAPINFOHEADER bmih;
fread(&bmih sizeof(bmih) 1 pFile);
if (bmih.biBitCount != 24)
{
printf(“I can‘t accept you for you are not my taste\n“);
return;
}
int m_width = bmih.biWidth;
int m_height = bmih.biHeight;
int width = WIDTHBYTES(m_width*24);
fseek(pFile 1024 SEEK_CUR);
LPBYTE pBits1 = new BYTE[width*m_height];
fread(pBits1 width*m_height 1 pFile);
fclose(pFile);
pFile = fopen(“D:\\desktop\\融合数据\\color-berkeley.bmp“ “rb“);
if (!pFile)
{
printf(“Oh again\n“);
return;
}
fseek(pFile 14 SEEK_SET);
fread(&bmih sizeof(bmih) 1 pFile);
if (bmih.biBitCount != 24)
{
printf(“I can‘t accept you for you are not my taste BABY\n“);
return;
}
if (bmih.biWidth != m_width || bmih.biHeight != m_height)
{
printf(“You are not the one he is waiting for\n“);
return;
}
fseek(pFile 1024 SEEK_CUR);
LPBYTE pBits2 = new BYTE[width*m_height];
fread(pBits2 width*m_height 1 pFile);
fclose(pFile);
//read data done
double DI[3] = {0};
int i(0) j(0);
LPBYTE p1 = pBits1;
LPBYTE p2 = pBits2; //copy of origin pointer
for (; i < m_height; ++i)
{
p1 = pBits1 + i*width;
p2 = pBits2 + i*width;
for (j = 0; j < m_width; ++j)
{
if (*(p1+3*j+0) != 0)
DI[0] += fabs( ( *(p1+3*j+0) - *(p2+3*j+0) ) / (*(p1+3*j+0)) ); //分母为融合影像
if (*(p1+3*j+1) != 0)
DI[1] += fabs( ( *(p1+3*j+1) - *(p2+3*j+1) ) / (*(p1+3*j+1)) ); //分母为融合影像
if (*(p1+3*j+2) != 0)
DI[2] += fabs( ( *(p1+3*j+2) - *(p2+3*j+2) ) / (*(p1+3*j+2)) ); //分母为融合影像
}
}
delete[] pBits1;
pBits1 = NULL;
delete[] pBits2;
pBits2 = NULL;
DI[0] /= (m_width*m_height);
DI[1] /= (m_width*m_height);
DI[2] /= (m_width*m_height);
printf(“%f\n%f\n%f\n“ DI[0] DI[1] DI[2]);
return;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2285 2011-03-21 13:32 DeviationIndex.cpp
文件 4380 2011-03-20 21:55 DeviationIndex.dsp
文件 553 2011-03-20 21:52 DeviationIndex.dsw
文件 0 2012-02-17 15:42 求取2幅影像指定波段之间偏差系数.txt
----------- --------- ---------- ----- ----
7218 4
- 上一篇:根据卫星星历结算GPS卫星位置
- 下一篇:KL变换主分量变换处理位图格式的影像
相关资源
- 遥感图像几何校正模型探讨
- CAD中插入带坐标的正射影像——Inse
- 影像租赁系统ER图实例(附有系统要求
- 印度泰米尔纳德邦Noyyal流域利用GIS和
- 基于多源SAR影像矿区三维形变场的监
- 遥感技术在地质灾害中的应用
- 遥感原理与应用.rar
- SPOT-5影像在安徽省矿山地质环境遥感
- 浅析遥感图像解译在矿区公路建设中
- img格式遥感图像读取代码
- IDL+ENVI开发多光谱遥感图像DN值求辐亮
- 深度学习在遥感中的应用综述
- 哨兵2号数据波段说明
- 基于相关系数的影像匹配
- 天地图影像CGS2000.lyr
- 影像匹配、特征点提取、影像相关、
- 论文研究 - 遥感与GIS结合的卡拉巴尔
- 基于QuickBird影像的矿区土地利用变化
- 青藏高原天然气水合物遥感探测研究
- 基于光谱指数的植被含水率遥感反演
- 基于遥感与GIS的石羊河流域生态环境
- 城市卫星遥感图像融合处理质量评价
- 基于模拟多光谱遥感影像的大气校正
- 微波遥感课程报告
- 哨兵Sentinel-2卫星资料手册
- 图像分割方法在遥感图像分析中的应
- ENVI去云补丁Haze_tool文件及其使用说明
- 论文研究-基于Harris角点和SURF特征的遥
- 遥感影像几何纠正程序
- 基于遥感与GIS的湖北省土地利用_覆被
评论
共有 条评论