In the Kinfu instructions, it is recommended to install OpenCV 4.x with the instructions at https://github.com/roboticslab-uc3m/installation-guides/blob/master/docs/install-opencv.md. However, this does not cover OpenCV 4.x or the build flag needed to get OpenCV to build with Kinfu. (more info here)