System and method for validating depth data for a dimensioning operation
An example method includes: obtaining, by a depth sensor, depth data representing a distance to a target object and an environment of the target object; selecting a subset of the depth data representing a reference surface in the environment; comparing the subset of the depth data to a flatness condition; when the subset of the depth data does not meet the flatness condition: determining a faulty condition of the depth sensor, and outputting an indicator of the faulty condition of the depth sensor.
1 . A method comprising:
obtaining, by a depth sensor, depth data representing a distance to a target object and an environment of the target object;
selecting a subset of the depth data representing a reference surface in the environment; and
comparing the subset of the depth data to a flatness condition;
when the subset of the depth data does not meet the flatness condition:
determining a faulty condition of the depth sensor; and
outputting an indicator of the faulty condition of the depth sensor;
wherein selecting the subset of the depth data comprises:
segmenting the depth data into regions; and
applying criteria to one or more parameters of each region to identify one of the regions as the reference surface; and
wherein applying criteria to one or more parameters comprises:
identifying the reference surface as the region having a lowest average height;
identifying the reference surface as the region having a largest area; or
identifying the reference surface as a horizontal region having a height approximately matching a lowest height of the target object.
2 . The method of claim 1 , wherein comparing the subset of the depth data to the flatness condition comprises:
fitting a construct to the subset of the depth data; and
computing a metric representing a quality of fit of the construct to the subset of the depth data; and
when the metric exceeds a predetermined threshold value, determining that the flatness condition is met.
3 . The method of claim 2 , wherein the construct comprises a plane or a line.
4 . The method of claim 2 , further comprising: applying a mask of lines to the subset of the depth data to subsample the subset of the depth data.
5 . The method of claim 2 , wherein the metric comprises one of: a ratio of inliers to outliers and an R-squared value.
6 . The method of claim 1 , further comprising: when the subset of the depth data meets the flatness condition, sending the depth data to a dimensioning application to dimension the target object.
7 . The method of claim 1 , wherein outputting the indicator comprises prompting an operator to clean a lens of the depth sensor.
8 . A system comprising:
a depth sensor configured to obtain depth data representing a distance to a target object and an environment of the target object;
a processor interconnected with the depth sensor, the processor configured to:
select a subset of the depth data representing a reference surface in the environment; and
compare the subset of the depth data to a flatness condition;
when the subset of the depth data does not meet the flatness condition:
determine a faulty condition of the depth sensor; and
output an indicator of the faulty condition of the depth sensor;
wherein to select the subset of the depth data, the processor is configured to:
segment the depth data into regions; and
apply criteria to one or more parameters of each region to identify one of the regions as the reference surface; and
wherein to apply criteria to one or more parameters, the processor is configured to:
identify the reference surface as the region having a lowest average height;
identify the reference surface as the region having a largest area; or
identify the reference surface as a horizontal region having a height approximately matching a lowest height of the target object.
9 . The system of claim 8 , wherein to compare the subset of the depth data to the flatness condition, the processor is configured to:
fit a construct to the subset of the depth data; and
compute a metric representing a quality of fit of the construct to the subset of the depth data; and
when the metric exceeds a predetermined threshold value, determine that the flatness condition is met.
10 . The system of claim 9 , wherein the construct comprises a plane or a line.
11 . The system of claim 9 , wherein the processor is further configured to: apply a mask of lines to the subset of the depth data to subsample the subset.
12 . The system of claim 9 , wherein the metric comprises one of: a ratio of inliers to outliers and an R-squared value.
13 . The system of claim 8 , wherein the processor is further configured to: when the subset of the depth data meets the flatness condition, send the depth data to a dimensioning application to dimension the target object.
14 . The system of claim 8 , wherein to output the indicator, the processor is configured to prompt an operator to clean a lens of the depth sensor.
15 . The system of claim 8 , wherein the depth sensor and the processor are integrated into a dimensioning device.