Tag: 模糊

使用C模糊对位图的影响

我在mp4上编写应用模糊滤镜的程序。 我用ffmpeg从mp4中提取bmp文件。 但模糊结果是错误的。 图片的某些部分已正确模糊,但其他部分的颜色错误。 原始图片http://sofzh.miximages.com/c/XS4yqNd.jpg 模糊的图像http://sofzh.miximages.com/c/IbcxxA4.jpg 这是用于读取bmp,应用模糊和写入bmp文件的代码。 int blur(char* input, char *output) { //variable dec: FILE *fp,*out; bitmap_header* hp; int n,x,xx,y,yy,ile, avgR,avgB,avgG,B,G,R; char *data; int blurSize = 5; //Open input file: fp = fopen(input, “r”); if(fp==NULL){ //cleanup } //Read the input file headers: hp=(bitmap_header*)malloc(sizeof(bitmap_header)); if(hp==NULL) return 3; n=fread(hp, sizeof(bitmap_header), 1, fp); if(nbitmapsize); if(data==NULL){ //cleanup } […]