A real time 3D sensor for smart cameras