Merge 2.4 into master

Original pull requests:

* #2509 from euphrat:mog2_bgimg_gray
* #2692 from 1Hyena:2.4
* #2699 from GregoryMorse:patch-1
* #2701 from thoinvil:BugfixFilterEngineApplyROI
* #2714 from asmorkalov:ocv_cmake_config
* #2717 from StevenPuttemans:2.4
* #2719 from yashdv:patch-1
* #2721 from zarrabeitia:2.4
* #2727 from StevenPuttemans:bug_3484
* #2728 from StevenPuttemans:bug_3434
* #2729 from StevenPuttemans:bug_3252
* #2730 from StevenPuttemans:bug_2740
* #2731 from StevenPuttemans:bug_2626
* #2733 from StevenPuttemans:bug_2162
* #2735 from StevenPuttemans:bug_2000
* #2737 from jet47:fix-opencv-cmake-config
* #2738 from kevmitch:2.4
* #2739 from StevenPuttemans:bug_1523
* #2743 from StevenPuttemans:bugfix_3549
* #2744 from jet47:kmeans-fix
* #2745 from yashdv:patch-3
* #2747 from jet47:gpu-resize-stream-fix
* #2748 from jet47:fix-bug-3690
* #2753 from shahurik:2.4
* #2754 from thoinvil:patch-1