1. A method comprising: selecting a predetermined image area for a photodetector array in a barcode scanner; partitioning the predetermined image area into multiple sub-regions; capturing an image with the photodetector array; determining a type for each sub-region in the multiple sub-regions in the image captured; assigning a weight to each sub-region in the multiple sub-regions based on the type of each sub-region in the multiple sub-regions; and setting an amount of exposure for the photodetector array in the barcode scanner based on the weight for each sub-region in the multiple sub-regions.