Recherche de documents officiels OpenCV (2) convolution

Je(i,j) = 5 * I(i,j) − [I(i − 1,j) + I(i + 1,j) + I(i,j − 1) + I(i,j + 1)]
⇐⇒ I(i,j) * M,où M =
(0 -1 0)
(-1 5 -1)
(0 -1 0)

OpenCV utilise filter2D (I, K, I.degree(), kern) pour les opérations de convolution de champ


Mat A=imread (picName,CV_LOAD_IMAGE_COLOR);
Mat mask=(Mat_(3,3)<<0,-1,0,-1,5,-1,0,-1,0);
Mat B;
filter2D (A,B,A.depth (),mask);

Guess you like

Origin blog.csdn.net/CanvaChen/article/details/52550689