This file contains hidden or 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
import depthai as dai | |
import threading | |
import contextlib | |
import cv2 | |
import time | |
from queue import Queue | |
run = True | |
# This can be customized to pass multiple parameters | |
def getPipeline(stereo): |
This file contains hidden or 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 | |
# Create pipeline | |
pipeline = dai.Pipeline() | |
cfg = dai.BoardConfig() | |
cfg.emmc = True |
This file contains hidden or 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 depthai as dai | |
# Create pipeline | |
pipeline = dai.Pipeline() | |
cfg = dai.BoardConfig() | |
cfg.emmc = True | |
cfg.logPath = '/media/mmcsd-0-0/depthai_log_file.txt' |
This file contains hidden or 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 python | |
import cv2 | |
import numpy as np | |
from enum import IntEnum | |
class Position(IntEnum): | |
""" | |
Where on frame do we want to print text. | |
""" |
This file contains hidden or 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 time | |
# Create pipeline | |
pipeline = dai.Pipeline() | |
# Define source and output |
This file contains hidden or 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
import depthai as dai | |
from depthai_sdk import FPSHandler as FPS | |
# Create pipeline | |
pipeline = dai.Pipeline() | |
pipeline.setXLinkChunkSize(0) | |
# Define source and output | |
camRgb = pipeline.create(dai.node.ColorCamera) | |
camRgb.setFps(30) |
This file contains hidden or 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 math | |
class BoundingBox: | |
xmin: float | |
ymin: float | |
xmax: float |
This file contains hidden or 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 depthai as dai | |
import cv2 | |
# Start defining a pipeline | |
pipeline = dai.Pipeline() | |
cfg = dai.BoardConfig() | |
cfg.emmc = True | |
cfg.logPath = '/media/mmcsd-0-0/depthai_log_file.txt' | |
config = dai.Device.Config() |
This file contains hidden or 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 | |
from depthai_sdk import FPSHandler | |
# Create pipeline | |
pipeline = dai.Pipeline() | |
pipeline.setXLinkChunkSize(0) | |
# Define sources and outputs | |
monoLeft = pipeline.create(dai.node.MonoCamera) |
This file contains hidden or 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
from MultiMsgSync import TwoStageHostSeqSync | |
import blobconverter | |
import cv2 | |
import depthai as dai | |
import numpy as np | |
def frame_norm(frame, bbox): | |
normVals = np.full(len(bbox), frame.shape[0]) | |
normVals[::2] = frame.shape[1] | |
return (np.clip(np.array(bbox), 0, 1) * normVals).astype(int) |