1) Smooth image with a Gaussian
 - optimizes the trade-off between noise filtering and edge 2) Compute the Gradient magnitude using approximations of partial derivatives
 - 2x2 filters
 3) Thin edge by applying non-maxima suppression to the gradient magnitude
4) Detect edges by double thresholding
 // 

 int imageWidth = 512; // 영상의 가로 크기
 int imageHeight = 512; // 영상의 세로 크기
 int depth = 1;  // 1 = 흑백 영상, 3 = 컬러 영상
 unsigned char *dx; // 입력 영상의 기억 장소에 대한 포인터 변수
 unsigned char *dy; // 출력 영상의 기억 장소에 대한 포인터 변수
 unsigned char *m; // flag 변수
 dx= (unsigned char *) malloc(imageWidth * imageHeight * depth);
 dy= (unsigned char *) malloc(imageWidth * imageHeight * depth);
 m = (unsigned char *) malloc(imageWidth * imageHeight * depth);
 char *inpath = "lena512gray_Gnoise.pgm"; //output file path
 
 int x, y, i, sta, end = 12;
 int value;
 int sigma = 1;
 int fs = 6;   //Filter size = fs*2 +1
 double filter1[7] = {0.004432,  0.053991,  0.241971,  0.398942,  0.241971,  0.053991,  0.004432}; //16
 double filter2[13] = {0.002216,  0.008764,  0.026995,  0.064759,  0.120985,  0.176033,  0.199471,
      0.176033,  0.120985,  0.064759,  0.026995,  0.008764,  0.002216};
 for(ubt
 

'Part 3 > ¶ 강의자료' 카테고리의 다른 글

마이크로프로세스및실습  (0) 2011.09.08
기업학습조직론 강의자료  (0) 2011.09.08
컴퓨터 비젼 강의자료  (0) 2011.09.08
AND