Automatic registration of instruments by photography