### Finding a bright object

Finally, to return to the challenge I laid out in the first of this series on image manipulation in R: can we do anything as cool in R as can be done in Mathematica? Like, for example, this illustration of how to search images of the surface of Mars for bright anomalies?

The answer is “approximately.” Today’s Gist shows how to take the image above, roughly approximate the distribution of RGB values in a patch of sand, and filter the image to highlight only regions that are particularly unlikely to be sand. It’s not as impressive as the Mathematica example, but it’s not bad for a couple minutes’ work.