A structured light system, comprising: an image projecting device configured to project codewords; a receiver device including a sensor, the receiver device configured to sense the projected codewords reflected from an object; a processor configured to: generate a disparity map of the object from the sensed codewords, detect a first boundary of the object in the disparity map, identify a shadow region in the disparity map adjoining the first boundary, the shadow region including pixels with codeword outages, determine a boundary of the shadow region, wherein the boundary of the shadow region is a boundary between the shadow and the background, determine a width of the shadow region, wherein the first boundary of the object is a boundary between the object and the shadow region, determine a second boundary of the object in the disparity map, wherein the second boundary of the object is computed by displacing the boundary of the shadow by the width of the shadow toward the first boundary of the object, said second boundary representing a more accurate representation of the object boundary and change the shape of the object in the disparity map based on the second boundary; and a memory device configured to store the disparity map an image projecting device configured to project codewords; a receiver device including a sensor, the receiver device configured to sense the projected codewords reflected from an object; a processor configured to: generate a disparity map of the object from the sensed codewords, detect a first boundary of the object in the disparity map, identify a shadow region in the disparity map adjoining the first boundary, the shadow region including pixels with codeword outages, determine a boundary of the shadow region, wherein the boundary of the shadow region is a boundary between the shadow and the background, determine a width of the shadow region, wherein the first boundary of the object is a boundary between the object and the shadow region, determine a second boundary of the object in the disparity map, wherein the second boundary of the object is computed by displacing the boundary of the shadow by the width of the shadow toward the first boundary of the object, said second boundary representing a more accurate representation of the object boundary and change the shape of the object in the disparity map based on the second boundary; and a memory device configured to store the disparity map generate a disparity map of the object from the sensed codewords, detect a first boundary of the object in the disparity map, identify a shadow region in the disparity map adjoining the first boundary, the shadow region including pixels with codeword outages, determine a boundary of the shadow region, wherein the boundary of the shadow region is a boundary between the shadow and the background, determine a width of the shadow region, wherein the first boundary of the object is a boundary between the object and the shadow region, determine a second boundary of the object in the disparity map, wherein the second boundary of the object is computed by displacing the boundary of the shadow by the width of the shadow toward the first boundary of the object, said second boundary representing a more accurate representation of the object boundary and change the shape of the object in the disparity map based on the second boundary; and a memory device configured to store the disparity map