3D reconstruction based on octree decomposition