I've reused some material from this answer here to show that the MARS 2020 rover will land on Mars using optical navigation in part.
A helicopter can use similar environmental learning techniques developed for robots on Earth. This isn't a perfect example, but it gives the idea that the robot builds up a map over time. At each point you can identify the location of a new landmark with respect to the previous landmarks.
From Entry, Descent, and Landing Technologies:
RANGE TRIGGER - IT'S ALL ABOUT TIMING
The key to the new precision landing technique is choosing the right moment to pull the "trigger" that releases the spacecraft's parachute. "Range Trigger" is the name of the technique that Mars 2020 uses to time the parachute's deployment. Earlier missions deployed their parachutes as early as possible after the spacecraft reached a desired velocity. Instead of deploying as early as possible, Mars 2020's Range Trigger deploys the parachute based on the spacecraft's position relative to the desired landing target.
above: Illustration of the Range Trigger concept - using the historical /Mars Science Laboratory(MSL)/Curiosity landing site as an example.
Also, during the descent stage, images will be compared in real time to stored terrain maps to improve the accuracy of the landing location:
HOW TERRAIN-RELATIVE NAVIGATION IMPROVES ENTRY, DESCENT, & LANDING
Terrain-Relative Navigation significantly improves estimates of the rover's position relative to the ground. Improvements in accuracy have a lot to do with when the estimates are made.
In prior missions, the spacecraft carrying the rover estimated its location relative to the ground before entering the Martian atmosphere, as well as during entry, based on an initial guess from radiometric data provided through the Deep Space Network. That technique had an estimation error prior to EDL of about 0.6 - 1.2 miles (about 1-2 kilometers), which grows to about (2 - 3 kilometers) during entry.
Using Terrain-Relative Navigation, the Mars 2020 rover will estimates its location while descending through the Martian atmosphere on its parachute. That allows the rover to determine its position relative to the ground with an accuracy of about 200 feet (60 meters) or less.
It takes two things to reduce the risks of entry, descent, and landing: accurately knowing where the rover is headed and an ability to divert to a safer place when headed toward tricky terrain.
above: Illustration of Terrain-Relative Navigation. "Terrain-Relative Navigation helps us land safely on Mars - especially when the land below is full of hazards like steep slopes and large rocks! From here.
In December 2014 the vision system was tested in the Mojave Desert. :
above: "A prototype of the Lander Vision System for NASA's Mars 2020 mission was tested in this Dec. 9, 2014, flight of a Masten Space Systems "Xombie" vehicle at Mojave Air and Space Port in California. Credit: NASA Photo/Tom Tschida" From here.