Get Mask for Highest Layer
Function
This Procedure is mainly used to get the mask for the highest-layer. The components of the Procedure are shown as below.
Usage Scenario
Usually, this Procedure is applied when the depth situation is quite complex and should be separated into layers. It can remove invalid regions and stratify the depth map to get the mask for the highest layer.
Processing Workflow and Parameter Tuning
The workflow of this Procedure is shown below:
Filter Out Point Clouds That Exceed The Limit
Point clouds that exceed the limit should be filtered out for higher processing efficiency of subsequent Steps. Therefore, only needed areas of the depth map can be retained, which requires an ROI to be selected in the original depth map.
Double-click to enter this Procedure. Click the Set 3D ROI button in the Step Parameters panel of Invalidate Depth Pixels Outside 3D ROI and select 3D ROI in the pop-up Set ROI window.
The following show the point clouds before and after 3D ROI selection. The image on the left is the original depth map, containing many irrelevant point clouds; the image on the right is the depth map after 3D ROI selection, which no longer contains point clouds of regions outside the selected ROI.
Segment Depth Map by Depth
Segment Depth Map segments the depth map within the ROI based on each pixel’s depth and generates the corresponding mask(s).
In the Step Parameters Panel of Segment Depth Map, click the Set 2D ROI button and select 2D ROI in the pop-up Set ROI window.
Then, set Max Height Diff between Neighbouring Pixels to determine whether the neighboring pixels belong to the same segment; and set Min Segment Area to determine the valid segment.
As shown below, the image on the left is the depth map before segmentation, and that on the right is the depth map after segmentation.
Get Highest Layer Regions in Depth Map
Get Highest Layer Regions in Depth Map obtains the highest area(s) in a depth map based on the masks and masks’ depth information output from Segment Depth Map and generates the mask areas of the closest valid region to the camera under proper Layer Height. There could be one or multiple areas that satisfy this condition.
Merge Mask Images
Merge Mask Images merges the masks input from Get Highest Layer Regions in Depth Map if the input contains more than one mask to get the mask of the highest layer. The following image shows the mask of the highest layer after merging.