This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import cv2 | |
import depthai as dai | |
import numpy as np | |
import subprocess as sp | |
from os import name as osName | |
camRes = dai.ColorCameraProperties.SensorResolution.THE_12_MP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DepthAiCamera : public Camera{ | |
private: | |
std::shared_ptr<dai::node::ColorCamera> color_camera; | |
std::shared_ptr<dai::node::VideoEncoder> encoder; | |
std::shared_ptr<dai::node::XLinkOut> video_out; | |
std::shared_ptr<dai::node::XLinkIn> control; | |
std::shared_ptr<dai::DataInputQueue> control_queue_in; | |
std::shared_ptr<dai::DataOutputQueue> queue_out; | |
std::unique_ptr<dai::Device> device; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"aeLockMode": false, | |
"aeRegion": { | |
"height": 0, | |
"priority": 0, | |
"width": 0, | |
"x": 0, | |
"y": 0 | |
}, | |
"afRegion": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static T ToStructure<T>(this byte[] rawData, Endianness endianness = Endianness.LittleEndian) | |
where T : struct | |
{ | |
T result; | |
MaybeAdjustEndianness(typeof(T), rawData, endianness); | |
var handle = GCHandle.Alloc(rawData, GCHandleType.Pinned); | |
try { | |
var rawDataPtr = handle.AddrOfPinnedObject(); |