Click here to Skip to main content
15,881,719 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I try to detect the license plate from image.

My steps:

1/ Filter noise (Smooth Gaussian)

2/Convert to gray Image

3/ThresholdBinary

4/Dilation and Erosion

5/ Cany filter and findCOntours

But I have a problem with find and draw contours around the license. I am binner in java.Please help me. Thanks very much.

Here is my code:
Java
public class ex1 {
public static void main(String[] args) {
    //read image
    IplImage orgImg = cvLoadImage("F:\\bs9.jpg");
    //smooth Gaussian
    cvSmooth(orgImg,orgImg,CV_GAUSSIAN,7);
    // gray image
    IplImage grayImg = cvCreateImage(cvGetSize(orgImg),orgImg.depth(),1);
    cvCvtColor(orgImg,grayImg,CV_BGR2GRAY);
    //Threshold binary
    cvThreshold(grayImg,grayImg,230,255,CV_THRESH_BINARY_INV);      


    //dalition - erosion

    cvErode(grayImg,grayImg,null,3);
    cvDilate(grayImg,grayImg,null,2);

    // canny filter
    IplImage egde = cvCreateImage(cvSize(grayImg.width(),grayImg.height()),IPL_DEPTH_8U,1);
    cvCanny(grayImg,egde,140,240,7);
    // show image
    cvShowImage("org",orgImg);
    cvShowImage("binary",grayImg);
    cvShowImage("edge",egde);
    //save image
    cvWaitKey();
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900