Ask Your Question

License plates

asked 2014-08-02 07:34:00 -0500

Rookie1 gravatar image

updated 2016-01-16 05:51:13 -0500


I am writing a script in C++ that will be detecting and recognizing vehicle registration plates. I've already found objects of my interest but I have a problem in cutting out detected signs from picture. I want to do it because I want to resize them and compare them to my database. I think I have to use ROI function but I don't know how.

I tried to do so, but when I'm trying to compile the program I get this statement:

error C2664: 'cv::imshow' : cannot convert parameter 2 from 'cv::Rect' to 'cv::InputArray'
1>          Reason: cannot convert from 'cv::Rect' to 'const cv::_InputArray'

So here is my question: could anybody tell me how to do it? Below I post part of my script.

Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) );
rectangle( image_roi, prostokat[j].tl(), prostokat[j].br(), color, 2, 8, 0 );       
Rect roi_1(prostokat[1].x, prostokat[1].y, prostokat[1].width, prostokat[1].height);
Mat image_1 = image(roi_1); 
namedWindow( "Example1", CV_WINDOW_AUTOSIZE );

I would be very grateful if someone would help me.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-08-04 07:41:38 -0500

thdrksdfthmn gravatar image

Your problem there is that imshow needs a cv::Mat parameter instead of cv::Rect. It is very explicit in the error message, so use imshow("Example1",image_1);

edit flag offensive delete link more

answered 2019-05-27 15:44:21 -0500

BobaTeaGood gravatar image

Hi, have you been able to create your script to detect vehicle license plates from a video stream? If so, can you let me know? I'd love to learn to see what you've done. PM me.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-08-02 07:34:00 -0500

Seen: 267 times

Last updated: Aug 04 '14