Issue 1:
System information (version)

OpenCV => 3.4

Operating System / Platform => any

Compiler => any

Detailed description

Hi,

If it is intended to accumulate blob radiuses in a sorted way ( I believe it is because centers[j].size() / 2 then have a sence of a median radius) at SimpleBlobDetectorImpl::detect, then bubble sort insert is broken.

Current code:

centers[j].push_back(curCenters[i]);

size_t k = centers[j].size() - 1;
while( k > 0 && centers[j][k].radius < centers[j][k-1].radius )
{
centers[j][k] = centers[j][k-1];
k--;
}
centers[j][k] = curCenters[i];

Suggested substitute:

centers[j].push_back(curCenters[i]);

size_t k = centers[j].size() - 1;
while( k > 0 && centers[j][k].radius < centers[j][k-1].radius )
{
centers[j][k] = centers[j][k-1];
k--;
centers[j][k] = curCenters[i];
}

Issue 2:
My setup uses defined pkg_config_path and libraries compiled differently than the system versions.

All other libraries are found properly and the proper lib version is outputted in the initial cmake

-- Media I/O:

-- ZLib: /lib64/libz.so (ver 1.2.11)

-- JPEG: /Data/Documents/CensusProject/gdallib/src/compiled/lib/libjpeg.so (ver 90)

-- WEBP: build (ver encoder: 0x020f)

-- PNG: /lib64/libpng.so (ver 1.6.37)

-- TIFF: /lib64/libtiff.so (ver 42 / 4.2.0)

-- JPEG 2000: build (ver 2.4.0)

-- OpenEXR: build (ver 2.3.0)

-- HDR: YES

-- SUNRASTER: YES

-- PXM: YES

-- PFM: YES

the issue is when linking against the test scripts during a call to make

error as follows

[ 34%] Linking CXX executable ../../bin/opencv_test_core

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFReadDirectory@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFWriteEncodedStrip@LIBTIFF_4.0'

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFIsTiled@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFOpen@LIBTIFF_4.0'

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFSetField@LIBTIFF_4.0'

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFWriteScanline@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFGetField@LIBTIFF_4.0'

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFScanlineSize@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFWriteDirectory@LIBTIFF_4.0'

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFSetErrorHandler@LIBTIFF_4.0'

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFReadRGBATile@LIBTIFF_4.0'

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFClose@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFRGBAImageOK@LIBTIFF_4.0'

/usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFClientOpen@LIBTIFF_4.0' /usr/bin/ld: ../../lib/libopencv_imgcodecs.so.4.5.2: undefined reference to TIFFReadRGBAStrip@LIBTIFF_4.0'

collect2: error: ld returned 1 exit status

make[2]: *** [modules/core/CMakeFiles/opencv_test_core.dir/build.make:871: bin/opencv_test_core] Error 1

make[1]: *** [CMakeFiles/Makefile2:1716: modules/core/CMakeFiles/opencv_test_core.dir/all] Error 2

make: *** [Makefile:166: all] Error 2