Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Declare a 2D convolver
- let convolveXY kernel input
- = // First convolve in the X direction and then in the Y direction
- let convolveX = convolve (fun i -> [| -i; 0 |]) kernel (kernel.Length - 1) input
- let convolveY = convolve (fun i -> [| 0; -i |]) kernel (kernel.Length - 1) convolveX
- convolveY
- // Create a DX9 target and use it to convolve the test input
- use dx9Target = new DX9Target()
- let convolveDX9 = dx9Target.ToArray2D (convolveXY testKernel testArray) //Run convolver on testarray
- printfn "DX9: -> \r\n%A" convolveDX9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement