Well this is the problem. I should make graphic display of video where someone is playing tic tac toe. I detected lines on frame using HoughLinesP, but now I should make 9 ROI for nine cells in grid to detect what is where drawn.How should I do ti, I have onlu video and lines. One of the problems is that HoughLinesP gives me more than 4 lines , some are shorter than I need so how to automaticly choose and make ROI?It is this part of code:
vector<Vec4i> lines;
HoughLinesP(dst, lines, 1, CV_PI / 220, 50, 50, 30);
for (size_t i = 0; i < lines.size(); i++)
{
Vec4i l = lines[i];
line(cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0, 0, 255), 3, CV_AA);
imshow("detected lines", cdst);
}
This is a sample image: