<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.4.3</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">the bindings generator seems not to respect the <code class="notranslate">HAVE_OPENCV_*</code> defines.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">in cmake set:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="BUILD_LIST=features2d,python3"><pre class="notranslate"><code class="notranslate">BUILD_LIST=features2d,python3
</code></pre></div>
<p dir="auto">you will get a compile error like</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="opencv/build/modules/python_bindings_generator/pyopencv_generated_types.h:710:46: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
 template&lt;&gt; PyObject* pyopencv_from(const Ptr&lt;cv::FlannBasedMatcher&gt;&amp; r)"><pre class="notranslate"><code class="notranslate">opencv/build/modules/python_bindings_generator/pyopencv_generated_types.h:710:46: error: ‘FlannBasedMatcher’ is not a member of ‘cv’
 template&lt;&gt; PyObject* pyopencv_from(const Ptr&lt;cv::FlannBasedMatcher&gt;&amp; r)
</code></pre></div>
<p dir="auto">as the generator still picks up code guarded by</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#if defined(HAVE_OPENCV_FLANN)"><pre class="notranslate"><code class="notranslate">#if defined(HAVE_OPENCV_FLANN)
</code></pre></div>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.3.1</li>
<li>Operating System / Platform =&gt; Ubuntu 16.04</li>
<li>Compiler =&gt; /usr/bin/c++ (ver 5.4.0)</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto"><a href="https://github.com/opencv/opencv/blob/master/modules/features2d/include/opencv2/features2d.hpp#L1115">FlannBasedMatcher</a> has two methods, constructor <code class="notranslate">FlannBasedMatcher</code> and <code class="notranslate">create()</code> that can't be wrapped without optional flann module but <code class="notranslate">CV_WRAP</code> ignores <code class="notranslate">#ifdef HAVE_OPENCV_FLANN</code>.</p>

<h5 dir="auto">Steps to reproduce</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cmake -DBUILD_LIST=features2d,python2 .. &amp;&amp; make -j8"><pre class="notranslate"><code class="notranslate">cmake -DBUILD_LIST=features2d,python2 .. &amp;&amp; make -j8
</code></pre></div>