Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Access original imagedata captured by Android QML camera
Forum Updated to NodeBB v4.3 + New Features

Access original imagedata captured by Android QML camera

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 1.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.
  • C Offline
    C Offline
    Cutee
    wrote on last edited by
    #1

    Hey,

    I am using a QML Camera object for capturing a image and a C++ class for processing the captured image. Until now the code looks like this:

    QML Camera object :

    Camera {
        id: camera
        captureMode: Camera.CaptureStillImage
        imageCapture {
            onImageCaptured: {
                imagecaptured.source = preview;
                imgProcessor.processImage(preview);
            }
        }
    }
    

    process Image in C++:

    void ImgProcessor::processImage(const QString& path)
    {
    QUrl imageURL(path);
    QQmlEngine* engine = QQmlEngine::contextForObject(this)->engine();
    QQmlImageProviderBase* imageProviderBase = engine->imageProvider(imageURL.host());
    QQuickImageProvider* imageProvider = static_cast<QQuickImageProvider*>   (imageProviderBase);
    QSize imageSize;
    QString imageId = imageURL.path().remove(0,1);
    QImage image = imageProvider->requestImage(imageId, &imageSize, imageSize); }
    

    What I get from QML camera is a preview which has a very small image size. (in my case 704 x 528)
    Is there a possibility to get the original image size ( 4608 x 3456 ) or to access the raw image data?

    dev environment:
    OS: windows 7
    dev for android version 4.4.2
    qt creator 3.5
    qt quick 2.5
    qt 5.5

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xargs1
      wrote on last edited by
      #2

      onImageSaved gives you the path to the actual image.

      C 1 Reply Last reply
      0
      • X xargs1

        onImageSaved gives you the path to the actual image.

        C Offline
        C Offline
        Cutee
        wrote on last edited by
        #3

        @xargs1
        thanks for your response.
        is it also possible to access the image data before the saving process?

        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