1. A method of automatically extracting a validity period of a driving license, the method comprising: receiving an image file of a vehicle driving license; extracting candidate contour regions from within the image file according to a contour extraction rule, and selecting from among the extracted candidate contour regions at least one candidate contour region containing an annual inspection validity period; extracting all character contours from within each selected candidate contour region; acquiring a smallest circumscribed rectangle of each character contour in the selected candidate contour region, and dividing image blocks bound by the acquired smallest circumscribed rectangles one by one into individual single-character blocks; sorting these single-character blocks according to their respective positions in the selected candidate contour region; recognizing a corresponding character of each single-character block; generating a character string representing the annual inspection validity period using the recognized characters based on the sorting; and extracting time data in the character string and taking the time data as the annual inspection validity period of the selected candidate contour region.
1. A method of automatically extracting a validity period of a driving license, the method comprising: receiving an image file of a vehicle driving license; extracting candidate contour regions from within the image file according to a contour extraction rule, and selecting from among the extracted candidate contour regions at least one candidate contour region containing an annual inspection validity period; extracting all character contours from within each selected candidate contour region; acquiring a smallest circumscribed rectangle of each character contour in the selected candidate contour region, and dividing image blocks bound by the acquired smallest circumscribed rectangles one by one into individual single-character blocks; sorting these single-character blocks according to their respective positions in the selected candidate contour region; recognizing a corresponding character of each single-character block; generating a character string representing the annual inspection validity period using the recognized characters based on the sorting; and extracting time data in the character string and taking the time data as the annual inspection validity period of the selected candidate contour region. 3. The method of claim 1 , wherein the extracting all the character contours from within each selected candidate contour region comprises: converting each selected candidate contour region to a single-channel grayscale image; binarizing the grayscale image using Otsu's threshold method to obtain a binary image; calling a contour extraction function to extract all the contours in the binary image; singling out the contours each having a preset height and a preset width; analyzing whether the number of the contours singled out is equal to a preset number; and incrementing or decrementing the preset height and/or preset width by a preset amplitude if the number of the contours singled out is unequal to the preset number, and returning to singling out the contours each having a preset height and a preset width.