I want to detect and extract alphabets from image and create new image only contains alphabets.I have applied skeletonization on the image after that I want some suggestions.How can we detect letters using contours or stroke bases.The images I am using are basically dvd player pack panel e.g,
The code I am using for skeletonization is
cvtColor(input, input, CV_BGR2GRAY);
cv::threshold(input, input, 127, 255, cv::THRESH_BINARY);
cv::Mat skel(input.size(), CV_8UC1, cv::Scalar(0));
cv::Mat temp;
cv::Mat eroded;
cv::Mat element = cv::getStructuringElement(cv::MORPH_CROSS, cv::Size(3, 3));
bool done;
do
{
cv::erode(input, eroded, element);
cv::dilate(eroded, temp, element); // temp = open(input)
cv::subtract(input, temp, temp);
cv::bitwise_or(skel, temp, skel);
eroded.copyTo(input);
done = (cv::countNonZero(input) == 0);
} while (!done);
The output Image After skeletonization,
Source :http://felix.abecassis.me/2011/09/opencv-morphological-skeleton/