Imported from https://github.com/haofeixu/rdn4depth