Variance-based approximation
Make 2 pixel sets: XFG and XBG
Increasing tn just moves pixels from XBG to XFG
Compute Var(XFG) and Var(XBG) and
J = ?1 Var(XBG) + ?2 Var(XFG) + ?3 Nt
Keep tn that yields minimum J
Very fast implementation using some histograms and intermediary variables
Example: [?1 ?2 ?3]=[1 5 200]