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
# Note: install requirement: python3 -m pip install pidng | |
# If you get: SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats | |
# for now you may need to use python older than 3.10, so for example: | |
# python3.9 -m pip install pidng | |
# python3.9 to_dng.py capture_raw_1920x1080_93_10bit.bw -rot | |
from pidng.core import RAW2DNG, DNGTags, Tag | |
from pidng.defs import * | |
import numpy as np |
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 numpy as np | |
import cv2 | |
import queue | |
# Create pipeline | |
pipeline = dai.Pipeline() |
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 datetime import datetime, timedelta | |
import cv2 | |
import depthai as dai | |
try: | |
from loguru import logger | |
except ImportError: | |
import logging as logger |
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 sys | |
import cv2 | |
import numpy as np | |
if len(sys.argv) < 3: | |
raise RuntimeError('Please provide left and right image files as params') | |
print('Use left-click, `w` and `s` to move line drawn') | |
img1 = cv2.imread(sys.argv[1]) | |
img2 = cv2.imread(sys.argv[2]) | |
stacked = np.concatenate((img1, img2), axis=1) |
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
''' | |
Pretty-prints the raw-strings output of scripts. | |
Usage: | |
Place this script in the same directory as your main script, | |
say that's named `file.py`, then provide the script name | |
as parameter, but omitting the `.py` extension: | |
python3 pretty.py file | |
''' |
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
''' Current output: | |
6: fps: 1.420, latency: 0.062988 s, next exposure will start in 0.541045 s | |
7: fps: 1.420, latency: 0.062930 s, next exposure will start in 0.541103 s | |
8: fps: 1.420, latency: 0.063203 s, next exposure will start in 0.54083 s | |
Sent capture-still command. Last preview frame sequence number was: 8 | |
Waiting before trigger (+1 extra frame): 1.2446962702088058 | |
trigger flash | |
9: fps: 1.420, latency: 0.720992 s, next exposure will start in -0.116959 s | |
10: fps: 1.420, latency: 0.089930 s, next exposure will start in 0.514103 s | |
11: fps: 1.420, latency: 0.063053 s, next exposure will start in 0.540981 s |
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 | |
# Key controls: | |
# q - quit | |
# c - capture | |
import cv2 | |
import numpy as np | |
import time |
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 numpy as np | |
pipeline = dai.Pipeline() | |
left = pipeline.createMonoCamera() | |
left.setBoardSocket(dai.CameraBoardSocket.LEFT) |