added macro with ability of returning values
refactored imgproc
Merge pull request #2207 from ilya-lavrenov:tapi_macro