T-API: imgproc refactoring