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. I want to crop a selected a rectangle area in live video feed and save those area or image in my local drive
Forum Updated to NodeBB v4.3 + New Features

I want to crop a selected a rectangle area in live video feed and save those area or image in my local drive

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 2 Posters 8.2k 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.
  • R robotsandi

    @mrjj
    yes this is correct

    R Offline
    R Offline
    robotsandi
    wrote on last edited by
    #21

    @robotsandi
    Is that correct
    mCameraImageCapture->setCaptureDestination(QCameraImageCapture::CaptureToBuffer);
    to mCameraImage Capture is store image in buffer??

    R 1 Reply Last reply
    0
    • R robotsandi

      @robotsandi
      Is that correct
      mCameraImageCapture->setCaptureDestination(QCameraImageCapture::CaptureToBuffer);
      to mCameraImage Capture is store image in buffer??

      R Offline
      R Offline
      robotsandi
      wrote on last edited by
      #22

      @robotsandi
      QPixmap original("mCameraImageCapture");
      QPixmap cropped = original.copy(x1, y1, width, height);
      cropped.save(filename);
      is pic is not save

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #23

        Yes it think its ok.
        But not used in sample so might not be needed.
        They just setup
        imageCapture = new QCameraImageCapture(camera);
        and hook up signal
        connect(imageCapture, &QCameraImageCapture::imageCaptured, this, &Camera::processCapturedImage);
        and then do

        void Camera::processCapturedImage(int requestId, const QImage& img)
        {
            Q_UNUSED(requestId);
            QImage scaledImage = img.scaled(ui->viewfinder->size(),
                                            Qt::KeepAspectRatio,
                                            Qt::SmoothTransformation);
        
            ui->lastImagePreviewLabel->setPixmap(QPixmap::fromImage(scaledImage));
        
            // Display captured image for 4 seconds.
            displayCapturedImage();
            QTimer::singleShot(4000, this, &Camera::displayViewfinder);
        }
        
        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