Issue 1:
System information (version)

OpenCV & OpenCV-contrib => 3.4.3

Operating System / Platform => Ubuntu 18.04 LTS, 64 bit

Compiler => gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0

Python version => Python 2.7.15 :: Anaconda, Inc.

CUDA version => NVCC 9.0, cuDNN 7.2.1

Detailed description

After I install OpenCV with OpenCV-contrib from source, I got the following error when I try to import OpenCV:

I just finish the compilation without error using:

cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=ON \ -D WITH_CUDA=OFF \ -D ENABLE_FAST_MATH=1 \ -D CUDA_FAST_MATH=1 \ -D WITH_CUBLAS=1 \ -D BUILD_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.3/modules ..

I first tried with CUDA, but because of errors in connection with the version of gcc (NVCC needs version <5, but OpenCV needs version> 7 because of the error "-Wimplicit-fallthrough = 3 "unrecognized at 2% compilation). I finally did the compilation without CUDA and I had no compilation error.

I find that other people who have errors like this have had it with Mathematica or Draftsight (for example). However, I do not know how to fix this in the case of OpenCV.

Note that I successfully compiled OpenCV (without CUDA and OpenCV_contrib) yesterday with the same compilation options.

For information, that was the information I get from cmake before compiling. We can see than "freetype2" was correctly identified (even if it seem that it could be the cause of the problem according to some forum of similar trouble on Mathematica)

> cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=ON \ -D WITH_CUDA=OFF \ -D ENABLE_FAST_MATH=1 \ -D CUDA_FAST_MATH=1 \ -D WITH_CUBLAS=1 \ -D BUILD_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.3/modules ..
> -- Looking for ccache - not found
> -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.11", minimum required is "1.2.3")
> -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
> -- Looking for linux/videodev.h
> -- Looking for linux/videodev.h - not found
> -- Looking for linux/videodev2.h
> -- Looking for linux/videodev2.h - found
> -- Looking for sys/videoio.h
> -- Looking for sys/videoio.h - not found
> -- Checking for module 'libavresample'
> -- No package 'libavresample' found
> -- found Intel IPP (ICV version): 2017.0.3 [2017.0.3]
> -- at: /home/vincent/opencv-3.4.3/build/3rdparty/ippicv/ippicv_lnx
> -- found Intel IPP IW sources: 2017.0.3
> -- at: /home/vincent/opencv-3.4.3/build/3rdparty/ippicv/ippiw_lnx
> -- LAPACK(Atlas): LAPACK_LIBRARIES: /usr/lib/x86_64-linux-gnu/liblapack.so;/usr/lib/x86_64-linux-gnu/libcblas.so;/usr/lib/x86_64-linux-gnu/libatlas.so
> -- LAPACK(Atlas): Support is enabled.
> -- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
> -- The imported target "vtkRenderingPythonTkWidgets" references the file
> "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
> but this file does not exist. Possible reasons include:
> * The file was deleted, renamed, or moved to another location.
> * An install or uninstall procedure did not complete successfully.
> * The installation package was faulty and contained
> "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
> but not all the files it references.
>
> -- The imported target "vtk" references the file
> "/usr/bin/vtk"
> but this file does not exist. Possible reasons include:
> * The file was deleted, renamed, or moved to another location.
> * An install or uninstall procedure did not complete successfully.
> * The installation package was faulty and contained
> "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
> but not all the files it references.
>
> -- Found VTK 7.1.1 (/usr/lib/cmake/vtk-7.1/UseVTK.cmake)
> -- Caffe: NO
> -- Protobuf: NO
> -- Glog: NO
> -- freetype2: YES
> -- harfbuzz: YES
> -- HDF5: Using hdf5 compiler wrapper to determine C configuration
> -- Module opencv_ovis disabled because OGRE3D was not found
> -- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
> -- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
> -- Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
> -- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
> -- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
> -- Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
> -- HDF5: Using hdf5 compiler wrapper to determine C configuration
> -- freetype2: YES
> -- harfbuzz: YES
> -- Checking for modules 'tesseract;lept'
> -- No package 'tesseract' found
> -- No package 'lept' found
> -- Tesseract: NO
> -- OpenCL samples are skipped: OpenCL SDK is required
> --
> -- General configuration for OpenCV 3.4.3 =====================================
> -- Version control: unknown
> --
> -- Extra modules:
> -- Location (extra): /home/vincent/opencv_contrib-3.4.3/modules
> -- Version control (extra): unknown
> --
> -- Platform:
> -- Timestamp: 2018-09-22T22:13:51Z
> -- Host: Linux 4.15.0-34-generic x86_64
> -- CMake: 3.10.2
> -- CMake generator: Unix Makefiles
> -- CMake build tool: /usr/bin/make
> -- Configuration: RELEASE
> --
> -- CPU/HW features:
> -- Baseline: SSE SSE2 SSE3
> -- requested: SSE3
> -- Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
> -- requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
> -- SSE4_1 (5 files): + SSSE3 SSE4_1
> -- SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
> -- FP16 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
> -- AVX (6 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
> -- AVX2 (11 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
> -- AVX512_SKX (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_SKX
> --
> -- C/C++:
> -- Built as dynamic libs?: YES
> -- C++11: YES
> -- C++ Compiler: /usr/bin/c++ (ver 7.3.0)
> -- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
> -- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
> -- C Compiler: /usr/bin/cc
> -- C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wimplicit-fallthrough=3 -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
> -- C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wimplicit-fallthrough=3 -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
> -- Linker flags (Release):
> -- Linker flags (Debug):
> -- ccache: NO
> -- Precompiled headers: YES
> -- Extra dependencies: dl m pthread rt
> -- 3rdparty dependencies:
> --
> -- OpenCV modules:
> -- To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann freetype fuzzy hdf hfs highgui img_hash imgcodecs imgproc java_bindings_generator line_descriptor ml objdetect optflow phase_unwrapping photo plot python2 python_bindings_generator reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto
> -- Disabled: js matlab world
> -- Disabled by dependency: -
> -- Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv java ovis python3 sfm
> -- Applications: tests perf_tests examples apps
> -- Documentation: NO
> -- Non-free algorithms: YES
> --
> -- GUI:
> -- GTK+: YES (ver 3.22.30)
> -- GThread : YES (ver 2.56.2)
> -- GtkGlExt: NO
> -- VTK support: YES (ver 7.1.1)
> --
> -- Media I/O:
> -- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
> -- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
> -- WEBP: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x020e)
> -- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.34)
> -- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.0.9)
> -- JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
> -- OpenEXR: build (ver 1.7.1)
> -- HDR: YES
> -- SUNRASTER: YES
> -- PXM: YES
> --
> -- Video I/O:
> -- DC1394: YES (ver 2.2.5)
> -- FFMPEG: YES
> -- avcodec: YES (ver 57.107.100)
> -- avformat: YES (ver 57.83.100)
> -- avutil: YES (ver 55.78.100)
> -- swscale: YES (ver 4.8.100)
> -- avresample: NO
> -- GStreamer:
> -- base: YES (ver 1.14.1)
> -- video: YES (ver 1.14.1)
> -- app: YES (ver 1.14.1)
> -- riff: YES (ver 1.14.1)
> -- pbutils: YES (ver 1.14.1)
> -- libv4l/libv4l2: NO
> -- v4l/v4l2: linux/videodev2.h
> --
> -- Parallel framework: pthreads
> --
> -- Trace: YES (with Intel ITT)
> --
> -- Other third-party libraries:
> -- Intel IPP: 2017.0.3 [2017.0.3]
> -- at: /home/vincent/opencv-3.4.3/build/3rdparty/ippicv/ippicv_lnx
> -- Intel IPP IW: sources (2017.0.3)
> -- at: /home/vincent/opencv-3.4.3/build/3rdparty/ippicv/ippiw_lnx
> -- Lapack: YES (/usr/lib/x86_64-linux-gnu/liblapack.so /usr/lib/x86_64-linux-gnu/libcblas.so /usr/lib/x86_64-linux-gnu/libatlas.so)
> -- Eigen: YES (ver 3.3.4)
> -- Custom HAL: NO
> -- Protobuf: build (3.5.1)
> --
> -- OpenCL: YES (no extra features)
> -- Include path: /home/vincent/opencv-3.4.3/3rdparty/include/opencl/1.2
> -- Link libraries: Dynamic load
> --
> -- Python 2:
> -- Interpreter: /home/vincent/miniconda2/bin/python2.7 (ver 2.7.15)
> -- Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.15rc1)
> -- numpy: /home/vincent/miniconda2/lib/python2.7/site-packages/numpy/core/include (ver 1.15.1)
> -- packages path: lib/python2.7/site-packages
> --
> -- Python (for build): /home/vincent/miniconda2/bin/python2.7
> --
> -- Java:
> -- ant: NO
> -- JNI: NO
> -- Java wrappers: NO
> -- Java tests: NO
> --
> -- Matlab: YES
> -- mex: /usr/local/MATLAB/R2018b/bin/mex
> -- Compiler/generator: Not working (bindings will not be generated)
> --
> -- Install to: /usr/local
> -- -----------------------------------------------------------------
> --
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/vincent/opencv-3.4.3/build
>

Issue 2:
The documentation for fisheye::project algorithm has an error in it (I spent a day reimplementing

to figure this out).

On line 203 calib3d,hpp we have:

\f[x' = (\theta_d / r) x \\ y' = (\theta_d / r) y \f]

'x' and 'y' should be replaced with 'a' and 'b':

\f[x' = (\theta_d / r) a \\ y' = (\theta_d / r) b \f]

This might save another poor soul later.

--wayne