A 3x3 image kernel takes 9 multiplications and 8 or 9 additions for each pixel?

5 visualizaciones (últimos 30 días)
I doubt because you have 9 multiplications and you are adding 9 numberse together, when using a 3x3 convolution matrix.
Adding 9 numbers: 1+2+3+4+5+6+7+8+9
We are performing 8 additions as we repeat the operation of 'adding' 8 times (8 times a '+' sign).
We can say there are 9 additions as well, if you would accept a definition like: 0+1+2+3+4+5+6+7+8+9
But what does make more sense for computers: 8 adds or 9 adds?

Respuestas (1)

Image Analyst
Image Analyst el 30 de Mayo de 2013
For a 3 by 3 window there are not 8 additions, and not 9 additions. There are 3 additions and 3 multiplications, and 1 subtraction as the window slides along. You multiply the 3 numbers on the right by the filter, then add the 3 numbers to the right (2 additions) then add that sum to the sum of the filter (one more addition), then subtract off the sum of the left column. If you have a separable (symmetric) kernel, you have even fewer. Look up strategies for speeding up convolutions and linear filters, or read Steve's blog: http://blogs.mathworks.com/steve/2006/10/04/separable-convolution/ (which I seem to be referring people to more and more lately).

Categorías

Más información sobre Image Processing and Computer Vision en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by