Ask Your Question

# Revision history [back]

### Normalize car plate for OCR Opencv C++

I'm doing some simple OCR car plate recognition system. I'm using HaarCascades to find car plate, and next i need to normalize this plate, to put it into my OCR module. I'm using floodfill to find main contours of a car plate, and then i perform Hough transform, to find upper and lower boarders of a car plate:  Here's a part of code, where i perform Hough transform^

HoughLinesP(canny_img, lines, 1, CV_PI/180, 80, 80, 30 );

for ( size_t i = 0; i < lines.size(); i++ ) {
line (output, Point(lines[i], lines[i]), Point(lines[i], lines[i]), Scalar(0,0,255), 1, 8 );
}


So now i need to cut and rotate this picture along this two lines. How can i do this? i understand that i need to use point Point(lines[i])..Point(lines[i]), but what i should do with them?

### Normalize car plate for OCR Opencv C++

I'm doing some simple OCR car plate recognition system. I'm using HaarCascades to find car plate, and next i need to normalize this plate, to put it into my OCR module. I'm using floodfill to find main contours of a car plate, and then i perform Hough transform, to find upper and lower boarders of a car plate:  Here's a part of code, where i perform Hough transform^

HoughLinesP(canny_img, lines, 1, CV_PI/180, 80, 80, 30 );

for ( size_t i = 0; i < lines.size(); i++ ) {
line (output, Point(lines[i], lines[i]), Point(lines[i], lines[i]), Point(lines[i], lines[i]), Scalar(0,0,255), 1, 8 );
}


So now Now i need to cut and rotate this picture along this two lines. How can i do this? i understand that i need to use point Point(lines[i])..Point(lines[i]), Point(lines[i])..Point(linesi), but what i should do with them?

So basically, i need to get something like that:

1) Image, that i got using HaarCascades 2) After some transformation i need to get something like this: So at the first step i need to cut only upper and lower boarders.