Toyota engineers wanted better night vision systems that can help drivers navigate dark roads safely. Now they have developed camera software which takes inspiration from nocturnal dung beetles, bees and moths that can see across a remarkable range of color, brightness and shadow, New Scientist reports.

The new digital image-processing algorithm can capture full-color images at night from a car moving at high speeds, and can even adapt to light levels automatically. That means there’s no problem with the sudden blinding bright lights of an oncoming vehicle. Even better, the inexpensive system only requires a standard digital camera and typical PC graphics card.

Such innovation arose from the collaboration of Toyota engineers, mathematicians and Eric Warrant, a vision scientist at the University of Lund in Sweden. Warrant has spent most of his career studying the unique nocturnal vision of insects, and was first to create a mathematical model describing how “local adaptive spatiotemporal smoothing” works.

Just as the insect eyes can pool signals from photoreceptors to enhance specific details or characteristics within an overall nighttime image, the algorithm can pool signals from neighboring image pixels — the mathematical equivalent of finding the best exposure time and pixel size for every single spot of every frame. The algorithm can also spot repeating patterns across frames to pinpoint movement, and tune the details to avoid motion blurring.

The camera package continues to receive refinements in Toyota’s labs, but researchers hope that it could someday become part of a heads-up display for drivers. It might even serve an automatic crash-prevention system.

[via New Scientist]