Example: marketing

画像処理の基礎 (2) OpenCV による基本的な例―

(2) OpenCV swk(at) ( ): { Fx,y}{ Gx,y}Gx,y{ Fi,j}, (i, j) Neighbor(x,y) 3x3 5x5 , .. Gx,y : (smoothing) (edge detection)3 ( ): : (smoothing) Gx,y{ Fi,j}, (i, j) Neighbor(x,y) 3x3 {Fi,j} Gx,y 1 2 1/161/81/161/81/41/81/161/81/161/91/91/9 1/91/91/91/91/91/9 1 2 4 ( ): { Fx,y}{ Gx,y}Gx,y{ Fi,j}, (i, j) Neighbor(x,y)weight matrixpixel-wise multiplicationand summation 5 ( ): 1111

知能制御システム学 画像処理の基礎(2) ―OpenCV による基本的な例― 東北大学大学院情報科学研究科 鏡慎吾 swk(at)ic.is.tohoku.ac.jp

Tags:

  Opencv

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of 画像処理の基礎 (2) OpenCV による基本的な例―

1 (2) OpenCV swk(at) ( ): { Fx,y}{ Gx,y}Gx,y{ Fi,j}, (i, j) Neighbor(x,y) 3x3 5x5 , .. Gx,y : (smoothing) (edge detection)3 ( ): : (smoothing) Gx,y{ Fi,j}, (i, j) Neighbor(x,y) 3x3 {Fi,j} Gx,y 1 2 1/161/81/161/81/41/81/161/81/161/91/91/9 1/91/91/91/91/91/9 1 2 4 ( ): { Fx,y}{ Gx,y}Gx,y{ Fi,j}, (i, j) Neighbor(x,y)weight matrixpixel-wise multiplicationand summation 5 ( ): 1111211110101410101111111116 ( ): double w[3 * 3] = { , , , , , , , , }; double scaling = ;for (j = 0; j < img->height; j++) {for (i = 0; i < img->width; i++) {double sum = ;for (n = 0; n < 3; n++) {for (m = 0; m < 3.)}}}

2 M++) {sum += pval(img, i - 1 + m, j - 1 + n)* w[m + 3 * n];}}PIXVAL(result, i, j) = clipvalue(scaling * sum);}}7 ( ): OpenCV cvFilter2D() cvSmooth() cvSobel(), cvLaplace pval() clipvalue() sample program: ( ): 2 9 ( ): ?

3 (1)Marr and Hildreth (1980) 10 ( ): ? (2) : I(x, y) t I(x, y; t) 3 ) Florack et al. (1992) : t1 t2 t1+ t2 11 ( ): (edge detection) -101-101-101-1-1-1000111 1 1 (Sobel )-101-202-101-1-2-100012112 ( ).

4 2 2/ x2+ 2/ y2 1 2 fi+1 2 fi+ fi 1 3x3 0101 4 10101111 81111 13 ( ): DoG Laplacian of Gaussian (LoG) LoG 2 Difference of Gaussian (DoG) DoG( , t) = G( , t + t) G( , t) DoG 14 ( ): (sharpening) -1-1-1-19-1-1-1-10-10-15-10-100000100000 101 4 1010 = 000010000 = 1111 8111115 ( ).

5 2 (binary image) 16 ( ): (neighbor): 4-neighbor8-neighbor n- 2 n- (n-adjacent) 2 a, b p0(= a), p1, p2, .., pn-1, pn(= b) pi pi pi-1 n- a b n- (n-neighbor connected) 17 ( ): dilation: 1 1 erosion: 0 0 opening: erosion + dilationclosing: dilation + erosionGi,j= Fi,j| Fi-1,j| Fi+1,j| Fi,j-1 | Fi,j+1Gi,j= Fi,j& Fi-1,j& Fi+1,j& Fi,j-1& Fi,j+1(4- )(4- ) OpenCV cvErode(), cvDilate() sample program: ( ): 1 projection ( )for (i = 0; i < img->width; i++) { hx[i] = 0; }for (j = 0.)

6 J < img->height; j++) { hy[j] = 0; }for (j = 0; j < img->height; j++) {for (i = 0; i < img->width; i++) {if (PIXVAL(img, i, j) > 128) {hx[i]++;hy[j]++;}}}sample program: ( ): 0 : 2 x 1 y 1 0 1 (gx, gy) = (m1,0/m0,0, m0,1/m0,0) OpenCV cvMoments() sample program: ( ): [1] : , , 2002. [2] T. Lindeberg: Scale-space: A framework for handling image structures at multiple scales, Proc.

7 CERN School of Computing, 1996.[3] T. Lindeberg: Scale-space theory: A basic tool for analysingstructures at different scales, J. Applied Statistics, , , , 1994. [4] D. Marr: , , 1987. [5] D. Marr and E. Hildreth: Theory of Edge Detection, Proc. Roy. Soc. London, Series B, Biological Sciences, , , , 1980. [6] L. M. J. Florack, B. M. T. Romeny, J. J. Koenderink and M. A. Viergever: Scale and the Differential Structure of Images, Image and Vision Computing, , , , 1992.


Related search queries