range-filter
Last updated
Last updated
Since depth camera can measure the distance for each pixel. We can easily build a range filter, focusing of specific distance of data that we want are interesting in.
Modify from opencv_viewer. After getting color and depth frame, we use opencv threshold
function to filter out distance less than threasholdValueDown
and greater than thresholdValueUp
.
The distance units used by the SDK vary depending on the camera. In this example, we use the LIPSEdge L215 camera, which uses millimeters (mm) as the unit. So, here we set the distance limit from 500mm to 1500mm.
Then we do the threshold again, to convert all the remaining depth value to 1, and the other value to 0. This create a region of interest (white area) base on distance.
Finally, convert depth
and thres
to gray scale value then display all of it