So, i am working on a character recognition program. This is what i have tried so far. 1. Loaded an image of character A written in various styles. 2. Pre processed the image (converting to grayscale,adaptivethreshold,morphology). 3. Find contours and draw them on the original image. 4. Draw bounding Rectangle on the detected contour.
Now, here is the thing. Since the characters are small, so the boundingrectangle is also small. What my objective is to resize the boundingrectangle to 60*60 and then draw it on each contours detected. Such that when i save the detected contours as images, it can be visible. How do i do that?
for (int i = 0; i < contours.size(); i = hierarchy[i][0]) {
// Rect r = boundingRect(contours[i]);
double area0 = contourArea(contours[i]);
if (area0 < 120) {
//cout<<area0<<endl;
drawContours(src, contours, i, Scalar(255,0,0), CV_FILLED, 8, hierarchy);
rectangle(src, boundRect[i].tl(), boundRect[i].br(), Scalar(0,0,255), 2, 8, 0 );
continue;
}
}