Discovery of these potentially hazardous asteroids and comets involves dedicated telescopes sweeping the sky. Detection occurs simply by observing the motion of asteroids against the background stars.
By bouncing radar waves off an asteroid, researchers have been able to get detailed physical measurements along with very specific information about near Earth asteroids, which might one day help as NASA searches for targets for manned missions or mining operations.
Discovered in 2005, 2005 YU55, seen here, passed within 201,900 miles of Earth on November 8, 2011. Observed by the Goldstone Deep Space Communications Complex (GDSCC) in the Mojave Desert, the object was measured by radio waves and found to be about 400m in diameter, about the size of an aircraft carrier. NASA says we won't be getting detailed images like these from 2012 DA14 because the asteroid is much smaller.
See a five-frame looped movie of the 2005 YU55 radar imagery here.