本文首发于个人博客https://kezunlin.me/post/1e37a6/,欢迎阅读最新内容!
opencv and numpy matrix multiplication vs element-wise multiplication
Guide
opencv
Matrix multiplication
is where two matrices are multiplied directly. This operation multiplies matrix A of size [a x b]
with matrix B of size [b x c]
to produce matrix C of size [a x c]
.
In OpenCV it is achieved using the simple *
operator:
C = A * B // Aab * Bbc = Cac
Element-wise multiplication
is where each pixel in the output matrix is formed by multiplying that pixel in matrix A by its corresponding entry in matrix B. The input matrices should be the same size, and the output will be the same size as we