±³¼ö´Ô²²¼ ³»ÁֽŰǵ¥ ¿À·ù¸¦ ã¾Æº¸¶óÇÏ³×¿ä µµ´ëü ¾îµð¼ ¿À·ù°í ¹«½¼³»¿ëÀÎÁö ¤Ð.¤Ð// °¡¸£ÃÄÁÖ¼¼¿ä ¤Ð.¤Ð
#include <stdio.h>
#include <stdlib.h>
#define IMG_SIZE 250
main()
{
int i, j, m, n, itmp ;
float sum ;
unsigned char in_img[IMG_SIZE] [IMG_SIZE] ;
char in_fname[50], out_fname[50];
FILE *in_fp, *out_fp ;
printf("Wirte input image file name.(lena250.raw)\n");
scanf("%s", in_fname);
in_fp = fopen(in_fname, "rb");
if(in_fp == NULL)
{
printf("Cannot open file. \n");
exit(1) ;
}
printf("Write output image file name.(lpf.raw)\n") ;
scanf("%s", out_fname);
out_fp = fopen(out_fname, "wb");
for(i = 0 ; i<IMG_SIZE ; i++){
for (j = 0 ; j<IMG_SIZE ; j++){
in_img[i][j] = fgetc(in_fp) ;
}
}
} |