diff --git a/apps/default-app/main.py b/apps/default-app/main.py index 1bb7b9e9a..222c4f66a 100644 --- a/apps/default-app/main.py +++ b/apps/default-app/main.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import cv2 import depthai as dai -from depthai_nodes.node import ApplyColormap +from depthai_nodes.node import ApplyDepthColormap from typing import Optional from utils.arguments import initialize_argparser @@ -10,7 +10,6 @@ visualizer = dai.RemoteConnection(httpPort=8082) device = dai.Device(dai.DeviceInfo(args.device)) if args.device else dai.Device() -STEREO_RESOLUTION = (800, 600) NN_DIMENSIONS = (512, 288) if not device.setIrLaserDotProjectorIntensity(1): @@ -73,11 +72,22 @@ right=right_cam.requestFullResolutionOutput(dai.ImgFrame.Type.NV12), presetMode=dai.node.StereoDepth.PresetMode.DEFAULT, ) - stereo.setDepthAlign(dai.CameraBoardSocket.CAM_A) - if platform == dai.Platform.RVC2: - stereo.setOutputSize(*STEREO_RESOLUTION) - coloredDepth = pipeline.create(ApplyColormap).build(stereo.disparity) + # RVC4 does not support stereo.setDepthAlign, ImageAlign node used instead + if platform == dai.Platform.RVC4: + cam_out = cameraNode.requestOutput( + (640, 480), type=dai.ImgFrame.Type.NV12, enableUndistortion=True + ) + align = pipeline.create(dai.node.ImageAlign) + stereo.depth.link(align.input) + cam_out.link(align.inputAlignTo) + coloredDepth = pipeline.create(ApplyDepthColormap).build( + align.outputAligned + ) + else: + stereo.setDepthAlign(dai.CameraBoardSocket.CAM_A) + stereo.setOutputSize(800, 600) + coloredDepth = pipeline.create(ApplyDepthColormap).build(stereo.disparity) coloredDepth.setColormap(cv2.COLORMAP_JET) visualizer.addTopic("Depth", coloredDepth.out) diff --git a/apps/default-app/requirements.txt b/apps/default-app/requirements.txt index e560419f4..dd5f4c32d 100644 --- a/apps/default-app/requirements.txt +++ b/apps/default-app/requirements.txt @@ -1,4 +1,4 @@ -depthai==3.0.0 -depthai-nodes==0.3.4 +depthai==3.4.0 +depthai-nodes==0.4.0 opencv-python-headless==4.10.0.84 numpy>=1.22 diff --git a/apps/p2p-measurement/backend/src/main.py b/apps/p2p-measurement/backend/src/main.py index 5cf989720..3cd751655 100644 --- a/apps/p2p-measurement/backend/src/main.py +++ b/apps/p2p-measurement/backend/src/main.py @@ -1,5 +1,5 @@ import depthai as dai -from depthai_nodes.node import ApplyColormap +from depthai_nodes.node import ApplyDepthColormap import numpy as np import cv2 @@ -58,9 +58,8 @@ stereo.depth.link(align.input) cam_out.link(align.inputAlignTo) - coloredDepth = pipeline.create(ApplyColormap).build(align.outputAligned) + coloredDepth = pipeline.create(ApplyDepthColormap).build(align.outputAligned) coloredDepth.setColormap(cv2.COLORMAP_JET) - coloredDepth.setDepthPreset() point_tracker = pipeline.create( PointTracker, frame_width=FRAME_WIDTH, frame_height=FRAME_HEIGHT diff --git a/apps/p2p-measurement/backend/src/requirements.txt b/apps/p2p-measurement/backend/src/requirements.txt index c03202ce6..d82bea69b 100644 --- a/apps/p2p-measurement/backend/src/requirements.txt +++ b/apps/p2p-measurement/backend/src/requirements.txt @@ -1,5 +1,4 @@ -depthai==3.2.1 -#depthai-nodes==0.3.7 -depthai-nodes @ git+https://github.com/luxonis/depthai-nodes.git@c0f382fbe6514b62b8e98b6b805e5023c9c9438c # depth visualization in ApplyColormap +depthai==3.3.0 +depthai-nodes==0.4.0 opencv-contrib-python==4.12.0.88 numpy>=1.22 \ No newline at end of file diff --git a/depth-measurement/calc-spatial-on-host/main.py b/depth-measurement/calc-spatial-on-host/main.py index fb0855fbe..accec61ad 100755 --- a/depth-measurement/calc-spatial-on-host/main.py +++ b/depth-measurement/calc-spatial-on-host/main.py @@ -4,7 +4,7 @@ import depthai as dai from utils.roi_control import ROIControl from utils.arguments import initialize_argparser -from depthai_nodes.node import ApplyColormap +from depthai_nodes.node import ApplyDepthColormap from utils.measure_distance import MeasureDistance @@ -28,7 +28,7 @@ monoLeft, monoRight, presetMode=dai.node.StereoDepth.PresetMode.DEFAULT ) - depth_color_transform = pipeline.create(ApplyColormap).build(stereo.disparity) + depth_color_transform = pipeline.create(ApplyDepthColormap).build(stereo.disparity) depth_color_transform.setColormap(cv2.COLORMAP_JET) measure_distance = pipeline.create(MeasureDistance).build( diff --git a/depth-measurement/calc-spatial-on-host/oakapp.toml b/depth-measurement/calc-spatial-on-host/oakapp.toml index f656231f6..e3ef3bc1a 100644 --- a/depth-measurement/calc-spatial-on-host/oakapp.toml +++ b/depth-measurement/calc-spatial-on-host/oakapp.toml @@ -13,3 +13,12 @@ prepare_build_container = [] build_steps = [] entrypoint = ["bash", "-c", "python3 -u /app/main.py"] + +[base_image] +api_url = "https://registry-1.docker.io" +service = "registry.docker.io" +oauth_url = "https://auth.docker.io/token" +auth_type = "repository" +auth_name = "luxonis/oakapp-base" +image_name = "luxonis/oakapp-base" +image_tag = "1.2.6" \ No newline at end of file diff --git a/depth-measurement/calc-spatial-on-host/requirements.txt b/depth-measurement/calc-spatial-on-host/requirements.txt index cf3ffa17a..f5f5d5946 100644 --- a/depth-measurement/calc-spatial-on-host/requirements.txt +++ b/depth-measurement/calc-spatial-on-host/requirements.txt @@ -1,4 +1,4 @@ -depthai==3.0.0 -depthai-nodes==0.3.4 +depthai==3.4.0 +depthai-nodes==0.4.0 opencv-python-headless==4.10.0.84 numpy>=1.22 \ No newline at end of file diff --git a/depth-measurement/stereo-runtime-configuration/main.py b/depth-measurement/stereo-runtime-configuration/main.py index 84727ec28..8c1baff5c 100644 --- a/depth-measurement/stereo-runtime-configuration/main.py +++ b/depth-measurement/stereo-runtime-configuration/main.py @@ -1,6 +1,6 @@ import cv2 import depthai as dai -from depthai_nodes.node import ApplyColormap +from depthai_nodes.node import ApplyDepthColormap from utils.arguments import initialize_argparser from utils.stereo_config_controller import StereoConfigController @@ -36,7 +36,7 @@ stereo_controller = pipeline.create(StereoConfigController).build(preview=preview) stereo_controller.out_cfg.link(stereo.inputConfig) - depth_color = pipeline.create(ApplyColormap).build(arr=stereo.disparity) + depth_color = pipeline.create(ApplyDepthColormap).build(stereo.disparity) depth_color.setColormap(cv2.COLORMAP_JET) sync = pipeline.create(dai.node.Sync) diff --git a/depth-measurement/stereo-runtime-configuration/oakapp.toml b/depth-measurement/stereo-runtime-configuration/oakapp.toml index 158cb23ab..0c05f6202 100644 --- a/depth-measurement/stereo-runtime-configuration/oakapp.toml +++ b/depth-measurement/stereo-runtime-configuration/oakapp.toml @@ -13,3 +13,12 @@ prepare_build_container = [] build_steps = [] entrypoint = ["bash", "-c", "python3 -u /app/main.py"] + +[base_image] +api_url = "https://registry-1.docker.io" +service = "registry.docker.io" +oauth_url = "https://auth.docker.io/token" +auth_type = "repository" +auth_name = "luxonis/oakapp-base" +image_name = "luxonis/oakapp-base" +image_tag = "1.2.6" \ No newline at end of file diff --git a/depth-measurement/stereo-runtime-configuration/requirements.txt b/depth-measurement/stereo-runtime-configuration/requirements.txt index a82162f68..8f057f10a 100644 --- a/depth-measurement/stereo-runtime-configuration/requirements.txt +++ b/depth-measurement/stereo-runtime-configuration/requirements.txt @@ -1,3 +1,3 @@ -depthai==3.0.0 -depthai-nodes==0.3.4 -opencv-python-headless~=4.10.0 +depthai==3.4.0 +depthai-nodes==0.4.0 +opencv-python-headless~=4.10.0 \ No newline at end of file diff --git a/neural-networks/depth-estimation/crestereo-stereo-matching/main.py b/neural-networks/depth-estimation/crestereo-stereo-matching/main.py index c15397f73..8a16ecc0f 100644 --- a/neural-networks/depth-estimation/crestereo-stereo-matching/main.py +++ b/neural-networks/depth-estimation/crestereo-stereo-matching/main.py @@ -1,5 +1,6 @@ +import cv2 import depthai as dai -from depthai_nodes.node import ApplyColormap, ParsingNeuralNetwork +from depthai_nodes.node import ApplyColormap, ApplyDepthColormap, ParsingNeuralNetwork from utils.arguments import initialize_argparser _, args = initialize_argparser() @@ -87,12 +88,16 @@ demux.outputs["right"].link(nn.inputs["right"]) # color stereo disparity - disparity_coloring = pipeline.create(ApplyColormap).build(stereo.disparity) - disparity_coloring.setColormap(15) # cv2.COLORMAP_PLASMA + disparity_coloring = pipeline.create(ApplyDepthColormap).build(stereo.disparity) + disparity_coloring.setColormap(cv2.COLORMAP_PLASMA) + + # color nn output + nn_coloring = pipeline.create(ApplyColormap).build(nn.out) + nn_coloring.setColormap(cv2.COLORMAP_PLASMA) # visualization visualizer.addTopic("Stereo Disparity", disparity_coloring.out) - visualizer.addTopic("NN", nn.out) + visualizer.addTopic("NN", nn_coloring.out) print("Pipeline created.") diff --git a/neural-networks/depth-estimation/crestereo-stereo-matching/oakapp.toml b/neural-networks/depth-estimation/crestereo-stereo-matching/oakapp.toml index 67505976f..934da188e 100644 --- a/neural-networks/depth-estimation/crestereo-stereo-matching/oakapp.toml +++ b/neural-networks/depth-estimation/crestereo-stereo-matching/oakapp.toml @@ -14,4 +14,13 @@ build_steps = [] depthai_models = { yaml_path = "./depthai_models" } -entrypoint = ["bash", "-c", "python3 -u /app/main.py"] \ No newline at end of file +entrypoint = ["bash", "-c", "python3 -u /app/main.py"] + +[base_image] +api_url = "https://registry-1.docker.io" +service = "registry.docker.io" +oauth_url = "https://auth.docker.io/token" +auth_type = "repository" +auth_name = "luxonis/oakapp-base" +image_name = "luxonis/oakapp-base" +image_tag = "1.2.5" \ No newline at end of file diff --git a/neural-networks/depth-estimation/crestereo-stereo-matching/requirements.txt b/neural-networks/depth-estimation/crestereo-stereo-matching/requirements.txt index df8d7aa85..1d4d576f6 100644 --- a/neural-networks/depth-estimation/crestereo-stereo-matching/requirements.txt +++ b/neural-networks/depth-estimation/crestereo-stereo-matching/requirements.txt @@ -1,4 +1,4 @@ -depthai==3.0.0 -depthai-nodes==0.3.4 +depthai==3.4.0 +depthai-nodes==0.4.0 opencv-python-headless~=4.10.0 numpy>=1.22 \ No newline at end of file diff --git a/tutorials/camera-stereo-depth/main.py b/tutorials/camera-stereo-depth/main.py index 5f7d103e9..1684f9120 100755 --- a/tutorials/camera-stereo-depth/main.py +++ b/tutorials/camera-stereo-depth/main.py @@ -1,6 +1,6 @@ import depthai as dai from utils.arguments import initialize_argparser -from depthai_nodes.node import ApplyColormap +from depthai_nodes.node import ApplyDepthColormap import cv2 _, args = initialize_argparser() @@ -23,11 +23,11 @@ color_output = color.requestOutput( color_resolution, dai.ImgFrame.Type.NV12, fps=args.fps_limit ) - left_output = left.requestFullResolutionOutput( - dai.ImgFrame.Type.NV12, fps=args.fps_limit + left_output = left.requestOutput( + size=(640, 480), type=dai.ImgFrame.Type.NV12, fps=args.fps_limit ) - right_output = right.requestFullResolutionOutput( - dai.ImgFrame.Type.NV12, fps=args.fps_limit + right_output = right.requestOutput( + size=(640, 480), type=dai.ImgFrame.Type.NV12, fps=args.fps_limit ) stereo = pipeline.create(dai.node.StereoDepth).build( @@ -40,8 +40,7 @@ stereo.setExtendedDisparity(True) stereo.setLeftRightCheck(True) - depth_parser = pipeline.create(ApplyColormap).build(stereo.disparity) - # depth_parser.setMaxValue(int(stereo.initialConfig.getMaxDisparity())) # NOTE: Uncomment when DAI fixes a bug + depth_parser = pipeline.create(ApplyDepthColormap).build(stereo.disparity) depth_parser.setColormap(cv2.COLORMAP_JET) encoder = pipeline.create(dai.node.VideoEncoder) diff --git a/tutorials/camera-stereo-depth/requirements.txt b/tutorials/camera-stereo-depth/requirements.txt index 0b6e816ee..ae2be002e 100644 --- a/tutorials/camera-stereo-depth/requirements.txt +++ b/tutorials/camera-stereo-depth/requirements.txt @@ -1,4 +1,4 @@ -depthai==3.0.0 -depthai-nodes==0.3.4 +depthai==3.4.0 +depthai-nodes==0.4.0 numpy>=1.22 opencv-python-headless~=4.10.0 \ No newline at end of file