Confuse with camera Orientation



  • The orientation of Camera is weird

    1 : on desktop, orientation 0, the image is top down like following

    alt text

    But on mobile(android), topDown orientation become 270

    2 : When I save the image access by QAbstractVideoFilter, the image become upside down,but it is topDown on the screen(orientation is 0)

    Image become topDown

    alt text

    How should I understand orientation value?Thanks

    Codes :

    ApplicationWindow {
        id: win
        visible: true
        //width: 640
        //height: 480
        title: qsTr("Hello World")       
    
        Camera{
            id: camera
        }
    
        SSDFilter {
            id: ssd_filter
    
            onMessageChanged: {
                console.log("msg is:" + msg)
                msg_text.text = "msg is:" + msg
            }
    
            orientation: video.orientation
        }
    
        Column{
            VideoOutput {
                id: video
                source: camera
                width: win.width
                height: win.height - 20
                autoOrientation: true
                filters: [ ssd_filter ]
    
                onOrientationChanged: {
                    msg_text.text = "phone orientation:" + video.orientation
                }
            }
    
            Text{
                id: msg_text            
            }
        }
    }
    


  • I found the answer of the orientation, all I need to do is check the direction of scanline

    surfaceFormat.scanLineDirection()
    

    In object recognition task, topToBottom or bottomToTop is crucial


Log in to reply