L
Leckrosh

  • Jul 10, 2024
  • Joined May 4, 2023
  • 0 best answers
  • Hi, the issue I have is that I want to use my OAK-D Camera as a webcam but with a vertical output. I have this pipeline

        pipeline = dai.Pipeline()
    
        cam_rgb = pipeline.createColorCamera()
    
        cam_rgb.initialControl.setSharpness(settings['sharpness'])
        cam_rgb.initialControl.setLumaDenoise(settings['lumadenoise'])
        cam_rgb.initialControl.setChromaDenoise(settings['chromadenoise'])
        cam_rgb.initialControl.setManualFocus(settings['manualfocus'])
        cam_rgb.initialControl.setSaturation(settings['saturation'])
        cam_rgb.initialControl.setManualExposure(settings['exposure'], settings['iso'])
        cam_rgb.initialControl.setManualWhiteBalance(settings['whitebalance'])
    
        cam_rgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)
        cam_rgb.setInterleaved(False)
        cam_rgb.setFps(30.0)
        cam_rgb.setResolution(resolution)
        cam_rgb.setVideoSize(settings['windowwidth'], settings['windowheight'])
        cam_rgb.setImageOrientation(orientation)
       
        uvc = pipeline.createUVC()
        cam_rgb.video.link(uvc.input)
    
        config = dai.Device.Config()
        config.board.uvc = dai.BoardConfig.UVC(settings['windowwidth'], settings['windowheight'])
        config.board.uvc.frameType = dai.ImgFrame.Type.NV12
        pipeline.setBoardConfig(config.board)
    
        return pipeline

    Here if I set the video size (or even preview size) and the Board Config with a width of 1920 and height of 1080 and a THE*_1080_P* resolution, it actually works. The problem is that I want to have a 1080x1920 video size (vertical output), when I make this change there's no traceback error, it actually works and even Luxonis UVC Camera appears, but it disappears immediately and it basically keeps on the while loop,(something that do NOT occurs when I set the 1920x1080 size).

    Some other alternative that I found is that, if I set THE*_4_K* resolution and then I set the board config and the video size with a 1080x1920 I actually got the vertical output but cropped, which is not what I want.

    And finally, if I just set the resolution of 1080p and set the Board Config with 1080x1920 instead of 1920x1080, I actually got the vertical output that I'm looking for but got this weird thing:

    I also need to say that I had tried using ImageManip method to obtain the vertical output that I want, but when I make this the camera also generates the Luxonis UVC Camera module but the camera never open the image actually.

    I will be grateful with any kind of recommendation and help.

    • Hi,

      I'm trying to use depthai library on C++ with VS 2015. However, when I try to build the project RawImgFrame.hpp, and encoding.h have the next error.

      a constexpr function must contain exactly one return statement

      statement may not appear in a constexpr function

      I can't figure it out how to fix this problem. The code that I'm testing is the next:

      #include <iostream>

      // Includes common necessary includes for development using depthai library

      #include "depthai/depthai.hpp"

      int main() {

      // Create pipeline
      
      dai::Pipeline pipeline;
      
      // Define source and output
      
      auto camRgb = pipeline.create<dai::node::ColorCamera>();
      
      auto xoutVideo = pipeline.create<dai::node::XLinkOut>();
      
      xoutVideo->setStreamName("video");
      
      // Properties
      
      camRgb->setBoardSocket(dai::CameraBoardSocket::RGB);
      
      camRgb->setResolution(dai::ColorCameraProperties::SensorResolution::THE_1080_P);
      
      camRgb->setVideoSize(1920, 1080);
      
      xoutVideo->input.setBlocking(false);
      
      xoutVideo->input.setQueueSize(1);
      
      // Linking
      
      camRgb->video.link(xoutVideo->input);
      
      // Connect to device and start pipeline
      
      dai::Device device(pipeline);
      
      auto video = device.getOutputQueue("video");
      
      while (true) {
      
      	auto videoIn = video->get<dai::ImgFrame>();
      
      	// Get BGR frame from NV12 encoded video frame to show with opencv
      
      	// Visualizing the frame on slower hosts might have overhead
      
      	cv::imshow("video", videoIn->getCvFrame());
      
      	int key = cv::waitKey(1);
      
      	if (key == 'q' || key == 'Q') {
      
      		return 0;
      
      	}
      
      }
      
      return 0;

      }

      Hope somebody can help me.

      • Hi, I saw that this post ask a relatively similar concern that I have.

        In my case I'm using the OAK-D as a webcam, however I want to change the name of S_VIDEOCONTROL_1, that's the name that is set by default when I try to run rgb_uvc.py script. Is there exists some way to change that name from script when OAK-D is used as a webcam?

      • Hi everyone,

        I'm using my OAK-D as a webcam, however I'm trying to change the name of it. For example, if I try to use the UVC feature branch and run the rgb_uvc.py script and then use the camera App for windows the name of my OAK-D camera appears as S_VIDEO_CONTROL_1, but I want to rename it. Is there a way to do that and for example, rename it as MY_CAM?

        Thanks.