Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdk pointcloud #989

Merged
merged 19 commits into from
May 26, 2023
Merged

Sdk pointcloud #989

merged 19 commits into from
May 26, 2023

Conversation

Erol444
Copy link
Member

@Erol444 Erol444 commented Apr 5, 2023

TODO:

  • docs
  • example
  • find optimal stereo postprocessing filters, try open3d's voxelization and removing statistical outliers (already played around with it)

Minimal example with rerun visualization:

import cv2
from depthai_sdk import OakCamera
from depthai_sdk.classes.packets import PointcloudPacket, FramePacket
import rerun as rr

import subprocess
subprocess.Popen(["rerun", "--memory-limit", "200MB"])
rr.init("Rerun ", spawn=False)
rr.connect()
def callback(packet: PointcloudPacket):
    colors = cv2.cvtColor(packet.color_frame.getCvFrame(), cv2.COLOR_BGR2RGB)
    rr.log_image('Color Image', colors)
    points = packet.points.reshape(-1, 3)
    rr.log_points("Pointcloud", points, colors=colors.reshape(-1, 3))

with OakCamera() as oak:
    pcl = oak.create_pointcloud()
    oak.callback(pcl, callback=callback)
    oak.start(blocking=True)

subpixel_layering

@Erol444
Copy link
Member Author

Erol444 commented Apr 24, 2023

Updated depth visualization - convert to disparity first instead of normalization/histogram. Mouse overlay now looks like this for depth:

image

@Erol444
Copy link
Member Author

Erol444 commented Apr 24, 2023

Copying from luxonis/depthai-python#809, depth visualization:
Processing time, code here: https://pastebin.com/HgjsdTwK. For depthai-python examples I'd use proposed approach, as depth-to-disp takes 30LoC. In SDK we will rather use depth-to-disp.

400P:
depth to disp avrg: 2.5ms
depth percentile (my method) avrg: 4 ms
normalize (current method): 1ms
800P:
percentile 15ms
normalize: 2.5ms
depth to disp: 10ms

@Erol444
Copy link
Member Author

Erol444 commented May 5, 2023

0_depth.2023-05-05.16-17-54.mp4

@Erol444 Erol444 marked this pull request as ready for review May 25, 2023 11:19
Copy link
Contributor

@zrezke zrezke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Erol444 Erol444 merged commit b74d54a into develop May 26, 2023
@Erol444 Erol444 deleted the sdk_pointcloud branch May 26, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants