Cache-friendly optimizations in RF mode. Introduced opencv interface.