Support of OpenCV versions in OTB (v2, v3 and v4)
As of today, both OpenCV 2 and OpenCV 3 are supported in otb. The whole ml
module is different in the two version, which is the module used in otb (in addition to the core
module). In practice for each classifier two versions of the code is implemented, one for OpenCV 2 and one for OpenCV 3. This makes the code hard to maintain, and hard to test (a lot of tests need to have one baseline for each version).
As OpenCV2 has been around for some time, I think we can drop the support for OpenCV2
Also, OpenCV 4 has been releases (last version is OpenCV 4.1.1). For now, OTB doesn't compile with v4.1.1, but I don't this it should be hard to make it compatible, as there is no major API change (the main change is the switch to c++ 11).