QML camera feed is reversed
-
Hello, I just started developing a simple image processing app with qml and python and had question regarding setting up the camera feed.
My Main.qml file currently has:
import QtQuick 2.7 import QtMultimedia 5.4 import Ubuntu.Components 1.3 import QtQuick.Layouts 1.3 import Qt.labs.settings 1.0 import io.thp.pyotherside 1.3 MainView { id: root objectName: 'mainView' applicationName: 'example-hello.none' automaticOrientation: true width: units.gu(45) height: units.gu(75) Page { id:main anchors.fill: parent width: 640 height: 360 header: PageHeader { id: header title: i18n.tr('Camera') } Camera { id: camera imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash exposure { exposureCompensation: -1.0 exposureMode: Camera.ExposurePortrait } flash.mode: Camera.FlashRedEyeReduction imageCapture { onImageCaptured: { photoPreview.source = preview // Show the preview in an Image } } transform: Rotation { origin.x: 25; origin.y: 25; angle: 45} } VideoOutput { source: camera anchors.fill: parent focus : visible // to receive focus and capture key events when visible } Image { id: photoPreview } } //declare a variable to import a Python module Python { id: python //connect main.py Component.onCompleted: { addImportPath(Qt.resolvedUrl('../src/')); importModule_sync("main") } onError: { console.log('python error: ' + traceback); } } }
Camera is working but the view is flipped, I tried using a
Transform
to rotate it but the app crashes, what am I missing here? also is it possible to send the camera feed in real time to a python function in mymain.py
file that I linked at the end?Testing device : Volla Phone
note: normal camera app is working properly, so the issue is code related