Created
July 22, 2016 09:24
-
-
Save merryhime/7e41700a6b79df22b8b3cb66dde7d24e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1 0 ¯1 1 0 ¯1 1 0 ¯1)⌽"(1 0 ¯1)⊖"⊂M | |
Here we have a matrix M | |
Let's say it looks like this: | |
> M | |
0 0 0 0 0 | |
0 0 0 0 0 | |
0 1 1 1 0 | |
0 0 0 0 0 | |
0 0 0 0 0 | |
First we wrap it up so it appears like a scalar | |
> ⊂M | |
+---------+ | |
|0 0 0 0 0| | |
|0 0 0 0 0| | |
|0 1 1 1 0| | |
|0 0 0 0 0| | |
|0 0 0 0 0| | |
+---------+ | |
then we do a vertical-rotate-each | |
> (1 0 ¯1)⊖"⊂M | |
+---------+---------+---------+ | |
|0 0 0 0 0|0 0 0 0 0|0 0 0 0 0| | |
|0 1 1 1 0|0 0 0 0 0|0 0 0 0 0| | |
|0 0 0 0 0|0 1 1 1 0|0 0 0 0 0| | |
|0 0 0 0 0|0 0 0 0 0|0 1 1 1 0| | |
|0 0 0 0 0|0 0 0 0 0|0 0 0 0 0| | |
+---------+---------+---------+ | |
Then we do a horizonal rotate each, so we get an array of 9 matrices. | |
We can then multiply each member of our convolution matrix to each of these matrices | |
C×"(1 0 ¯1 1 0 ¯1 1 0 ¯1)⌽"(1 0 ¯1)⊖"⊂M | |
and then summate | |
+/C×"(1 0 ¯1 1 0 ¯1 1 0 ¯1)⌽"(1 0 ¯1)⊖"⊂M |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment