Analysis of a dynamic programming solution to the detection of dim moving targets