I did a similar project a few years ago in Java, first I applied the Sobel operator and then masked all the image with an image of a plate (with the Sobel operator applied too). The region of maximum coincidence is where the plate is. Then apply an OCR to the selected region to get the number.