<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.4</li>
<li>Operating System / Platform =&gt; any</li>
<li>Compiler =&gt; any</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Hi,<br>
If it is intended to accumulate blob radiuses in a sorted way ( I believe it is because <code class="notranslate">centers[j].size() / 2</code> then have a sence of a median radius) at <a href="https://github.com/opencv/opencv/blob/76eb38976103c86610f73d87e46b7cb5a74f0017/modules/features2d/src/blobdetector.cpp#L341">SimpleBlobDetectorImpl::detect</a>, then bubble sort insert is broken.<br>
Current code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="                    centers[j].push_back(curCenters[i]);

                    size_t k = centers[j].size() - 1;
                    while( k &gt; 0 &amp;&amp; centers[j][k].radius &lt; centers[j][k-1].radius )
                    {
                        centers[j][k] = centers[j][k-1];
                        k--;
                    }
                    centers[j][k] = curCenters[i];"><pre class="notranslate"><code class="notranslate">                    centers[j].push_back(curCenters[i]);

                    size_t k = centers[j].size() - 1;
                    while( k &gt; 0 &amp;&amp; centers[j][k].radius &lt; centers[j][k-1].radius )
                    {
                        centers[j][k] = centers[j][k-1];
                        k--;
                    }
                    centers[j][k] = curCenters[i];
</code></pre></div>
<p dir="auto">Suggested substitute:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="                    centers[j].push_back(curCenters[i]);

                    size_t k = centers[j].size() - 1;
                    while( k &gt; 0 &amp;&amp; centers[j][k].radius &lt; centers[j][k-1].radius )
                    {
                        centers[j][k] = centers[j][k-1];
                        k--;
                        centers[j][k] = curCenters[i];
                    }"><pre class="notranslate"><code class="notranslate">                    centers[j].push_back(curCenters[i]);

                    size_t k = centers[j].size() - 1;
                    while( k &gt; 0 &amp;&amp; centers[j][k].radius &lt; centers[j][k-1].radius )
                    {
                        centers[j][k] = centers[j][k-1];
                        k--;
                        centers[j][k] = curCenters[i];
                    }
</code></pre></div>
<p dir="auto">My setup uses defined pkg_config_path and libraries compiled differently than the system versions.<br>
All other libraries are found properly and the proper lib version is outputted in the initial cmake</p>
<p dir="auto">--   Media I/O:<br>
--     ZLib:                        /lib64/libz.so (ver 1.2.11)<br>
--     JPEG:                        /Data/Documents/CensusProject/gdallib/src/compiled/lib/libjpeg.so (ver 90)<br>
--     WEBP:                        build (ver encoder: 0x020f)<br>
--     PNG:                         /lib64/libpng.so (ver 1.6.37)<br>
--     TIFF:                        /lib64/libtiff.so (ver 42 / 4.2.0)<br>
--     JPEG 2000:                   build (ver 2.4.0)<br>
--     OpenEXR:                     build (ver 2.3.0)<br>
--     HDR:                         YES<br>
--     SUNRASTER:                   YES<br>
--     PXM:                         YES<br>
--     PFM:                         YES</p>
<p dir="auto">the issue is when linking against the test scripts during a call to make<br>
error as follows</p>
<p dir="auto">[ 34%] Linking CXX executable ../../bin/opencv_test_core<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFReadDirectory@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFWriteEncodedStrip@LIBTIFF_4.0'<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFIsTiled@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFOpen@LIBTIFF_4.0'<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFReadEncodedStrip@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFSetField@LIBTIFF_4.0'<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFWriteScanline@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFGetField@LIBTIFF_4.0'<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFScanlineSize@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFWriteDirectory@LIBTIFF_4.0'<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFSetWarningHandler@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFSetErrorHandler@LIBTIFF_4.0'<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFReadEncodedTile@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFReadRGBATile@LIBTIFF_4.0'<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFClose@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFRGBAImageOK@LIBTIFF_4.0'<br>
/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to <code class="notranslate">TIFFClientOpen@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to </code>TIFFReadRGBAStrip@LIBTIFF_4.0'<br>
collect2: error: ld returned 1 exit status<br>
make[2]: *** [modules/core/CMakeFiles/opencv_test_core.dir/build.make:871: bin/opencv_test_core] Error 1<br>
make[1]: *** [CMakeFiles/Makefile2:1716: modules/core/CMakeFiles/opencv_test_core.dir/all] Error 2<br>
make: *** [Makefile:166: all] Error 2</p>