Inference on Highly-Connected Discrete Graphical Models with Applications to Visual Object Recognition