Changed Canny algorithm to do in-place edits to hopefully save on the number of writes to memory.