对uchar 类型图象数据添加误码

// 10 -4,-5,-6 #include <string.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <stdio.h>#include <math.h>#include <dos.h>// 对uchar 类型图象数据添加误码void Add_Error_Code(char *in_fname,char *out_fname,short r,short c, double err_rate,short seed) { FILE *stream; unsigned cha...
2010-08-08 11:01 | 阅读 2367 次 | 评论 2 条

RGB到YUV 的转变

我们平常德尔图片一般采用RGB编码储存,但是图像处理的时候需要使用 YUV 格式他们的转换可以使用下面的方式实现RGBtoYUV (RGBColor *p,float *yptr,float *uptr,float *vptr){ int i,j; int t1,t2; for(i=0;i<height;i++) for(j=0;j<width;j++) { tl=(height-i-1)*width+j; t2=(width*i+j); *(yptr+t1)=0.2990*(p+t2)->r+0.587*(...
2008-08-07 18:36 | 阅读 6870 次 | 评论 0 条

不同图像文件格式之间的转换

BMPtoAVI //生成avivoid Cbmp2aviDlg::BMPtoAVI(CString szAVIName, CString strBmpDir){ CFileFind finder; strBmpDir += _T("\\*.*");  AVIFileInit();  AVISTREAMINFO strhdr; PAVIFILE pfile; PAVISTREAM ps;  int nFrames =0;  HRESULT hr;  BOOL bFind = finder.FindFile(strBmpDir); while(bFind) {  bFind = finde...
2008-07-29 23:37 | 阅读 10840 次 | 评论 3 条

用matlab处理Raw格式的图像文件的方法

% It depends on your RAW data format. % Try this example:function raw(dim1,dim2)[filename pathname] = uigetfile('*.raw','Please select a RAW file');fid = fopen([pathname filename],'rb','ieee-be');shift = fseek(fid, -dim1*dim2*4,'eof');img = fread(fid,[dim2, dim1],'float32');imshow(i...
2008-06-22 18:08 | 阅读 31225 次 | 评论 1 条

直方图均衡法matlab源码

%图像增强,直方图均衡法 2008/5/10%image_1 原图像;image_2执行直方图均衡化后的图像image_1=imread('lena.bmp');image_2=histeq(image_1);%执行直方图均衡化imshow(image_1);figure,imshow(image_2);figure,imhist(image_1);%显示原图像直方图figure,imhist(image_2);%显示现在图像直方图
2008-06-11 00:35 | 阅读 13468 次 | 评论 3 条

图像文件格式

1. 位图文件头位图文件头包含有关于文件类型、文件大小、存放位置等信息,在Windows 3.0以上版本的位图文件中用BITMAPFILEHEADER结构来定义:typedef struct tagBITMAPFILEHEADER { /* bmfh */UINT bfType;DWORD bfSize;UINT bfReserved1;UINT bfReserved2;DWORD bfOffBits;} BITMAPFILEHEADER;其中:bfType 说明文件的类型.(该值必需是0x4D42,也就是字符'BM'。我们不需要判断OS/2的位图标识,这么做现在来看似乎已经没...
2008-04-29 08:57 | 阅读 4446 次 | 评论 0 条
浏览1943167次