Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]Threshold on partial of image
Forum Updated to NodeBB v4.3 + New Features

[Solved]Threshold on partial of image

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    soheil1365
    wrote on last edited by
    #1

    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...

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DerManu
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved