Localization of barcode is the key technology for barcode recognition. This paper presents an automatic localization algorithm for multiple barcodes in complex background. The proposed algorithm includes dividing the image into a plurality of tiles, and scanning each of the tiles so as to detect a pattern of strips associated with the barcode in at least one of the tiles. The pattern of strips is analyzed so as to determine the candidate region. Then the effective affine region of barcode is computed by the method of Blob analysis and the barcode is only contained in it. Experimental results indicate that the proposed approach has certain accuracy, the efficiency and robustness.