Supervised And Unsupervised Methods For Vision-Based Object Detection, Counting And 3D Reconstruction