Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.58 KB | None | 0 0
  1.     // Declare a 2D convolver
  2.     let convolveXY kernel input
  3.        = // First convolve in the X direction and then in the Y direction
  4.          let convolveX = convolve (fun i -> [| -i; 0 |]) kernel (kernel.Length - 1) input
  5.          let convolveY = convolve (fun i -> [| 0; -i |]) kernel (kernel.Length - 1) convolveX
  6.          convolveY
  7.  
  8.     // Create a DX9 target and use it to convolve the test input
  9.     use dx9Target = new DX9Target()
  10.     let convolveDX9 = dx9Target.ToArray2D (convolveXY testKernel testArray)  //Run convolver on testarray
  11.  
  12.     printfn "DX9: -> \r\n%A" convolveDX9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement