Choose an algorithm
Choose the simplest model that describes the variation in your data, then test what happens when its assumptions fail.
| You want to… | Start with | Check first |
|---|---|---|
| Reduce ordinary image noise | Gaussian | Can you afford to blur boundaries? |
| Remove isolated specks | Median | Must thin lines survive? |
| Preserve strong boundaries while smoothing | Bilateral or guided filtering | Does the guide contain the right structure? |
| Separate a bright object | Threshold | Is illumination uniform? |
| Segment under uneven lighting | Adaptive threshold | What neighbourhood captures illumination without following texture? |
| Count separate binary regions | Connected components | Are touching objects already separated? |
| Measure object outlines | Contours | Which boundaries and holes should count? |
| Find an unchanged patch | Template matching | Are scale and orientation stable? |
| Match a textured planar object | ORB or SIFT, then homography | Is one plane a valid model? |
| Follow points between nearby frames | Lucas-Kanade | Are the patches visible and textured? |
| Estimate dense motion | Farneback or DIS | How will you identify uncertain or occluded pixels? |
| Refine an existing alignment | ECC | Is the initial warp close enough? |
| Estimate translation of the whole frame | Phase correlation | Does most of the content share one translation? |
| Read a marker or code | ArUco or QR | Are the code’s cells resolved clearly? |
| Estimate known-object pose | PnP | Are camera calibration and point correspondences correct? |
| Run a learned detector | DNN | Does the model’s operator set work in this build? |
Evaluate the assumption, not just the output
Section titled “Evaluate the assumption, not just the output”A crisp mask may still identify the wrong object. A low alignment error may come from a repeated texture. A smooth depth map may contain invalid correspondences. Keep confidence, coverage and model fit separate from the visual attractiveness of the result.
Use a positive control that should succeed, a nearby difficult case and a case that should be refused. For image reconstruction, exclude genuinely unknown pixels from numerical error while reporting how many are unknown.