Gaussian Blur
Blitz3D Forums/Blitz3D Programming/Gaussian Blur
| ||
Hi, have my matrix 13 by 13 which means 169 calculations per image pixel. This is slow. I read that the method is 'Linearly Seperable' which would mean i could use 13+13 = 26 calculations per pixel. This is faster. Problem is I don't know exactly how to do this. Do I use the middle lines from the matrix? Thanks Jim |
| ||
Maybe it means you should first you apply the horizontal blur (13 calculations), and then the vertical blur (again 13) ? |
| ||
Why not just do an approximation and only blur with nearby pixels? Eg: dim mat#(12, 12) dim matblurred#(12, 12) For x = 0 To 12 For y = 0 To 12 mat#(x, y) = Rnd() matblurred(x, y) = mat(x, y) Next Next For x = 1 To 11 For y = 1 To 11 n# = 0 n = n + mat#(x-1, y-1) n = n + mat#(x-1, y) n = n + mat#(x-1, y+1) n = n + mat#(x, y-1) n = n + mat#(x, y) n = n + mat#(x, y+1) n = n + mat#(x+1, y-1) n = n + mat#(x+1, y) n = n + mat#(x+1, y+1) matblurred(x, y) = n / 9# Next Next |