Skip to content
All posts
Tutorials & Tips10 Min read

Preprocessing Matters: When to Denoise, Sharpen, and Color-Correct Before Depth

The stages before depth estimation are often skipped. They should not be. How preprocessing choices ripple through the entire pipeline.

Most users jump straight to the headline stages — depth estimation, stereo conversion, upscaling. The preprocessing stages (denoise, sharpen, color adjustment, LUT application, deartifact, grain management) feel optional. They are not. Every downstream stage inherits the quality of its input, and preprocessing is where you set that baseline.

Denoise before depth, not after

Depth estimation models interpret high-frequency patterns as texture and structure. Noise — from high ISO, poor compression, or aging source material — creates high-frequency patterns that the model reads as surface detail. The result is noisy depth maps with false micro-structures that flicker between frames. Temporal smoothing can reduce this, but it is solving a problem that denoising would have prevented.

The denoising stage in anelo uses FFmpeg's hqdn3d or nlmeans filters. hqdn3d is faster and sufficient for moderate noise. nlmeans is slower but preserves edge detail better, which matters when the depth model needs clean edges to resolve object boundaries.

Rule of thumb: if your source has visible grain or noise at 100% zoom, denoise before depth estimation. If the source is clean (modern digital camera, well-lit, low ISO), skip denoising entirely — the depth model performs best on clean, unprocessed input.

Sharpen with caution

Sharpening before depth estimation is rarely a good idea. The depth model already extracts edge information from the input; adding artificial edge enhancement creates halos that the model interprets as depth discontinuities. This produces false depth edges — bright borders around objects that shift incorrectly in stereo.

Sharpening after depth and stereo, as a final polish before encoding, is appropriate. At this point the stereo synthesis is complete and sharpening affects appearance without corrupting the depth pipeline.

The exception: if the source is genuinely soft (old analog capture, out-of-focus footage), light sharpening before depth estimation can improve edge detection. Use CAS (Contrast Adaptive Sharpening) rather than unsharp mask — CAS enhances edges without creating halos.

Color correction and LUTs

Color correction before depth estimation has minimal impact on depth quality — the model is robust to color shifts. But it matters for stereo output quality. If your source has a color cast (too warm, too cool, underexposed), the stereo output inherits that cast. Correcting color before processing means the final output is ready for delivery without additional post-processing.

LUT application follows the same logic. If you know the target color grade (e.g., a broadcast delivery LUT), apply it before the pipeline runs. This way the depth model processes the graded image, which may have different luminance relationships than the ungraded source — and the stereo output matches the intended look.

Deartifact for compressed sources

Heavy JPEG or H.264 compression creates blocking artifacts — visible 8×8 pixel grids, especially in dark areas and gradients. These artifacts confuse depth models, which interpret the block boundaries as physical edges in the scene. The result is depth maps with a grid pattern overlaid on smooth surfaces.

The deartifact stage applies a light deblocker before depth estimation. It is most useful for heavily compressed YouTube downloads, old DVDs, and low-bitrate streaming captures. For high-bitrate or ProRes/DNxHR sources, skip it.

Grain management

Film grain is an aesthetic choice, not noise. Some sources have intentional grain (16mm, Super 8, film scans) that is part of the visual character. Removing it before processing produces a clinically clean output that may not match the creator's intent.

anelo's grain stage can add grain back after processing, matching the original grain profile. The recommended approach for grainy sources: denoise to remove digital noise while preserving some grain character, process through the pipeline, then re-grain the output to match the original texture. This preserves the aesthetic while giving the depth model clean input.

The preprocessing stages are cheap — seconds, not minutes. Skipping them saves almost no time but can cost hours troubleshooting depth artifacts that would not have existed with clean input.