Hello, I recently got the oak-1 for a project I'm making.
A little information about the project so my request makes sense. I'm working with plants in fields like apple or wine, so I need to see as much as possible in the vertical fov and the horizontal fov matters lees, so I would like to turn the camera on the side so i get more of the plant. I use the letterboxing to get as much of the frame as possible but I can't get it to rotate it 90 degrees so I can get my fov without making a new model. The setup for the camera is:
`pipeline = dai.Pipeline()

# Define source and output
camRgb = pipeline.create(dai.node.ColorCamera)
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_12_MP)
camRgb.setInterleaved(False)
camRgb.setIspScale(1,5) # 4056x3040 -> 812x608
camRgb.setPreviewSize(812, 608)
camRgb.setIspNumFramesPool(1)
# Slightly lower FPS to avoid lag, as ISP takes more resources at 12MP
camRgb.setFps(3)

xoutIsp = pipeline.create(dai.node.XLinkOut)
xoutIsp.setStreamName("isp")
camRgb.isp.link(xoutIsp.input)

# Use ImageManip to resize to 300x300 with letterboxing
manip = pipeline.create(dai.node.ImageManip)
manip.setMaxOutputFrameSize(512*512*3) # 300x300x3
manip.initialConfig.setResizeThumbnail(512, 512)
camRgb.preview.link(manip.inputImage)

# NN to demonstrate how to run inference on full FOV frames
nn = pipeline.create(dai.node.MobileNetDetectionNetwork)
nn.setConfidenceThreshold(0.5)
nn.setBlobPath("v4.blob")
manip.out.link(nn.input)

xoutNn = pipeline.create(dai.node.XLinkOut)
xoutNn.setStreamName("nn")
nn.out.link(xoutNn.input)

xoutRgb = pipeline.create(dai.node.XLinkOut)
xoutRgb.setStreamName("rgb")
nn.passthrough.link(xoutRgb.input)

`
But when i use manip.initialConfig.setRotationDegrees(90) to rotate the image it turns out like this:

  • erik replied to this.

    erik Hi I tried implementing it like this:
    ` pipeline = dai.Pipeline()

    # Define source and output
    camRgb = pipeline.create(dai.node.ColorCamera)
    camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_12_MP)
    camRgb.setInterleaved(False)
    camRgb.setIspScale(1,5) # 4056x3040 -> 812x608
    camRgb.setPreviewSize(812, 608)
    camRgb.setIspNumFramesPool(1)
    camRgb.setBoardSocket(dai.CameraBoardSocket.RGB)
    camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.RGB)
    # Slightly lower FPS to avoid lag, as ISP takes more resources at 12MP
    camRgb.setFps(3)
    
    xoutIsp = pipeline.create(dai.node.XLinkOut)
    xoutIsp.setStreamName("isp")
    camRgb.isp.link(xoutIsp.input)
    
    # Use ImageManip to resize to 300x300 with letterboxing
    manip = pipeline.create(dai.node.ImageManip)
    manip.setMaxOutputFrameSize(812 * 608 * 3) # 300x300x3
    rgbRr = dai.RotatedRect()
    rgbRr.center.x, rgbRr.center.y = camRgb.getPreviewWidth() // 2, camRgb.getPreviewHeight() // 2
    rgbRr.size.width, rgbRr.size.height = camRgb.getPreviewHeight(), camRgb.getPreviewWidth()
    rgbRr.angle = 90
    manip.initialConfig.setCropRotatedRect(rgbRr, False)    #manip.initialConfig.setCropRect(0, 0, 1, 1)
    manip.initialConfig.setResizeThumbnail(512, 512)
    #manip.initialConfig.setRotation(-90)
    #manip.initialConfig.setRotationDegrees(90)
    
    camRgb.preview.link(manip.inputImage)
    
    # NN to demonstrate how to run inference on full FOV frames
    nn = pipeline.create(dai.node.MobileNetDetectionNetwork)
    nn.setConfidenceThreshold(0.5)
    nn.setBlobPath("v4.blob")
    manip.out.link(nn.input)
    
    xoutNn = pipeline.create(dai.node.XLinkOut)
    xoutNn.setStreamName("nn")
    nn.out.link(xoutNn.input)
    
    xoutRgb = pipeline.create(dai.node.XLinkOut)
    xoutRgb.setStreamName("rgb")
    nn.passthrough.link(xoutRgb.input)`

    I now get this:

    It might be the manip.initialConfig.setResizeThumbnail(512, 512) that does not work well with it

    • erik replied to this.

      Hi SebastianH ,
      When splitting the ImageManip into 2 (one for rotation, other for thumbnailing) it works as expected:

      Thanks, Erik

        Hello erik
        Thank you so much for the quick and very useful help 🙏
        Kind regards Sebastian