A Bayes Risk-Based Cost Function to Allocate Scan Time for Object Detection