I am using Ubuntu Bionic (18.04) which comes with opencv 3.2.0. Unfortunately this version doesn't contain the dnn module that I need for importing tensorflow models and running inference (supported in opencv 3.4.1). I am tied to this opencv version and can't install a newer one, neither can I install tensorflow. So my only way is to compile dnn separately.
I downloaded the source of the latest opecv and tried to find a way to compile only the dnn module while linking it to opencv core and imgproc that are already installed (from opencv 3.2.0) But I faced a lot of CMake magic that I could not understand until now.
Could anyone give me some hints on how to do that? And is it possible at all to compile dnn from 3.4.1 and link it to opencv 3.2.0?