luxonis / depthai-experiments

Experimental projects we've done with DepthAI.
MIT License
809 stars 362 forks source link

[Feature Request] Stereo line detection + depth #411

Closed LukeSatre closed 1 year ago

LukeSatre commented 1 year ago

Hello,

I am looking for a method to apply line segment detection to L&R mono frames, and then perform disparity/depth calculations on the matched pairs of lines. The resulting output being a 3D wireframe type representation of any distinguishable edges/corners in the scene.

I understand there is not currently support for general CV functions on device. (Discussion here: https://github.com/luxonis/depthai/issues/719 )

Looking through [depthai-experiments/gen2-custom-models], I see that kornia-edge.py uses nn-based edge detection. If the kornia filter was replaced with kornia.feature.sold2_detector(), and then applied to both mono frames, could the detected lines be used in depth calculations?

(https://kornia.readthedocs.io/en/latest/models/sold2.html)

The example [depthai-expriments/gen2-triangulation] provides an outline for how disparity calculations can be performed on nn-detected key points. Could a similar approach be used for nn-detected lines (or line endpoints)?

I feel this would be very useful for a number of applications. Detected lines could enhance the clarity of depth images and point cloud reconstructions, and surfaces could be extracted from closed chains of lines for CAD applications. It could also be used in conjunction with applications such as [gen2-box_measurement].

An example of the type of results I am trying to achieve is something like Line3D++ (https://github.com/manhofer/Line3Dpp).

If anyone has additional information on similar projects, or advice/recommendations I would be very appreciative of any help.

Thank you, -Luke