Hi all,

I have an OAK-D-PoE camera which I use in a OpenCV program. One reason why I chose the camera, was the FOV of 69x55 (HFOVxVFOV).
I got the camera working, but I just can't get the FOV right to use the 69x55 FOV (as mentioned on the product page https://shop.luxonis.com/products/oak-d-poe). Instead I get a FOV of 43.6x34.6, which is way to small for my software. How do I get to use the full FOV?
When I use the depth camera, the FOV does seem to match the depth FOV mentioned on the product page (72x49).

The code I use for the RGB camera is: (an edited version of rgb_preview.cpp)

#include <iostream>

// Includes common necessary includes for development using depthai library
#include "depthai/depthai.hpp"

int main() {
    using namespace std;
    // Create pipeline
    dai::Pipeline pipeline;

    // Define source and output
    auto camRgb = pipeline.create<dai::node::ColorCamera>();
    auto xoutRgb = pipeline.create<dai::node::XLinkOut>();

    xoutRgb->setStreamName("rgb");

    // Properties
    camRgb->setPreviewKeepAspectRatio(false);    
    camRgb->setPreviewSize(1920,1080);
    camRgb->setBoardSocket(dai::CameraBoardSocket::RGB);
    camRgb->setResolution(dai::ColorCameraProperties::SensorResolution::THE_1080_P);
    
    camRgb->setInterleaved(false);
    camRgb->setColorOrder(dai::ColorCameraProperties::ColorOrder::RGB);

    // Linking
    camRgb->preview.link(xoutRgb->input);

    // Connect to device and start pipeline
    dai::Device device(pipeline, dai::UsbSpeed::SUPER);

    cout << "Connected cameras: ";
    for(const auto& cam : device.getConnectedCameras()) {
        cout << cam << " ";
    }
    cout << endl;

    // Print USB speed
    cout << "Usb speed: " << device.getUsbSpeed() << endl;

    // Output queue will be used to get the rgb frames from the output defined above
    auto qRgb = device.getOutputQueue("rgb", 4, false);


    while(true) {
        auto inRgb = qRgb->get<dai::ImgFrame>();

        // Retrieve 'bgr' (opencv format) frame
        cv::imshow("rgb", inRgb->getCvFrame());

        int key = cv::waitKey(1);
        if(key == 'q' || key == 'Q') {
            break;
        }
    }
    return 0;
    }
  • erik replied to this.

    Hello Epsi ,
    I would suggest checking full-fov demo which uses isp output instead of the video/preview. Thoughts?
    Thanks, Erik

    • Epsi replied to this.

      erik

      Thank you!
      I converted the python demo to c++, and this looks promising. At least now i can see the complete conveyor belt.
      C++ code:

      #include "depthai/depthai.hpp"
      #include <iostream>
      #include <opencv2/opencv.hpp>
      
      int main(){
      
      	
      dai::Pipeline pipeline;
      	
      auto camRgb = pipeline.create<dai::node::ColorCamera>();
      
      
      camRgb->setResolution(dai::ColorCameraProperties::SensorResolution::THE_12_MP);
      camRgb->setInterleaved(false);
      camRgb->setIspScale(1,5);
      camRgb->setPreviewSize(812,608);
      camRgb->setColorOrder(dai::ColorCameraProperties::ColorOrder::RGB);
      camRgb->setFps(25);
      
      auto xoutIsp = pipeline.create<dai::node::XLinkOut>();
      xoutIsp->setStreamName("isp");
      camRgb->isp.link(xoutIsp->input);
      
      auto manip = pipeline.create<dai::node::ImageManip>();
      manip->setMaxOutputFrameSize(270000);
      manip->initialConfig.setResizeThumbnail(300,300);
      camRgb->preview.link(manip->inputImage);
      
      dai::Device device(pipeline);
      auto qIsp = device.getOutputQueue("isp");
      
      while(true){
      	auto frame = qIsp->get<dai::ImgFrame>();
      	cv::imshow("test", frame->getCvFrame());
      	cv::waitKey(1);
      }
      
      return 0;		
      
      }

      erik

      So full FOV is only available when using higher resolution? not on 1080p?

      • erik replied to this.

        Hello Epsi , with 1080P you are limited to 16:9 aspect ratio, whereas the sensor has almost 4:3 aspect ratio. So when 1080P is used, isp frame is cropped (a bit of top and bottom part of the image) to achieve 16:9.
        You can also use the 12MP resolution and downscale that to "near-1080P", as done on the demo here.
        Thanks, Erik