I found this document very useful. This has the algorithm for extracting the license plate from the image