A Bayes Risk-Based Cost Function To Allocate Scan Time For Object Detection