D90 Stair-Stepping Removal

Lee Wilson

Veteran
I posted this in the "D90 D-Movie quality is really, really bad!" thread - but figured some people might not search there looking for a solution to the D90's 'stair stepping' problem . . . .

Anyhow, the problem can be removed fairly successfully (depending on the source footage I expect) using a simple to apply 'post' technique.

Here is a quick test of the technique.

http://www.vimeo.com/1935644

It is best to download the original file from Vimeo and view the file at 720p.

If I get a chance today and there is enough interest I will post a detailed explanation of the technique, but basically I am slicing the footage into 9 pixel high sections (actually the 'binning' method Nikon use kind of goes 9 - 9 - 9 - 9 - 8 - 9 and so on - or something like that) - I then moved these slices apart by 1 pixel and filled the gap by interpolation.

This results in a slightly taller frame which then needs to be scaled back to the correct height (around 90%).

You don't need to do this for every clip of course ! once you have set up this file (30 minutes work at most) you can use the same file with its masks to fix any clip you want to put through this fixing process.

I used After Effects but the same method can be used in any kind of software that allows basic stuff like masks and the ability to layer clips and set opacity - so things like Final Cut, Shake and Premiere etc etc.

Like I said if you want a step by step explanation just ask.



Lee
 
Hmmmm. . . . the Vimeo movie doesn't show up for me (Mac G5 + Safari) - but you can still download the source file which is probably a better idea anyhow - you need to join Vimeo (free) and log in to download the source footage (Quicktime movie).
 
Like I said if you want a step by step explanation just ask.


Lee may I offer you some virtual beers?

:beer: :beer: :beer:
:dankk2::dankk2::dankk2:

I hardly recognize my poor footage. I'm impressed how good the fine detail (e.g. the "2008") looks after the fix. It looks just great after your processing and I'm confident the method will also work well on more real life scenes. Yes please a step by step would be helpful. Then I have to figure out how the "Lee Wilson D90 stair-step removal technique" works in Final Cut Pro.

From now on let us refer to this technique as the "Lee Wilson D90 stair-step removal technique"
 
Last edited:
Video doesn't seem to be loading at the moment!?!?!?


The download works.



Looks Great!


Do you have a step by step tutorial up?
 
Last edited:
Would be great if you send us the actual after effects project for this fix. Its the best way to understand how it works.
thanks god you did it!!!!
 
It'd be amazing if you could post a link to your AE project, Lee! Are u you using cs3?

Yeah, it'd be simple, cause you could just have a pre-comp feeding into the pixel cut' comp, and then just keep putting new footage into that pre-comp, and it would always be processed/cut the same.
 
I'd like to see some moving footage of people, etc, to see the effects but looks like a fairly successful attempt, Lee.

This could turn the D90 into a 720p image if it pans out right. A soft one, perhaps, but could be a 720p/24p if you're willing to work around the issue in post.
 
This could turn the D90 into a 720p image if it pans out right. A soft one, perhaps, but could be a 720p/24p if you're willing to work around the issue in post.


The thing is you can edit, grade and play around as per normal - and then just use this method on the final piece - so you don't have to treat all your footage.
 
It'd be amazing if you could post a link to your AE project, Lee! Are u you using cs3?

Using After Effects 7.

I will post up the AE project, but when I post the details a bit later you will see that it is fairly straightforward to just do yourself.

Yeah, it'd be simple, cause you could just have a pre-comp feeding into the pixel cut' comp, and then just keep putting new footage into that pre-comp, and it would always be processed/cut the same.

Exactly !

Or even simpler just highlight the original footage in the project window and replace it with your new clip to be processed by hitting Command H (replace footage).
 
Can you tell us how you did it? So that we can play around?

Next step is gettin' less contrast out of the D90. It's WAY to damned contrasty.
 
Using After Effects 7.

I will post up the AE project, but when I post the details a bit later you will see that it is fairly straightforward to just do yourself.



Exactly !

Or even simpler just highlight the original footage in the project window and replace it with your new clip to be processed by hitting Command H (replace footage).

Yes, of course..

Thanks for doing this, it adds a lot of value to the d90 actually...
 
Ok, not a great tutorial but I am hindered by two things, firstly I don't own a D90 so I can't produce footage to illustrate this and second I have a terrible cold and am wheezing like a 30 year old VHS cassette being rewound in a broken video player.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

First the theory:

(Mostly guess work + some lies) The D90 seems to arrive at 1280 x 720p by firstly arriving at 1280 x 800p and then throwing away a horizontal line every 9 pixels. So we need to put back in a horizontal line every 9 pixels and then squeeze our new 1280 x 800p file down to 1280 x 720p.

Additional points:

a) I don't think it really works like this (above) but it is a convenient illustration.

b) As well as some horizontal lines being thrown away I can also see that some vertical lines are also thrown away (although I might have been fooled by compression artefacts) - but the horizontal lines are the most obvious.

c) The 'missing' line of pixels is not every 9 lines - it is more like 9 - 9 - 9 - 9 - 9 - 8 - 9 - 9 - so it throws a '8' at you every now and again.

That's the theory part finished with, I hope you enjoyed that, now take a break for 20 minutes - have a cup of coffee or maybe sleep for an hour or two.


- - - - - - - - - - - - - - - - - - - - - - - - - - - -


The process:
(this may seem a little laborious - but very straightforward - and remember you only have to do this once, you don't have to do it for every clip).

There are four basic steps.

1) We need to do is to chop our footage into lots of horizontal slices 9 (occasionally 8) pixels high.

2) These slices then need to be separated apart by 1 pixel.

3) These 1 pixel high gaps need to be filled with 50% opacity of the line of pixels above - and 50% opacity of the line of pixels below.

4) This new taller (after adding an extra line every 9 or so lines) file needs to be scaled vertically back down to 720 pixels.


So, that the process, you can achieve this in any number of ways, you could add refinements, use better interpolation than my technique of just mixing the pixels from either side to fill the gap or if you are very very clever you could write a simple little script that automates this for you.


- - - - - - - - - - - - - - - - - - - - - - - - - - - -


How I did my example:
I used After Effects to apply the above process to the D90 footage, here is a little more detail of the steps involved:

Note: I suggest you film a high contrast (and smooth/straight) line at 45° on your D90 to help with the chopping up stage.

1) Wash your hands, use soap and hot water and dry well with a good quality towel.

2) Open After Effects.

3) Import your D90 footage and drag it into a composition.

4) Draw a mask the covers the full width of the frame and 9 pixels deep - that starts on one of the 'steps' and stops on the next step.

slicefa7.gif



5) Click on Mask Shape > Shape. . . and make sure the mask starts and stop exactly on a whole pixel (ie: Top 400 - Bottom 409 . . . . and not Top 399.78 - Bottom 409.43)

6) Duplicate this layer (the footage + it's mask)

7) On the new duplicate layer click on Mask Shape > Shape - then add 9 to the 'top' and 'bottom' values - this moves the mask down and 'cuts out' the next 9 pixel section (keep you eyes out for the occasional 8 pixel section).

>>>>> repeat steps 6 & 7 until you have done the whole height of the 720p file - about 80 times ! - remember you only have to do this once. + Look out for the slices that are only 8 pixels high every now and again - use your eyes !

8) Select all the layers (select all) - deselect the top layer - hit the down arrow to move all (but the top layer) down 1 pixel - deselect the second layer and hit the down arrow to move all (except for the first two layers) down one pixel - deselect the third layer and hit the down arrow to move all (except for the first two layers) down one pixel - etc etc until you have spaced them all out by 1 pixel. ** you need to be at 100% zoom (ie: not zoomed in) for AE to move the layers exactly 1 pixel.

chopmovefg2.gif


9) 5 minute toilet break, wash hands again.

10) Pre-Compose all these layers into one single layer.

11) Duplicate this composite layer twice to give you three layers.

12) Leave the top layer where it is - the second layer down needs to move down by one pixel - the third layer down needs to move up by one pixel. ** you need to be at 100% zoom (ie: not zoomed in) for AE to move the layers exactly 1 pixel.

13) The second layer down needs to have it's opacity/transprency set to 50%.

14) Pre-compose these three layers and squash the result to 720 high.


Now to treat any footage you want to repair, just replace the footage you used to make this project with the footage you want to De-Stair-Step.



Hope all that makes sense, any questions just ask.
 
Last edited:
hehehe very good. youre a genius. but unfortunelly im not a genius, so can you please post the AE project somewhere? so we can have a deep look at it, or just try to do some tests with a more human image.

thanks a lot for everything, lee
 
Back
Top