HI.

I have OAK D Lite.

I am developing my project using Depthai C++ library

I managed to record the data in 1920x1440 jpeg format .

I set "ColorCamera" node in "THE_12_MP" resolution connect it to the "ImageManip" node via "isp"

I configure ImageManip (manip) as follw

manip->initialConfig.setResize(1920, 1440);

manip->initialConfig.setFrameType(dai::ImgFrame::Type::NV12);

manip->setMaxOutputFrameSize(1920*1440*3);

Then I link "ImageManip out" node to a "VideoEncoder input"

The result is a jpeg image with the disired Fild Of View (FOV).

I get the "same" FOV if I set the "ImageManip" node using 4032x3040 resolution

but... if I try to output a 640x480 image I get a cropped image with reduced FOV.

Can I get the same FOV with 640x480 resolution?

Why was I able to have the same FOV with the two previous resolutions?

Thank you.

Antonio.

  • jakaskerl replied to this.
  • Hi perenzoni
    Could you try adding an isp scaling to the camera node? colorCam->setIspScale();

    Thanks,
    Jaka

    Hi perenzoni
    Aspect ratio is 4/3 so I see no issue here regarding FOV. Can you share the code you are using?

    Thanks,
    Jaka

    This is my code used for every device of my project.

    td::shared_ptr<dai::Pipeline> createPipeline(std::string nnStringPath)
    {
        // Start defining a pipeline
        auto pipeline = std::make_shared<dai::Pipeline>();
    	// Define nodes
        auto colorCam  = pipeline->create<dai::node::ColorCamera>();
        auto monoLeft  = pipeline->create<dai::node::MonoCamera>(); 
    	auto monoRight = pipeline->create<dai::node::MonoCamera>();
    	auto stereo    = pipeline->create<dai::node::StereoDepth>();
    	auto detectionNetwork = pipeline->create<dai::node::MobileNetDetectionNetwork>();
    	auto objectTracker = pipeline->create<dai::node::ObjectTracker>();
    	auto videoEncDis = pipeline->create<dai::node::VideoEncoder>();
    
    	auto manip = pipeline->create<dai::node::ImageManip>();
    	// Define output
        auto xoutRgb   = pipeline->create<dai::node::XLinkOut>();
        xoutRgb->setStreamName("rgb");
        auto xoutYuv   = pipeline->create<dai::node::XLinkOut>();
        xoutYuv->setStreamName("yuv");
    	auto xoutDisparity = pipeline->create<dai::node::XLinkOut>();
    	xoutDisparity->setStreamName("disp");
    	auto xoutTracker = pipeline->create<dai::node::XLinkOut>();
    	xoutTracker->setStreamName("track");
    
        // Properties
    	monoLeft->setCamera("left");
        monoLeft->setResolution(dai::MonoCameraProperties::SensorResolution::THE_480_P);
        monoRight->setCamera("right");
        monoRight->setResolution(dai::MonoCameraProperties::SensorResolution::THE_480_P);
        colorCam->setCamera("color");
        colorCam->setPreviewSize(300, 300);
        colorCam->setBoardSocket(dai::CameraBoardSocket::CAM_A);
        colorCam->setResolution(dai::ColorCameraProperties::SensorResolution::THE_12_MP);
        colorCam->setInterleaved(false);
    	colorCam->initialControl.setManualExposure(10000, 400);
    
    	colorCam->setFps(15.0);
        monoLeft->setFps(15.0);
        monoRight->setFps(15.0);
    
    	stereo->setDefaultProfilePreset(dai::node::StereoDepth::PresetMode::HIGH_DENSITY);
        stereo->setRectifyEdgeFillColor(0);
        stereo->initialConfig.setMedianFilter(dai::MedianFilter::KERNEL_5x5);
        stereo->setLeftRightCheck(true);
        stereo->setExtendedDisparity(false);
        stereo->setSubpixel(false);
    
        dai::Path nnPath = nnStringPath;
        detectionNetwork->setBlobPath(nnPath);
    
        detectionNetwork->setConfidenceThreshold(0.5f);
        detectionNetwork->input.setBlocking(false);
        objectTracker->setDetectionLabelsToTrack({15});
        objectTracker->setTrackerType(dai::TrackerType::ZERO_TERM_COLOR_HISTOGRAM);
        objectTracker->setTrackerIdAssignmentPolicy(dai::TrackerIdAssignmentPolicy::SMALLEST_ID);
    
        {
      		//int dimx=4000;
        	//int dimy=3000;
       		//int dimx=1920;
        	//int dimy=1440;
        	int dimx=800;
        	int dimy=600;
    
    		manip->initialConfig.setResize(dimx, dimy);
    		manip->initialConfig.setFrameType(dai::ImgFrame::Type::BGR888p);
    		manip->setMaxOutputFrameSize(dimx*dimy*3);
        }
    	videoEncDis->setDefaultProfilePreset(monoLeft->getFps(), dai::VideoEncoderProperties::Profile::MJPEG);
    
    	//links
    	colorCam->preview.link(detectionNetwork->input);
    	detectionNetwork->passthrough.link(objectTracker->inputTrackerFrame);
    	detectionNetwork->passthrough.link(objectTracker->inputDetectionFrame);
    	detectionNetwork->out.link(objectTracker->inputDetections);
    	objectTracker->passthroughTrackerFrame.link(xoutRgb->input);
    	objectTracker->out.link(xoutTracker->input);
    	monoLeft->out.link(stereo->left);
    	monoRight->out.link(stereo->right);
    	colorCam->isp.link(manip->inputImage);
    	manip->out.link(xoutYuv->input);
    		stereo->disparity.link(videoEncDis->input);
    	videoEncDis->bitstream.link(xoutDisparity->input);
    
    	return pipeline;
    }
    ``
    Changing dimx and dimy variable values I have.
    
    [upl-image-preview uuid=f5390267-dd7c-47d2-a832-e7b0777ecfa3 url=https://discuss.luxonis.com/assets/files/2025-02-17/1739780290-12608-r0800-0600.png alt={TEXT?}][upl-image-preview uuid=9339f62b-b5ba-41f6-9534-5f76ac8141e1 url=https://discuss.luxonis.com/assets/files/2025-02-17/1739781042-984982-r0800-0600.png alt={TEXT?}]
    [upl-image-preview uuid=4248b159-1804-4dbd-9b36-7dfc12f1c114 url=https://discuss.luxonis.com/assets/files/2025-02-17/1739781050-480787-r1920-1440.jpg alt={TEXT?}]
    
    I hope to explain better my FOV problem.
    
    Tanks for all.
    
    Antonio.

    Sorry.
    I made a mistake.
    Resend my images.



    The first one is 4000x3000
    the second one is 1920x1440
    the last is 800x600
    As you can see only the last is cropped.

    Tanks again

    Antonio.

      Hi perenzoni
      Could you try adding an isp scaling to the camera node? colorCam->setIspScale();

      Thanks,
      Jaka

      It works!!
      Thank you very much!!

      Antonio.