Fixing negative depth and modification to the digitization