Announcement

Collapse
No announcement yet.

Webcam in portrait mode?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webcam in portrait mode?

    We are using the control hub with a webcam & have a need for the camera to be mounted vertically. With the old phone camera, we could choose the mode. How can we change the webcam mode so the view is shown as landscape with the camera vertical?

  • #2

    The Freight Frenzy sample Java OpModes don't provide camera axis/orientation settings by default. But they are available in the Blocks sample OpModes.

    Suggest looking at the Java preview screen in Blocks, and experiment with cameraLocationOnRobot AxesOrder, firstAngle, secondAngle and thirdAngle. Incorporate that code to the Vuforia intitialization in your Java OpMode as needed.

    Also experiment with Portrait and Landscape modes of both the DS device and the DS app.

    There may be an overall combination that provides the Camera Stream view you want.

    --------

    If you are asking about the Bounding Box pixel coordinates rather than the DS preview, you could simply adjust your use of X and Y coordinates in the recognition logic. It may help to display telemetry of recognition.imageWidth and recognition.imageHeight, to confirm orientation and aspect ratio.

    Comment


    • #3
      Thanks, we have not looked at any Blocks code, so will see if we can find anything there to help. In the past we have set the camera orientation using the OpenGLMatrix settings, which corrects measurements/axes/readings from Vuforia targets, but we are only using it for TensorFlow right now. I think our problem is more the actual field of view from the camera - We would like the physical camera to be vertical but pick up a view that is wider than tall. For example trying to scan the bar code with a vertical webcam, we can not see all 3 (or even 2 depending on distance) of the markers. With the webcam mounted normally we have a wider view.

      Comment


      • #4
        Originally posted by FLARE View Post
        We would like the physical camera to be vertical but pick up a view that is wider than tall. For example trying to scan the bar code with a vertical webcam, we can not see all 3 (or even 2 depending on distance) of the markers. With the webcam mounted normally we have a wider view.
        You are subject to the physical geometry of the optical sensor inside the camera. If the sensor is 640 x 480 pixels, for example, turning it sideways will give you 480 x 640.

        If you can place the camera to see 2 Freight Frenzy barcode locations, Autonomous detection can still work. If there's no Duck in the field of view, then you know where the Duck is.

        Comment

        Working...
        X