Detecting Groups and Estimating F-Formations for Social Human-Robot Interactions