How to detect license plate from image in java?

asked 2015-02-23 09:42:10 -0600

updated 2015-02-23 09:43:22 -0600

berak gravatar image

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. I really really want to help. Please hepl me. Thanks.!

original image Original image egde image Egde image Image I want Image I want And here is my code

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();
edit retag flag offensive close merge delete

Comments

1

please understand, that javacv, being a 3rd party wrapper , is a bit off-topic here.

we can help you with opencv problems, just not with those specific to their api.

berak gravatar imageberak ( 2015-02-23 09:44:27 -0600 )edit

i have tried this code with the netbeans IDE but i received an erreur " Exception in thread main java.lang.UnsatisfiedLinkError : no opencv_java343 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java : 1867) at java.lang.Runtime.loadLibrary0(Runtime.java : 870) at java.lang.System.loadLibrary(System.java: 1122) at example .Example.main(Example.java : 35) i have added opencv.jar , javacv.jar,javacpp.jar,javacv-platform,opencv-windows-x86_64.jar to my library i tried evrything i want to help please

opencv reshercher gravatar imageopencv reshercher ( 2020-05-31 12:22:49 -0600 )edit