nareshmlx/opencv-pr huggingface dataset:
**File:** modules/videoio/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #4100: Fix ffmpeg - Compilation tested on Ubuntu 12.04 with ``` -- FFMPEG: YES -- codec: YES (ver 53.35.0) -- format: YES (ver 53.21.1) -- util: YE...

**Code Changes:**
```diff
@@ -1543,7 +1543,7 @@ void CvVideoWriter_FFMPEG::close()
 #define CV_PRINTABLE_CHAR(ch) ((ch) < 32 ? '?' : (ch))
 #define CV_TAG_TO_PRINTABLE_CHAR4(tag) CV_PRINTABLE_CHAR((tag) & 255), CV_PRINTABLE_CHAR(((tag) >> 8) & 255), CV_PRINTABLE_CHAR(((tag) >> 16) & 255), CV_PRINTABLE_CHAR(((tag) >> 24) & 255)
 
-static inline bool cv_ff_codec_tag_match(const AVCodecTag *tags, enum AVCodecID id, unsigned int tag)
+static inline bool cv_ff_codec_tag_match(const AVCodecTag *tags, CV_CODEC_ID id, unsigned int tag)
 {
     while (tags->id != AV_CODEC_ID_NONE)
     {
@@ -1553,7 +1553,7 @@ static inline bool cv_ff_codec_tag_match(const AVCodecTag *tags, enum AVCodecID
```

Review comment:
small typo: APIchanges
**File:** modules/highgui/src/cap_ffmpeg_impl.hpp
**Change Type:** modified
**Context:** PR #3307: TCP instead of UDP for rtsp to prevent video corruption - http://code.opencv.org/issues/2235

**Code Changes:**
```diff
@@ -260,6 +260,10 @@ struct CvCapture_FFMPEG
    and so the filename is needed to reopen the file on backward seeking.
 */
     char              * filename;
+
+#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
+    AVDictionary *dict;
+#endif
 };
 
```

Review comment:
I believe that check of `_filename` for `rstp` protocol prefix will be useful to eliminate future problems. It will be great to make this as an `option` and don't hardcode behaviour, if capture API supports this.
**File:** modules/imgcodecs/src/ios_conversions.mm
**Change Type:** modified
**Context:** PR #4115: Fixed alpha preservation when converting 4-channel Mat to UIImage - I hope this is not too naively done, but MatToUIImage needs to preserve ...
**Review Line:** 80

**Code Changes:**
```diff
                                         8 * image.elemSize(),
                                         image.step.p[0],
                                         colorSpace,
-                                        kCGImageAlphaNone|
-                                        kCGBitmapByteOrderDefault,
+                                        bitmapInfo,
                                         provider,
                                         NULL,
                                         false,
```

Review comment:
bitMapInfo, not bitmapInfo
**File:** modules/imgcodecs/src/ios_conversions.mm
**Change Type:** modified
**Context:** PR #4115: Fixed alpha preservation when converting 4-channel Mat to UIImage - I hope this is not too naively done, but MatToUIImage needs to preserve ...

**Code Changes:**
```diff
@@ -66,15 +66,18 @@
     CGDataProviderRef provider =
             CGDataProviderCreateWithCFData((__bridge CFDataRef)data);
 
+    // Preserve alpha transparency, if exists
+    bool alpha = image.channels() == 4;
+    CGBitmapInfo bitmapInfo = (alpha ? kCGImageAlphaLast : kCGImageAlphaNone) | kCGBitmapByteOrderDefault;
+
     // Creating CGImage from cv::Mat
     CGImageRef imageRef = CGImageCreate(image.cols,
```

Review comment:
there is no cvMat in your function. did you mean 'image' ?
**File:** modules/imgcodecs/src/ios_conversions.mm
**Change Type:** modified
**Context:** PR #4115: Fixed alpha preservation when converting 4-channel Mat to UIImage - I hope this is not too naively done, but MatToUIImage needs to preserve ...

**Code Changes:**
```diff
@@ -66,15 +66,18 @@
     CGDataProviderRef provider =
             CGDataProviderCreateWithCFData((__bridge CFDataRef)data);
 
+    // Preserve alpha transparency, if exists
+    bool alpha = image.channels() == 4;
+    CGBitmapInfo bitmapInfo = (alpha ? kCGImageAlphaLast : kCGImageAlphaNone) | kCGBitmapByteOrderDefault;
+
     // Creating CGImage from cv::Mat
     CGImageRef imageRef = CGImageCreate(image.cols,
```

Review comment:
Indeed, this happens when copy-pasting and not being able to test…
**File:** modules/python/src2/gen2.py
**Change Type:** modified
**Context:** PR #4093: Python generator: moved base class handling to the generate step - base classes will be searched after parsing all header files (http://code...
**Review Line:** 885

**Code Changes:**
```diff
+                    print("Generator error: unable to resolve base %s for %s"
+                        % (classinfo.base, classinfo.name))
+                    sys.exit(-1)
+                classinfo.base = base
+                classinfo.isalgorithm |= self.classes[base].isalgorithm
+                self.classes[name] = classinfo
+
         # step 2: generate code for the classes and their methods
         classlist = list(self.classes.items())
         classlist.sort()
```

Review comment:
`for` provides `classinfo` by ref, so this line is not required.
**File:** doc/tutorials/introduction/transition_guide/transition_guide.markdown
**Change Type:** modified
**Context:** PR #4049: Transition guide: how to check library version - As suggested here: http://code.opencv.org/issues/4346
**Review Line:** 270

**Code Changes:**
```diff
+### Source code
+
+To check library major version in your application source code, the following method should be used:
+@code{.cpp}
+#include "opencv2/core/version.hpp"
+#if CV_MAJOR_VERSION == 2
+// do opencv 2 code
+#elif CV_MAJOR_VERSION == 3
+// do opencv 3 code
+#endif
+@endcode
```

Review comment:
I believe, this method should be presented first, as the main one. The method with CV_VERSION_EPOCH is not obvious and may be confusing for someone who reads code and does not know about this trick. Thus it should either be not mentioned at all, or you can describe it as alternative hacky solution
**File:** modules/video/src/ecc.cpp
**Change Type:** modified
**Context:** PR #3845: Modify findTransformECC to support a mask of pixels to consider - Tests of the mask are also included. This is useful for registering a non-...
**Review Line:** 406

**Code Changes:**
```diff
     Mat imageMask		= Mat(hs, ws, CV_8U); //to store the final mask
 
+    Mat inputMaskMat = inputMask.getMat();
+    //to use it for mask warping
+    Mat preMask =
+      inputMaskMat.empty() ? Mat::ones(hd, wd, CV_8U) : inputMaskMat;
+
     //gaussian filtering is optional
     src.convertTo(templateFloat, templateFloat.type());
     GaussianBlur(templateFloat, templateFloat, Size(5, 5), 0, 0);//is in-place filtering slower?
 
```

Review comment:
you can not expect that the input mask is filled with 1's. OpenCV convention is that it only matters if certain mask pixel is equal to zero or not. Therefore, you should probably apply threshold() function and set non-zero pixels to 1 (but, of course, you should not touch the input mask, you should copy it to temporary array). In other words, you should probably write something like: <pre> Mat preMask; if(inputMask.empty()) preMask = Mat::ones(hd, wd, CV_8U); else threshold(inputMask, preMask, 0, 1, THRESH_BINARY); </pre>
**File:** modules/video/src/ecc.cpp
**Change Type:** modified
**Context:** PR #3845: Modify findTransformECC to support a mask of pixels to consider - Tests of the mask are also included. This is useful for registering a non-...
**Review Line:** 412

**Code Changes:**
```diff
+
     //gaussian filtering is optional
     src.convertTo(templateFloat, templateFloat.type());
     GaussianBlur(templateFloat, templateFloat, Size(5, 5), 0, 0);//is in-place filtering slower?
 
+    Mat preMaskFloat = Mat(hd, wd, CV_32F);
+    preMask.convertTo(preMaskFloat, preMaskFloat.type());
+    GaussianBlur(preMaskFloat, preMaskFloat, Size(5, 5), 0, 0);//is in-place filtering slower?
+    // Change threshold.
+    preMaskFloat *= (0.5/0.95);
+    // Rounding conversion.
```

Review comment:
no need to allocate matrix if it's output in the subsequent operations; just use "Mat preMaskFloat";
**File:** modules/video/src/ecc.cpp
**Change Type:** modified
**Context:** PR #3845: Modify findTransformECC to support a mask of pixels to consider - Tests of the mask are also included. This is useful for registering a non-...
**Review Line:** 515

**Code Changes:**
```diff
         const double tmpNorm = std::sqrt(countNonZero(imageMask)*(tmpStd.val[0])*(tmpStd.val[0]));
@@ -496,6 +512,9 @@ double cv::findTransformECC(InputArray templateImage,
         // calculate enhanced correlation coefficiont (ECC)->rho
         last_rho = rho;
         rho = correlation/(imgNorm*tmpNorm);
+        if (isnan(rho)) {
+          CV_Error(Error::StsNoConv, "NaN encountered.");
+        }
 
         // project images into jacobian
         project_onto_jacobian_ECC( jacobian, imageWarped, imageProjection);
```

Review comment:
please, use cvIsNaN(). isnan is not available in some cases
**File:** samples/python2/digits.py
**Change Type:** modified
**Context:** PR #4070: fixed digits.py sample to work with opencv 3 - digits.py python sample contained opencv 2 code, refactored to work with 3.0.0-rc1 API

**Code Changes:**
```diff
@@ -74,30 +74,30 @@ def save(self, fn):
 class KNearest(StatModel):
     def __init__(self, k = 3):
         self.k = k
-        self.model = cv2.KNearest()
+        self.model = cv2.ml.KNearest_create()
 
     def train(self, samples, responses):
-        self.model = cv2.KNearest()
-        self.model.train(samples, responses)
```

Review comment:
the params struct is gone in 3.0. use `self.model.setKernel(cv2.ml.RBF)` , `self.model.setType(cv2.SVM_C_SVC)` , `self.model.setGamma(0.5)` and `self.model.setC(1)` this also should clear the confusion in line 102 (only the version in line 100 is valid)
**File:** modules/java/generator/src/java/android+AsyncServiceHelper.java
**Change Type:** modified
**Context:** PR #4083: OpenCV Manager for Android (version 3) - - removed android_camera - removed standalone android package mode - reworked manager package (rena...
**Review Line:** 7

**Code Changes:**
```diff
@@ -4,7 +4,7 @@
 import java.util.StringTokenizer;
 
 import org.opencv.core.Core;
-import org.opencv.engine3.OpenCVEngineInterface;
+import org.opencv.engine.OpenCVEngineInterface;
 
 import android.content.ComponentName;
 import android.content.Context;
@@ -21,8 +21,8 @@ public static boolean initOpenCV(String Version, final Context AppContext,
             final LoaderCallbackInterface Callback)
```

Review comment:
`getPackageName` returns `"OpenCV3 Manager"` (twice, it is below in this file). Is it OK?
**File:** samples/directx/winapp.hpp
**Change Type:** added
**Context:** PR #4016: directx opencl interop samples (with copy from opencl image2d to buffer) - a simplified version of directx-opencl interoperability samples (...

**Code Changes:**
```diff
@@ -0,0 +1,132 @@
+/*
+// Sample demonstrating interoperability of OpenCV UMat with Direct X surface
+// Base class for Windows application
+*/
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <string>
+
+
```

Review comment:
This method can be protected also.
**File:** modules/features2d/test/test_lshindex_flannbased_matcher.cpp
**Change Type:** modified
**Context:** PR #3829: FlannBasedMatcher(LshIndex) in the feature2d optimization for continuance additional train() - Current implementation of miniflann is releas...

**Code Changes:**
```diff
@@ -62,13 +62,12 @@
 #define SHOW_DEBUG_LOG true
 
 #if CV_MAJOR_VERSION==2
-#define OrbCreate new ORB(4000)
+#define OrbCreate new cv::ORB(4000)
 #elif CV_MAJOR_VERSION==3
-#define OrbCreate ORB::create(4000)
-#define AKazeCreate AKAZE::create()
+#define OrbCreate cv::ORB::create(4000)
```

Review comment:
instead of "using namespace cv" put all the tests into cv or cv::test namespace.
**File:** modules/features2d/test/test_lshindex_flannbased_matcher.cpp
**Change Type:** modified
**Context:** PR #3829: FlannBasedMatcher(LshIndex) in the feature2d optimization for continuance additional train() - Current implementation of miniflann is releas...
**Review Line:** 78

**Code Changes:**
```diff
@@ -62,13 +62,12 @@
 #define SHOW_DEBUG_LOG true
 
 #if CV_MAJOR_VERSION==2
-#define OrbCreate new ORB(4000)
+#define OrbCreate new cv::ORB(4000)
 #elif CV_MAJOR_VERSION==3
-#define OrbCreate ORB::create(4000)
-#define AKazeCreate AKAZE::create()
+#define OrbCreate cv::ORB::create(4000)
+#define AKazeCreate cv::AKAZE::create()
 #endif
 
-using namespace cv;
 using namespace std;
```

Review comment:
all the test code should be put inside cv namespace or cv::test namespace
**File:** modules/objdetect/src/hog.cpp
**Change Type:** modified
**Context:** PR #3971: ports to master (part 3) - #3667 - f39d351 #3946 - b73894b
**Review Line:** 1456

**Code Changes:**
```diff
@@ -1453,6 +1453,7 @@ void HOGDescriptor::detect(const Mat& img,
     Size winStride, Size padding, const std::vector<Point>& locations) const
 {
     hits.clear();
+    weights.clear();
     if( svmDetector.empty() )
         return;
 
```

Review comment:
O I followed up on this fix in 2.4, where it was only 1 line, but like remarked in the PR history, in master there are several `hits.clear()` lines that should be followed by the `weights.clear()` line. Could you scan the file and perform the extra adaptation? If I remember correct, there were 4 locations where this should be applied.
**File:** doc/tutorials/features2d/feature_description/feature_description.markdown
**Change Type:** modified
**Context:** PR #3999: small fixes for features2d tutorials - - addtional Mask argument in detectAndCompute() - setMinHessian() -> setHessianThreshold() - cv::line...
**Review Line:** 52

**Code Changes:**
```diff
@@ -49,13 +49,13 @@ int main( int argc, char** argv )
   int minHessian = 400;
 
   Ptr<SURF> detector = SURF::create();
-  detector->setMinHessian(minHessian);
+  detector->setHessianThreshold(minHessian);
 
   std::vector<KeyPoint> keypoints_1, keypoints_2;
   Mat descriptors_1, descriptors_2;
 
-  detector->detectAndCompute( img_1, keypoints_1, descriptors_1 );
```

Review comment:
Maybe good idea to change the name of the parameter from minHessian to threshHessian?
**File:** doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.markdown
**Change Type:** modified
**Context:** PR #3999: small fixes for features2d tutorials - - addtional Mask argument in detectAndCompute() - setMinHessian() -> setHessianThreshold() - cv::line...
**Review Line:** 58

**Code Changes:**
```diff
@@ -58,13 +58,13 @@ int main( int argc, char** argv )
   int minHessian = 400;
 
   Ptr<SURF> detector = SURF::create();
-  detector->setMinHessian(minHessian);
+  detector->setHessianThreshold(minHessian);
 
```

Review comment:
Same remark here
**File:** modules/core/include/opencv2/core/mat.hpp
**Change Type:** modified
**Context:** PR #3911: tweaks in core; some license cleanup - 1. Input/OutputArray optimizations 2. Algorithm::load/save added (moved from StatModel) 3. copyrights...

**Code Changes:**
```diff
@@ -185,39 +185,43 @@ class CV_EXPORTS _InputArray
     _InputArray(const UMat& um);
     _InputArray(const std::vector<UMat>& umv);
 
-    virtual Mat getMat(int idx=-1) const;
-    virtual UMat getUMat(int idx=-1) const;
-    virtual void getMatVector(std::vector<Mat>& mv) const;
-    virtual void getUMatVector(std::vector<UMat>& umv) const;
-    virtual cuda::GpuMat getGpuMat() const;
-    virtual ogl::Buffer getOGlBuffer() const;
```

Review comment:
Are you sure? I see these advantages/disadvantages of appraches: - old style (reference): no copy call on parameter propagation to nested functions (+), additional pointer dereference for field method access in inlined methods (-) - new style (instance): object copy on parameter propagation to nested functions (-), direct access to field values in inlined methods (+)
**File:** doc/tutorials/introduction/android_binary_package/O4A_SDK.rst
**Change Type:** modified
**Context:** PR #3726: OpenCV and OpenCV Manager version++

**Code Changes:**
```diff
@@ -48,10 +48,10 @@ The structure of package contents looks as follows:
 
 ::
 
-    OpenCV-2.4.10-android-sdk
+    OpenCV-2.4.11-android-sdk
     |_ apk
-    |   |_ OpenCV_2.4.10_binary_pack_armv7a.apk
-    |   |_ OpenCV_2.4.10_Manager_2.19_XXX.apk
+    |   |_ OpenCV_2.4.11_binary_pack_armv7a.apk
```

Review comment:
shouldn't it be: [...]opencv-android/**2.4.11**/OpenCV-2.4.11-android-sdk.zip/download
**File:** modules/videostab/src/global_motion.cpp
**Change Type:** modified
**Context:** PR #3703: fixig std::bad_alloc - if points0 is empty checkVector(2) return -1, it causes the exception

**Code Changes:**
```diff
@@ -544,6 +544,9 @@ Mat MotionEstimatorL1::estimate(InputArray points0, InputArray points1, bool *ok
 
     CV_Assert(motionModel() <= MM_AFFINE && motionModel() != MM_RIGID);
 
+    if(npoints <= 0)
+        return Mat::eye(3, 3, CV_32F);
+
     // prepare LP problem
 
     const Point2f *points0_ = points0.getMat().ptr<Point2f>();
```

Review comment:
not initialized matrix it's a bad practice.
**File:** modules/videostab/src/global_motion.cpp
**Change Type:** modified
**Context:** PR #3703: fixig std::bad_alloc - if points0 is empty checkVector(2) return -1, it causes the exception

**Code Changes:**
```diff
@@ -544,6 +544,9 @@ Mat MotionEstimatorL1::estimate(InputArray points0, InputArray points1, bool *ok
 
     CV_Assert(motionModel() <= MM_AFFINE && motionModel() != MM_RIGID);
 
+    if(npoints <= 0)
+        return Mat::eye(3, 3, CV_32F);
+
     // prepare LP problem
 
     const Point2f *points0_ = points0.getMat().ptr<Point2f>();
```

Review comment:
it is identity matrix
**File:** modules/core/src/matrix.cpp
**Change Type:** modified
**Context:** PR #3629: implement _OutputArray::assign() for _OutputArrays of type MATX (with tests) - _OutputArray::assign(const Mat &m) throws exception when the ...
**Review Line:** 2669

**Code Changes:**
```diff
         CV_Error(Error::StsNotImplemented, "");
@@ -2662,6 +2666,10 @@ void _OutputArray::assign(const Mat& m) const
     {
         *(Mat*)obj = m;
     }
+    else if (k == MATX)
+    {
+        m.copyTo(getMat());
+    }
     else
     {
```

Review comment:
MATX assumes constant size and constant type. Not sure that getMat() will do the right thing if the assigned matrix has a different size and/or different type. Use m.copyTo(getMat()) instead.
**File:** modules/objdetect/src/cascadedetect.cpp
**Change Type:** modified
**Context:** PR #3625: OCL: [objdetect]Avoid deadlock becasue some work item couldn't reach barrier in loop and unsynchronized. - Signed-off-by: Yan Wang yan.wang@...
**Review Line:** 590

**Code Changes:**
```diff
@@ -587,7 +587,7 @@ bool HaarEvaluator::read(const FileNode& node, Size _origWinSize)
     localSize = lbufSize = Size(0, 0);
     if (ocl::haveOpenCL())
     {
-        if (ocl::Device::getDefault().isAMD())
+        if (ocl::Device::getDefault().isAMD() || ocl::Device::getDefault().isIntel())
         {
             localSize = Size(8, 8);
             lbufSize = Size(origWinSize.width + localSize.width,
```

Review comment:
Last time I checked it on my MBP15 with Iris Pro, CPU branch was faster than the GPU one. Do you have some statistics regarding OpenCL branch on various Intel's chips?
**File:** doc/tutorials/imgproc/imgtrans/distance_transformation/distance_transform.markdown
**Change Type:** added
**Context:** PR #3632: Image Segmentation .cpp tutorial - Since it is my first trial to contribute with github, I hope that I did everything correct.

**Code Changes:**
```diff
@@ -0,0 +1,57 @@
+Image Segmentation with Distance Transform and Watershed Algorithm {#tutorial_distance_transform}
+=============
+
+Goal
+----
+
+In this tutorial you will learn how to:
+
+-   Use the OpenCV function @ref cv::filter2D in order to perform some laplacian filtering for image sharpening
```

Review comment:
file name is wrong here, should be `samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp`
**File:** doc/tutorials/imgproc/imgtrans/distance_transformation/distance_transform.markdown
**Change Type:** added
**Context:** PR #3632: Image Segmentation .cpp tutorial - Since it is my first trial to contribute with github, I hope that I did everything correct.

**Code Changes:**
```diff
@@ -0,0 +1,57 @@
+Image Segmentation with Distance Transform and Watershed Algorithm {#tutorial_distance_transform}
+=============
+
+Goal
+----
+
+In this tutorial you will learn how to:
+
+-   Use the OpenCV function @ref cv::filter2D in order to perform some laplacian filtering for image sharpening
```

Review comment:
try to place a newline or space between these images: ``` ![](images/laplace.jpeg) ![](images/sharp.jpeg) ```
**File:** samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp
**Change Type:** added
**Context:** PR #3632: Image Segmentation .cpp tutorial - Since it is my first trial to contribute with github, I hope that I did everything correct.

**Code Changes:**
```diff
@@ -0,0 +1,168 @@
+/**
+ * @function Watershed_and_Distance_Transform.cpp
+ * @brief Sample code showing how to segment overlapping objects using Laplacian filtering, in addition to Watershed and Distance Transformation
+ * @author OpenCV Team
+ */
+
+#include <opencv2/opencv.hpp>
+#include <iostream>
+
```

Review comment:
This comment is not needed
**File:** doc/tutorials/imgproc/imgtrans/distance_transformation/distance_transform.markdown
**Change Type:** added
**Context:** PR #3632: Image Segmentation .cpp tutorial - Since it is my first trial to contribute with github, I hope that I did everything correct.

**Code Changes:**
```diff
@@ -0,0 +1,57 @@
+Image Segmentation with Distance Transform and Watershed Algorithm {#tutorial_distance_transform}
+=============
+
+Goal
+----
+
+In this tutorial you will learn how to:
+
+-   Use the OpenCV function @ref cv::filter2D in order to perform some laplacian filtering for image sharpening
```

Review comment:
List numeration is restarted after these images, to avoid this align all image links with 4 spaces to put them in the same list item.
**File:** samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp
**Change Type:** added
**Context:** PR #3632: Image Segmentation .cpp tutorial - Since it is my first trial to contribute with github, I hope that I did everything correct.

**Code Changes:**
```diff
@@ -0,0 +1,168 @@
+/**
+ * @function Watershed_and_Distance_Transform.cpp
+ * @brief Sample code showing how to segment overlapping objects using Laplacian filtering, in addition to Watershed and Distance Transformation
+ * @author OpenCV Team
+ */
+
+#include <opencv2/opencv.hpp>
+#include <iostream>
+
```

Review comment:
This line produces warning on windows platform: http://pullrequest.opencv.org/buildbot/builders/precommit_windows64/builds/2059/steps/compile%20release/logs/warnings%20%281%29
**File:** doc/tutorials/imgproc/imgtrans/distance_transformation/distance_transform.markdown
**Change Type:** added
**Context:** PR #3632: Image Segmentation .cpp tutorial - Since it is my first trial to contribute with github, I hope that I did everything correct.

**Code Changes:**
```diff
@@ -0,0 +1,57 @@
+Image Segmentation with Distance Transform and Watershed Algorithm {#tutorial_distance_transform}
+=============
+
+Goal
+----
+
+In this tutorial you will learn how to:
+
+-   Use the OpenCV function @ref cv::filter2D in order to perform some laplacian filtering for image sharpening
```

Review comment:
Since this and all following code snippets are taken directly from example file, it is better to use `snippet` doxygen command. You can read about it here: http://docs.opencv.org/ref/master/d4/db1/tutorial_documentation.html#tutorial_documentation_commands_include And more details here: http://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdsnippet