资源简介
利用神经网络中的SOM模型实现对图像的压缩方法。

代码片段和文件信息
#include “head.h“
void readBmp(const char * iBmpFile unsigned char *BmpHeader unsigned char **sourcePixel)
{
FILE * fp=fopen(iBmpFile “rb“);
if (fp==NULL)
{
cerr<<“cannot open “< exit(1);
}
fread(BmpHeader 1 BMPHEADBYTES fp);//从fp文件中读取文件头和信息头到BmpHeader
for (int i=0; i {
fread(sourcePixel[i] 1 BMPWIDTH fp);//从fp文件中读取像素数据到sourcePixel
}
fclose(fp);
}
void saveBmp(const char *oBmpFile unsigned char *BmpHeader unsigned char **targetPixel)
{
FILE *fp;
fp=fopen(oBmpFile “wb“);
if (fp==NULL)
{
cout<<“out bmpfile open error!“< exit(1);
}
fwrite(BmpHeader 1 BMPHEADBYTES fp);//从BmpHeader写入文件头和信息头到文件fp
for (int i=0; i {
fwrite(targetPixel[i] 1 BMPWIDTH fp);//从targetPixel写入像素数据到文件fp
}
fclose(fp);
}
int findMin(const double * d)
{
double temp=d[0];
int q;
for (int i=0; i {
if (d[i] {
temp=d[i];
q=i;
}
}
return q;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 66614 2012-11-28 08:29 som\CR.BMP
文件 66614 2012-11-28 08:29 som\LENA.BMP
文件 1076 2012-11-28 08:41 som\ReadSaveBMP.cpp
文件 3860 2012-11-28 09:18 som\SOM.CPP
文件 655 2012-11-28 08:41 som\head.h
目录 0 2012-11-28 08:59 som\
相关资源
- VisualStudioUninstaller vs卸载工具
- 组态王驱动开发包3.0.0.7(中文)
- 多窗口后台鼠标连点器
- 使用选择性重传协议实现UDP可靠通信
- VC 获得文件属性 获取文件的创建时
- 读者写者问题(读者优先,写者优先
- 用VC 编写的仿QQ聊天室程序源代码
- 外点法程序
- 外罚函数程序
- qt-电子点菜系统
- 推箱子及人工智能寻路C 源代码
- 自己写的航空订票系统c 版--数据结构
- 数据结构实验魔王语言
- MUSIC算法c 实现
- C 餐厅叫号系统(QT平)
- 国际象棋c 完整版
-
ob
jectARX给Auto CAD加工具条 - 画图程序MFC/VC/VC CRectTracker 串行化
- MFC网络编程实例
- c 课程设计 职工信息管理系统
- VC 游戏编程—附源代码
- IpHlpApi.h&IpHlpApi.lib
- 清华大学 c 郑莉 ppt课件
- c 程序判断离散数学中命题公式
- 多项式求和(数据结构C 版)
- vc 6.0开发的流程图编辑器
- VC 天空盒(skyBox)实现(附源代码)
- c MFC 画多边形
- 用C 实现的对网络上的ARP数据包进行
- Microsoft基本类库 (MFC)(C 库)
评论
共有 条评论