Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Confuse with camera Orientation

    Mobile and Embedded
    1
    2
    801
    Loading More Posts
    • 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.
    • tham
      tham last edited by tham

      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            
              }
          }
      }
      
      1 Reply Last reply Reply Quote 0
      • tham
        tham last edited by

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post