[Solved]Threshold on partial of image



  • Hi guys..
    I am doing a project with opencv and Qt...
    I have a image which is displayed on Qgraphicsview...Then I drew a rectangle by cv::rect on it...
    @////////////////////////////////////////////////////////////////////////////////////////////////
    CvRect rectn;
    rectn.x=ui->txtxn1->toPlainText().toInt();
    rectn.y=ui->txtyn1->toPlainText().toInt();
    rectn.height=ui->txtheightBlack->toPlainText().toInt();
    rectn.width=ui->txtwidthBlack->toPlainText().toInt();
    cv::rectangle(img,rectn,COLOR_RGB2RGBA,1,8,0);
    /////////////////////////////////////////////////////////////////////////////////////////////////@
    This rectangle is drawn on my image which is loaded in Qgraphicsview.

    Now I want to separate this rectangle from my image and do thresholding on it....
    How can I do that?I do not want do thresholding on whole of the image just on this rectangle...

    please help me...
    thanks in advance...



  • You have the full rect information in rectn (x, y, width, height), so just loop over that rect with QImage::scanLine and do the thresholding.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.