depthmap processing algorythm from elsamuko - improvement