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
  1.  //   
  2. <div><br>  
  3.  int imageWidth = 512; // 영상의 가로 크기 <br>  
  4.  int imageHeight = 512; // 영상의 세로 크기 <br>  
  5.  int depth = 1;  // 1 = 흑백 영상, 3 = 컬러 영상 </div>  
  6. <div> unsigned char *dx; // 입력 영상의 기억 장소에 대한 포인터 변수 <br>  
  7.  unsigned char *dy; // 출력 영상의 기억 장소에 대한 포인터 변수 <br>  
  8.  unsigned char *m; // flag 변수 </div>  
  9. <div> dx= (unsigned char *) malloc(imageWidth * imageHeight * depth); <br>  
  10.  dy= (unsigned char *) malloc(imageWidth * imageHeight * depth);<br>  
  11.  m = (unsigned char *) malloc(imageWidth * imageHeight * depth);</div>  
  12. <div> char *inpath = "lena512gray_Gnoise.pgm"//output file path<br>  
  13.  <br>  
  14.  int x, y, i, sta, end = 12;<br>  
  15.  int value;</div>  
  16. <div> int sigma = 1;<br>  
  17.  int fs = 6;   //Filter size = fs*2 +1<br>  
  18.  double filter1[7] = {0.004432,  0.053991,  0.241971,  0.398942,  0.241971,  0.053991,  0.004432}; //16<br>  
  19.  double filter2[13] = {0.002216,  0.008764,  0.026995,  0.064759,  0.120985,  0.176033,  0.199471, <br>  
  20.       0.176033,  0.120985,  0.064759,  0.026995,  0.008764,  0.002216};</div>  
  21. <div> for(ubt</div>  
  22. <div> <br>  
  23. </div>  

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

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