Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi @HappyForce2 the following code will make the job:

Mat roi;
threshold(gray(boundRect[i]), roi, 100, 255, CV_THRESH_BINARY/* | CV_THRESH_OTSU*/);

if(countNonZero(~roi) > 0)
    cout << "There is a No. Song!!!" << endl;
else
    cout << "Title is empty!!!" << endl;

just add it into the for loop that you are saying and before the following code:

    drawContours( rsz, contours, i, Scalar(0, 0, 255), CV_FILLED, 8, vector<Vec4i>(), 0, Point() );
    rectangle( rsz, boundRect[i].tl(), boundRect[i].br(), Scalar(0, 255, 0), 1, 8, 0 );
}

Here works pretty much ok, if you have any question or face any issue just tell me. Enjoy ;-)

Hi @HappyForce2 the following code will make do the job:

Mat roi;
threshold(gray(boundRect[i]), roi, 100, 255, CV_THRESH_BINARY/* | CV_THRESH_OTSU*/);

if(countNonZero(~roi) > 0)
    cout << "There is a No. Song!!!" << endl;
else
    cout << "Title is empty!!!" << endl;

just add it into the for loop that you are saying and before the following code:

    drawContours( rsz, contours, i, Scalar(0, 0, 255), CV_FILLED, 8, vector<Vec4i>(), 0, Point() );
    rectangle( rsz, boundRect[i].tl(), boundRect[i].br(), Scalar(0, 255, 0), 1, 8, 0 );
}

Here works pretty much ok, if you have any question or face any issue just tell me. Enjoy ;-)