Optimizes OpenCL resize and optical flow to use image extension.

Replaces PR#2595.

build_examples=OFF
Resize & Flow
check_regression=*esize*:*low*
test_modules=imgproc,video