In order to improve the effectiveness of mobile payment, automatic identification technology of bank card is proposed. Firstly, a digital template image is created for the bank card, and the image is converted into gray scale, binary conversion, contour extraction, etc. On the basis of the preprocessing, image morphology processing, contour extraction and digital segmentation of the digital image of the bank card, matching the number of the bank card with the template image through the OpenCV computer vision library technology, and the bank card data is recognized by matching method. Finally, through the test of the collected bank card data, the test results show that the correct rate of bank card recognition is up to 95.6%, which meets the requirements of mobile payment bank card binding and improves the user experience of mobile payment.