An Simple Technique to Take away Vacationers from Pictures | by Lee Vaughan | Sep, 2024

Fast Success Information Journalism

Picture cleanup with Python, PIL, and OpenCV

A Polaroid photo of the Taj Mahal in India.
Picture of the Taj Mahal by DALL-E3

In case you take images of well-known landmarks or do any astrophotography, you’re in all probability conscious of picture stacking. This can be a course of the place you’re taking many stationary footage after which stack (common) them collectively to take away noise or different undesirable components.

These strategies can take away something that strikes at a photograph website, together with folks. Adobe Photoshop, for instance, has a “crowd elimination” script that magically vanishes nonstationary objects. It depends on a statistical common referred to as the median, which is solely the “center” worth in a listing of numbers organized from smallest to largest.

The method requires a number of images. These are ideally taken with a tripod-mounted digicam in order that the objects you wish to take away change positions from one picture to the following, whereas the background stays fixed. You sometimes want 10 to 30 footage taken about 20 seconds aside, or equally spaced frames extracted from a video.

With the imply, you sum numbers and divide by the entire. With the median, you kind numbers and select the center worth.

Within the following determine, a row of 5 photographs is proven with the identical pixel location outlined in…