Multicore construction of k-d trees with applications in graphics and vision