Copied weighted median filtering code from classic_nl method into ba_optical flow (classic++). It actually decreases AAE and EPE!