Archived posting to the Leica Users Group, 2008/03/11

[Author Prev] [Author Next] [Thread Prev] [Thread Next] [Author Index] [Topic Index] [Home] [Search]

Subject: [Leica] Getting "Tourists" out of shots HOW TO IN CS3
From: robert.rose at mac.com (Robert Rose)
Date: Tue Mar 11 10:48:07 2008

Here is a way to remove "tourists", cars, etc., using Photoshop CS3  
Extended, without using the clone tool.  It works really well in  
situations where the things you want to remove are moving, not so well  
otherwise.  When it works, it seems like magic.  You can make a  
freeway appear empty.

1.  Take a series of shots.  Raw or jpg doesn't matter (but there will  
be an extra step to open the raw images)

Tripod?  A tripod is useful here, but if you can hold the camera  
reasonably steady, you will fix the alignment in step __.  If you can  
eyeball some reference (like a window that will be centered) you can  
even put the camera down between shots.

Number of Shots?  This will depend upon the movement of the tourists.   
Try 10 to experiment with the method.  For mathematical reasons (which  
may or may not become clear to you, but don't worry), more than half  
of the shots must show background for each pixel to guarantee removing  
the tourist.  So, if you have one tourist who won't move, you won't be  
able to remove him no matter how many shots you take.  For cars on a  
freeway, for example, 5 to 10 shots are needed.  More is better.

Frequency of Shots?  This depends on the speed of the things to be  
removed.  Ideally, each shot will have a tourist in a different  
position, so that background is being revealed at least half the  
time.  Start with around 1 second intervals to experiment.

2.   In CS3 Extended, choose File>Scripts>Load Files into Stack ...   
Browse to the location of your shots, and be sure to check the two  
boxes for "Attempt to Automatically Align Source Images" and "Create  
Smart Object after Loading Layers."

Which Shots to Select?  Suppose that you took 15 shots.  Unless you  
have a speedy computer, choosing all 15 shots means that you can now  
go have dinner.  I recommend choosing only three to five shots to  
start, being the first, last, and some middle shots (use Command-click).

3.  When the program finishes processing, choose Layer>Smart  
Objects>Stack Mode>Median.

Most of the tourists should now be gone.  If not, repeat with more  
shots in the stack.  As I said, when it works it seems like magic.

How does this work?  For each pixel, a stack is created with the  
luminance values from each shot.  Suppose that we have 15 shots, and  
that value 128 is background, value 25 is a dark shirt, value 200 is a  
white shirt.  The first few shots a fellow with a white shirt is in  
the photo, then he moves and we get some background, and then someone  
with a dark shirt is there for a few shots.  The stack of 15 shots  
might show these values:

1     200
2     200
3     200
4   128
5   128
6   128
7   128
8   128
9   128
10 128
11   25
12   25
13   25
14   25
15  128

Now, the computer ranks the 15 values in numerical order:

25 25 25 25 128 128 128 [128] 128 128 128 128 200 200 200

The median in this list is the middle value, in this case the one I  
put in brackets [ ].  That becomes the output value for that  
particular pixel, and as you see it is conveniently a background value  
of 128.  Now it should be apparent why to guarantee removing the  
tourist, more than half of the values need to be background.

Regards,
Bob Rose