In this paper, we propose an efficient method for license plate localization in the images with various situations and complex background. At the first, in order to reduce problems such as low quality and low contrast in the vehicle images, image contrast is enhanced by the two different methods and the best for following is selected. At the second part, vertical edges of the enhanced image are extracted by sobel mask. Then the most of the noise and background edges are removed by an effective algorithm. The output of this stage is given to a morphological filtering to extract the candidate regions and finally we use several geometrical features such as area of the regions, aspect ratio and edge density to eliminate the non-plate regions and segment the plate from the input car image. This method is performed on some real images that have been captured at the different imaging conditions. The appropriate experimental results show that our proposed method is nearly independent to environmental conditions such as lightening, camera angles and camera distance from the automobile, and license plate rotation.