bmegli / realsense-network-hardware-video-encoder

Realsense hardware encoded color/ir H.264 and color/ir/depth HEVC streaming
Mozilla Public License 2.0
23 stars 3 forks source link

benchark L515 encoding time with alignment #22

Closed bmegli closed 4 years ago

bmegli commented 4 years ago

L515 pipelines perform additional post-processing to simulate depth units and depth clamping.

From #18 on SBCs depth+color pipelines we already barely keep up with the data rate when performing alignment.

This may need some optimization.

bmegli commented 4 years ago

Scenario:

640x480 depth + 1280x720 color at 30 fps, 8Mb + 1 Mb bitrate, alignment to depth and color

#alignment to depth
./realsense-nhve-depth-color 192.168.0.100 9768 depth 640 480 1280 720 30 500 /dev/dri/renderD128 8000000 1000000 0.0000390625 short_range.json
#alignment to color
./realsense-nhve-depth-color 192.168.0.100 9768 color 640 480 1280 720 30 500 /dev/dri/renderD128 8000000 1000000 0.0000390625 short_range.json

With short_range.json exported from realsense-viewer ShortRange preset and removed lines that we set in RNHVE

{
    "Ambient Light": 2,
    "Apd Temperature": -9999,
    "Avalanche Photo Diode": 18,
    "Confidence Threshold": 1,
    "Depth Offset": 4.5,
    "Depth Units": 0.000250000011874363,
    "Error Polling Enabled": 1,
    "Frames Queue Size": 16,
    "Freefall Detection Enabled": 1,
    "Global Time Enabled": 0.0,
    "Inter Cam Sync Mode": 0.0,
    "Invalidation Bypass": 0.0,
    "Laser Power": 87,
    "Lld Temperature": 45.3513870239258,
    "Ma Temperature": 43.7060546875,
    "Mc Temperature": 43.8653526306152,
    "Min Distance": 190,
    "Noise Filtering": 3,
    "Post Processing Sharpening": 1,
    "Pre Processing Sharpening": 0.0,
    "Sensor Mode": 0.0,
    "Visual Preset": 5,
    "Zero Order Enabled": 0.0
}
bmegli commented 4 years ago

Results

Alignment to depth

./realsense-nhve-depth-color 192.168.0.100 9768 depth 640 480 1280 720 30 500 /dev/dri/renderD128 8000000 1000000 0.0000390625 short_range.json

Alignment to color:

./realsense-nhve-depth-color 192.168.0.100 9768 color 640 480 1280 720 30 500 /dev/dri/renderD128 8000000 1000000 0.0000390625 short_range.json
bmegli commented 4 years ago

Discussion

Alignment to color is more time consuming. The reason is that that we end up with target resolution (1280x720 for color, 640x480 for depth). Also the resulting depth map when aligning to color will be 1280x720. This is somewhat representative for what we would get with L515 XGA depth (1024x768 ).

On laptop we keep up with the data rate when aligning to smaller depth (typically < 28 ms) and don't keep up when aligning to larger color (typically exceeds 33 ms a lot).

It is clear that we would also have problems on weaker SBC when aligning to color so this test is skipped.

Current naive depth post processing takes a few ms (2-3 or 4-6 for larger data).

bmegli commented 4 years ago

Conclusion

Looking at results naive post-processing takes < 5 ms. Comparing to #18 it is clear that the main villain is alignment for the larger resolution (1280x720 now vs 848x480 for D435).

L515 colored aligned depth pipeline is not usable in realtime at 30 FPS.

Depth aligned would vary between hardware.

L515 depth+color pipelines need optimization.