Researchers have developed a new method for analyzing and identifying individual grains of extra-planetary matter captured in images by the Mars planetary rovers.

The rovers Curiosity and Opportunity are both currently exploring Mars, sampling soils, collecting data and taking plenty of photos.

A team of scientists have developed a way isolate individual grains of Martian soil from the images taken by the rovers. The scientists say their image analysis and segmentation algorithm will specifically aid planetary scientists with the very basic, but often difficult, task of determining the composition of Martian soil from photos.

Getting a close-up look at the soil grains is important for planetary scientists trying to understand the process of how the particles were distributed from their source regions to where they are now.

"These grain sizes tell scientists about the processes that distributed the particles from their source regions to where they are now," Louisiana State University said in a statement. "For example, were they derived from a water source, blown by wind, or show hydrodynamic sorting?"

Researchers from LSU's Department of Geology and Geophysics developed the new methodology by teaming up with researchers from other institutions,  including Stony Brook University, USGS-Flagstaff AZ and Rider University.

They used a piece of engineering software called Mathmatica to develop the algorithm, which "uses a variety of image processing steps to segment the image, first into coarser (foreground) and finer (background) grains."

The algorithm has the ability to identify most of the individual grains in an image.

The work will no doubt be useful for Mars researchers. However, upon a successful completion of the Russian mission to the Marian moon Phobos in 2020, researchers will have more than just images to study. The mission plans to return samples of the moon's soil to Earth.

It was recently announced that the surface of Phobos is covered in regolith (loose rock and dust on the surface) from Mars itself. So when the mission returns to Earth, looking at the images of pure Martian soil may help scientists even better understand what the distant world is made of.