depthai-python icon indicating copy to clipboard operation
depthai-python copied to clipboard

Depth accuracy inquiry

Open glitchyordis opened this issue 2 years ago • 3 comments

Hi this is a continuation from https://discuss.luxonis.com/d/1339-depth-accuracy-inquiry. I couldn't upload the videos on the discussion forum so I uploaded them here.

Videos

vid.zip vid(no shade).zip

code used to record on Oak-D PRO AF

from depthai_sdk import OakCamera, RecordType

with OakCamera() as oak:
    color = oak.create_camera('color', resolution='1080P', fps=20, encode='H265')
    left = oak.create_camera('left', resolution='400p', fps=20, encode='H265')
    right = oak.create_camera('right', resolution='400p', fps=20, encode='H265')

    # # Synchronize & save all (encoded) streams
    oak.record([color.out.encoded, left.out.encoded, right.out.encoded], './', RecordType.VIDEO)
    # Show color stream
    oak.visualize([color.out.camera], scale=1/3, fps=True)
    oak.visualize([left.out.camera], scale=2/3, fps=True)
    oak.visualize([right.out.camera], scale=2/3, fps=True)

    oak.start(blocking=True)

Physical setup

Pretty sure everything is flat image

glitchyordis avatar Apr 19 '23 02:04 glitchyordis

Hi @glitchyordis , For others reading this, I'd first suggest reading Improving stereo depth quality tutorial. I checked your recording, to me, it looks like (very) bad texture. If metal plate, or camera would be rotated by 90deg it would likely be much better - as on aluminum, you have horizontal lines, which makes for very bad texture for (horizontal) disparity matching. Accuracy seems to be correct though. So the mat is 56cm, while the plate is 53cm (exactly 3cm difference). My guess would be that it is eg. 1cm error, plus about 2cm of measurement error on your side. Thoughts? image image

Erol444 avatar Apr 19 '23 15:04 Erol444

Hi @glitchyordis , For others reading this, I'd first suggest reading Improving stereo depth quality tutorial. I checked your recording, to me, it looks like (very) bad texture. If metal plate, or camera would be rotated by 90deg it would likely be much better - as on aluminum, you have horizontal lines, which makes for very bad texture for (horizontal) disparity matching. Accuracy seems to be correct though. So the mat is 56cm, while the plate is 53cm (exactly 3cm difference). My guess would be that it is eg. 1cm error, plus about 2cm of measurement error on your side. Thoughts? image image

Hi @Erol444,

Thanks for the input; yeah it did improve when we turn things 90 degrees. May I know how to perform the reconstruction of the depth map from the recording of L and R cam?

glitchyordis avatar May 19 '23 01:05 glitchyordis

Hi @glitchyordis , You can use SDK's Replay functionality: https://docs.luxonis.com/projects/sdk/en/latest/features/replaying/ So if you create 2 cameras (left, right) and use Replay, it will actually source images from the video files instead the actual cameras. Then you can create Stereo component, which would take those frames and reconstruct them:

from depthai_sdk import OakCamera, RecordType

with OakCamera(replay='D:/Downloads/2-18443010A14E940F00') as oak:
    left = oak.create_camera('left')
    right = oak.create_camera('right')

    stereo = oak.create_stereo(left=left, right=right)

    oak.visualize(stereo.out.depth)

    oak.start(blocking=True)

Could you perhaps also confirm the depth accuracy, so we can close this issue? Thanks, Erik

Erol444 avatar May 19 '23 15:05 Erol444