Merge remote-tracking branch 'upstream/3.4' into merge-3.4
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Sun, 26 Jun 2022 14:21:40 +0000 (14:21 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Sun, 26 Jun 2022 14:22:24 +0000 (14:22 +0000)
1  2 
doc/opencv.bib
doc/tutorials/features2d/homography/homography.markdown
modules/calib3d/include/opencv2/calib3d.hpp
modules/core/doc/intro.markdown
modules/imgcodecs/include/opencv2/imgcodecs.hpp
modules/imgcodecs/src/grfmt_jpeg.cpp
modules/videoio/src/cap_ffmpeg_impl.hpp

diff --cc doc/opencv.bib
Simple merge
@@@ -16,14 -10,16 +16,16 @@@ Introduction {#tutorial_homography_Intr
  
  This tutorial will demonstrate the basic concepts of the homography with some codes.
  For detailed explanations about the theory, please refer to a computer vision course or a computer vision book, e.g.:
- *   Multiple View Geometry in Computer Vision, @cite HartleyZ00.
- *   An Invitation to 3-D Vision: From Images to Geometric Models, @cite Ma:2003:IVI
- *   Computer Vision: Algorithms and Applications, @cite RS10
+ *   Multiple View Geometry in Computer Vision, Richard Hartley and Andrew Zisserman, @cite HartleyZ00 (some sample chapters are available [here](https://www.robots.ox.ac.uk/~vgg/hzbook/), CVPR Tutorials are available [here](https://www.robots.ox.ac.uk/~az/tutorials/))
+ *   An Invitation to 3-D Vision: From Images to Geometric Models, Yi Ma, Stefano Soatto, Jana Kosecka, and S. Shankar Sastry, @cite Ma:2003:IVI (a computer vision book handout is available [here](https://cs.gmu.edu/%7Ekosecka/cs685/VisionBookHandout.pdf))
+ *   Computer Vision: Algorithms and Applications, Richard Szeliski, @cite RS10 (an electronic version is available [here](https://szeliski.org/Book/))
+ *   Deeper understanding of the homography decomposition for vision-based control, Ezio Malis, Manuel Vargas, @cite Malis2007 (open access [here](https://hal.inria.fr/inria-00174036))
+ *   Pose Estimation for Augmented Reality: A Hands-On Survey, Eric Marchand, Hideaki Uchiyama, Fabien Spindler, @cite Marchand16 (open access [here](https://hal.inria.fr/hal-01246370))
  
 -The tutorial code can be found here [C++](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/features2D/Homography),
 -[Python](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/features2D/Homography),
 -[Java](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/features2D/Homography).
 -The images used in this tutorial can be found [here](https://github.com/opencv/opencv/tree/3.4/samples/data) (`left*.jpg`).
 +The tutorial code can be found here [C++](https://github.com/opencv/opencv/tree/4.x/samples/cpp/tutorial_code/features2D/Homography),
 +[Python](https://github.com/opencv/opencv/tree/4.x/samples/python/tutorial_code/features2D/Homography),
 +[Java](https://github.com/opencv/opencv/tree/4.x/samples/java/tutorial_code/features2D/Homography).
 +The images used in this tutorial can be found [here](https://github.com/opencv/opencv/tree/4.x/samples/data) (`left*.jpg`).
  
  Basic theory {#tutorial_homography_Basic_theory}
  ------------
@@@ -3255,10 -2584,10 +3255,10 @@@ CV_EXPORTS_W int decomposeHomographyMat
  @param beforePoints Vector of (rectified) visible reference points before the homography is applied
  @param afterPoints Vector of (rectified) visible reference points after the homography is applied
  @param possibleSolutions Vector of int indices representing the viable solution set after filtering
 -@param pointsMask optional Mat/Vector of 8u type representing the mask for the inliers as given by the findHomography function
 +@param pointsMask optional Mat/Vector of 8u type representing the mask for the inliers as given by the #findHomography function
  
 -This function is intended to filter the output of the decomposeHomographyMat based on additional
 -information as described in @cite Malis2007 . The summary of the method: the decomposeHomographyMat function
 +This function is intended to filter the output of the #decomposeHomographyMat based on additional
- information as described in @cite Malis . The summary of the method: the #decomposeHomographyMat function
++information as described in @cite Malis2007 . The summary of the method: the #decomposeHomographyMat function
  returns 2 unique solutions and their "opposites" for a total of 4 solutions. If we have access to the
  sets of points visible in the camera frame before and after the homography transformation is applied,
  we can determine which are the true potential solutions and which are the opposites by verifying which
Simple merge
@@@ -95,16 -95,23 +96,25 @@@ enum ImwriteFlags 
         IMWRITE_PNG_BILEVEL         = 18, //!< Binary level PNG, 0 or 1, default is 0.
         IMWRITE_PXM_BINARY          = 32, //!< For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1.
         IMWRITE_EXR_TYPE            = (3 << 4) + 0, /* 48 */ //!< override EXR storage type (FLOAT (FP32) is default)
 +       IMWRITE_EXR_COMPRESSION     = (3 << 4) + 1, /* 49 */ //!< override EXR compression type (ZIP_COMPRESSION = 3 is default)
         IMWRITE_WEBP_QUALITY        = 64, //!< For WEBP, it can be a quality from 1 to 100 (the higher is the better). By default (without any parameter) and for quality above 100 the lossless compression is used.
         IMWRITE_PAM_TUPLETYPE       = 128,//!< For PAM, sets the TUPLETYPE field to the corresponding string value that is defined for the format
 -       IMWRITE_TIFF_RESUNIT        = 256,//!< For TIFF, use to specify which DPI resolution unit to set; see libtiff documentation for valid values.
 -       IMWRITE_TIFF_XDPI           = 257,//!< For TIFF, use to specify the X direction DPI.
 -       IMWRITE_TIFF_YDPI           = 258,//!< For TIFF, use to specify the Y direction DPI.
 -       IMWRITE_TIFF_COMPRESSION    = 259 //!< For TIFF, use to specify the image compression scheme. See libtiff for integer constants corresponding to compression formats. Note, for images whose depth is CV_32F, only libtiff's SGILOG compression scheme is used. For other supported depths, the compression scheme can be specified by this flag; LZW compression is the default.
 +       IMWRITE_TIFF_RESUNIT        = 256,//!< For TIFF, use to specify which DPI resolution unit to set; see libtiff documentation for valid values
 +       IMWRITE_TIFF_XDPI           = 257,//!< For TIFF, use to specify the X direction DPI
 +       IMWRITE_TIFF_YDPI           = 258,//!< For TIFF, use to specify the Y direction DPI
 +       IMWRITE_TIFF_COMPRESSION    = 259,//!< For TIFF, use to specify the image compression scheme. See libtiff for integer constants corresponding to compression formats. Note, for images whose depth is CV_32F, only libtiff's SGILOG compression scheme is used. For other supported depths, the compression scheme can be specified by this flag; LZW compression is the default.
 +       IMWRITE_JPEG2000_COMPRESSION_X1000 = 272 //!< For JPEG2000, use to specify the target compression rate (multiplied by 1000). The value can be from 0 to 1000. Default is 1000.
       };
  
+ enum ImwriteJPEGSamplingFactorParams {
+        IMWRITE_JPEG_SAMPLING_FACTOR_411 = 0x411111, //!< 4x1,1x1,1x1
+        IMWRITE_JPEG_SAMPLING_FACTOR_420 = 0x221111, //!< 2x2,1x1,1x1(Default)
+        IMWRITE_JPEG_SAMPLING_FACTOR_422 = 0x211111, //!< 2x1,1x1,1x1
+        IMWRITE_JPEG_SAMPLING_FACTOR_440 = 0x121111, //!< 1x2,1x1,1x1
+        IMWRITE_JPEG_SAMPLING_FACTOR_444 = 0x111111  //!< 1x1,1x1,1x1(No subsampling)
+      };
  enum ImwriteEXRTypeFlags {
         /*IMWRITE_EXR_TYPE_UNIT = 0, //!< not supported */
         IMWRITE_EXR_TYPE_HALF   = 1, //!< store as HALF (FP16)
Simple merge
@@@ -1631,9 -1406,9 +1631,9 @@@ bool CvCapture_FFMPEG::retrieveFrame(in
  
      sws_scale(
              img_convert_ctx,
 -            picture->data,
 -            picture->linesize,
 -            0, picture->height,
 +            sw_picture->data,
 +            sw_picture->linesize,
-             0, context->coded_height,
++            0, sw_picture->height,
              rgb_picture.data,
              rgb_picture.linesize
              );