separate contours of text for segmentation [closed]

asked 2017-01-25 12:28:38 -0600

alexander33 gravatar image

updated 2020-11-07 14:56:14 -0600

I’ve been working with text recognition in a dataset of images, I want segment the characters of the image using components and finding contours of a threshold image. However, many of the characters are united with each other and others components in the image. Some idea for separate ? Thanks for the help!!!! here some examples, and part of my code:

Mat placa_contornos = processContourns(img_placa_adaptativeTreshold_mean);

vector<vector<Point>> contours_placa;


findContours(placa_contornos,
    contours_placa, // a vector of contours
    CV_RETR_EXTERNAL, // retrieve the external contours (REcupera contornos externos)
    CV_CHAIN_APPROX_NONE); // all pixels of each contours


vector<vector<Point> >::iterator itc = contours_placa.begin();
while (itc != contours_placa.end()) {
    //Create bounding rect of object
    Rect mr = boundingRect(Mat(*itc));
    rectangle(imagem_placa_cor, mr, Scalar(0, 255, 0));
    ++itc;
}

imshow("placa con rectangles", imagem_placa_cor);

examples

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-12-06 10:12:29.241609