Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android qcamera 5.4 beta
Forum Updated to NodeBB v4.3 + New Features

Android qcamera 5.4 beta

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 3 Posters 3.4k 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.
  • V Offline
    V Offline
    vincent tariel
    wrote on last edited by
    #1

    As said in "this post":http://qt-project.org/forums/viewthread/46837 the QCamera class should be usable in Qt 5.4 . But with the beta version of QT 5.4, I test this simple code and also "this example.":http://qt-project.org/doc/qt-5/qtmultimediawidgets-camera-example.html and I have a black screen each time. Do you have any ideas ?
    Thanks a lot

    @#include "mainwindow.h"
    #include <QApplication>
    #include<QCamera>
    #include<QCameraViewfinder>
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);

    QCamera camera(QCamera::FrontFace);
    QCameraViewfinder viewfinder;
    camera.setViewfinder(&viewfinder);
    camera.setCaptureMode(QCamera::CaptureViewfinder);
    camera.start();
    viewfinder.show();
    MainWindow mainWindow;
    mainWindow.setCentralWidget(&viewfinder);
    mainWindow.show();
    return a.exec&#40;&#41;;
    

    }@

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You misread that post, I suggested to test against 5.4 to check whether it was working, nothing more.

      Currently, QML is the way to access the camera. However, you can embed a QML view like e.g. "here":http://www.ics.com/blog/combining-qt-widgets-and-qml-qwidgetcreatewindowcontainer

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • metaDomM Offline
        metaDomM Offline
        metaDom
        wrote on last edited by
        #3

        Faced a problem regarding the same topic. Could you please confirm the bug if it happens for you also?

        https://bugreports.qt-project.org/browse/QTBUG-41467

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vincent tariel
          wrote on last edited by
          #4

          [quote author="SGaist" date="1414017812"]Hi and welcome to devnet,

          You misread that post, I suggested to test against 5.4 to check whether it was working, nothing more.

          Currently, QML is the way to access the camera. However, you can embed a QML view like e.g. "here":http://www.ics.com/blog/combining-qt-widgets-and-qml-qwidgetcreatewindowcontainer

          Hope it helps[/quote]
          Thanks SGaist !
          I want to operate some computer vision routines in real time. So I need to access the frames of the video as in OpenCV camera. I spend some times with QML but I only succeed to process the capture frame (see the following code). So because the frame is saved in the file system, we cannot process in real-time.

          @
          import QtQuick 2.0
          import QtMultimedia 5.0
          import ImageProcessor 1.0
          Rectangle {
          width: 800
          height: 600
          color: "black"
          state: "PhotoCapture"
          Camera {
          id: camera
          captureMode: Camera.CaptureStillImage
          imageCapture {
          onImageCaptured: {
          imageProcessor.processImage(preview)
          }
          }

              focus {
                  focusMode: Camera.FocusAuto
              }
          }
          
          VideoOutput {
              source: camera
              focus : visible // to receive focus and capture key events when visible
              anchors.fill: parent
          }
          

          ImageProcessor{
          id: imageProcessor
          }
          Timer {
          interval: 1000; running: true; repeat: true
          onTriggered: {
          camera.imageCapture.resolution = Qt.size(1280,960)
          camera.imageCapture.capture()
          }
          }
          }
          @
          That's why I waited the "the beta of QT 5.4":http://doc-snapshot.qt-project.org/qt5-5.4/cameraoverview.html

          [quote author="metaDom" date="1414021829"]Faced a problem regarding the same topic. Could you please confirm the bug if it happens for you also?

          https://bugreports.qt-project.org/browse/QTBUG-41467[/quote]

          Yes I try your code and I have the same bug as you.

          I hope that Qt debeloppers will solve this problem because real-time computer vision with Qt android will be fantastic !

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            What library will you use for your processing ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vincent tariel
              wrote on last edited by
              #6

              [quote author="SGaist" date="1414105456"]What library will you use for your processing ?[/quote]
              I use "Population library ":http://www.population-image.fr/wordpress/
              It is an open-source library and a good alternative of OpenCV.

              I cross my fingers for the release of QT 5.4 to have QWidget to access camera.

              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