I’m currently working on a script to detect the maximum resolution of several Luxonis cameras. I want to use the getresolution() function, but I’m not sure how to do it. I would appreciate if someone could provide a Python or a C++ example.

Thanks in advance.

    Hi aruiz ,

    Here's python example, and C++ is exactly the same (API is 1:1, so you can use chatgpt to convert it to c++):

    import depthai as dai
    
    p = dai.Pipeline()
    
    left = p.create(dai.node.MonoCamera)
    left.setBoardSocket(dai.CameraBoardSocket.CAM_B)
    left.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
    print('Left resolution', left.getResolution())
    # Prints out "Left resolution SensorResolution.THE_400_P"
      a month later

      erik Thanks erik. However it seems it does not suit my needs. I was looking for a way to detect all the resolution modes an OAK is capable of.

      erik I may do a device.getCameraSensorNames() and compare the result to a list of Resolution Modes based on these hardware information.

      Thank you.