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

<ul dir="auto">
<li>OpenCV =&gt; 4.2.0</li>
<li>Operating System / Platform =&gt; Windows 7 64-bit</li>
<li>Compiler =&gt; Visual Studio 2019</li>
<li>CMake =&gt; 3.16.5</li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">Cmake fails to configure the environment when building OpenCV 4.2.0 from source. After processing WORLD modules, CMake fails with a syntax error.</p>
<p dir="auto">This syntax error is caused by the use of EITHER backslashes or forward slashes when running CMake from the command line (notice in the error below, there are both back and forward slashes even though only forward slashes are used in the configuration). After researching, I came across <a href="this">https://stackoverflow.com/questions/14112279/cmake-parse-error-invalid-escape-sequence-o</a> about an issue like this. I followed "Fraser"'s recommendation and the script executed without issue.</p>
<h5 dir="auto">Error message:</h5>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/23083317/76022245-5cc61680-5eec-11ea-9ba8-1fdf067add5b.png"><img src="https://user-images.githubusercontent.com/23083317/76022245-5cc61680-5eec-11ea-9ba8-1fdf067add5b.png" alt="image" style="max-width: 100%;"></a></p>
<h5 dir="auto">Cmd configuration:</h5>
<p dir="auto">"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvars64.bat"<br>
set "openCvSource=D:/Workspace/opencv/opencv-4.2.0"<br>
set "openCVExtraModules=D:/Workspace/opencv/opencv_contrib-4.2.0/modules"<br>
set "openCvBuild=%openCvSource%/build"<br>
set "buildType=Release"<br>
set "generator=Ninja"<br>
set "pathToAnaconda=C:/ProgramData/Anaconda3"<br>
set "pyVer=37"<br>
"C:/Program Files/CMake/bin/cmake.exe" -B"%openCvBuild%/" -H"%openCvSource%/" -G"%generator%" -DCMAKE_BUILD_TYPE=%buildType% -DOPENCV_EXTRA_MODULES_PATH="%openCVExtraModules%/" ^<br>
-DINSTALL_TESTS=ON -DINSTALL_C_EXAMPLES=ON -DBUILD_EXAMPLES=ON ^<br>
-DBUILD_opencv_world=ON ^<br>
-DWITH_CUDA=ON -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2" -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DCUDA_ARCH_BIN=5.3,6.0,6.1,7.0,7.5 -DCUDA_ARCH_PTX=7.5 -DWITH_NVCUVID=ON ^<br>
-DWITH_OPENGL=ON ^<br>
-DWITH_MFX=ON ^<br>
-DBUILD_opencv_python3=ON -DPYTHON3_INCLUDE_DIR=%pathToAnaconda%/include -DPYTHON3_LIBRARY=%pathToAnaconda%/libs/python%pyVer%.lib -DPYTHON3_EXECUTABLE=%pathToAnaconda%/python.exe -DPYTHON3_NUMPY_INCLUDE_DIRS=%pathToAnaconda%/lib/site-packages/numpy/core/include -DPYTHON3_PACKAGES_PATH=%pathToAnaconda%/Lib/site-packages/ -DOPENCV_SKIP_PYTHON_LOADER=ON</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Review this tutorial: <a href="https://jamesbowley.co.uk/accelerate-opencv-4-2-0-build-with-cuda-and-python-bindings/" rel="nofollow">https://jamesbowley.co.uk/accelerate-opencv-4-2-0-build-with-cuda-and-python-bindings/</a></p>
<p dir="auto">I am using Anaconda x64 with Python 3.7.4 located in C:\ProgramData\Anaconda3.<br>
Add the Ninja compiler to the system path.</p>
<p dir="auto">Run the above command configuration in terminal.</p>
<h5 dir="auto">Notes</h5>
<p dir="auto">I was able to fix this by changing 'macro' and 'endmacro' on lines 1420 and 1429 in OpenCVUtils.cmake to 'function' and 'endfunction'.</p>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.2.0</li>
<li>Operating System / Platform =&gt; Ubuntu 18.04</li>
<li>Compiler =&gt; gcc</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">When drawing an ellipse with specific but not pathological values and a line thickness less than 5, horizontal lines are displayed.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">The following snipped is sufficient to expose the problem:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13381545/71895240-67606b80-3148-11ea-8f67-3b862e7f11b7.png"><img src="https://user-images.githubusercontent.com/13381545/71895240-67606b80-3148-11ea-8f67-3b862e7f11b7.png" alt="Screenshot from 2020-01-07 12-21-10" style="max-width: 100%;"></a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#include &lt;opencv2/viz/types.hpp&gt;
#include &lt;opencv2/imgproc/imgproc.hpp&gt;
#include &lt;opencv2/highgui.hpp&gt; // for imshow

int main(int argc, char** argv){
  cv::RotatedRect rect;
  rect.angle = 6.52944;
  rect.center.x = 201.968;
  rect.center.y = 373.492;
  rect.size.width = 65.2557;
  rect.size.height = 20.5783;

  cv::Mat test(848,800,CV_8UC3);
  cv::ellipse(test,rect,cv::viz::Color::magenta(),2);
  cv::imshow(&quot;windowName&quot;, test);
  cv::waitKey(0);
}"><pre class="notranslate"><code class="notranslate">#include &lt;opencv2/viz/types.hpp&gt;
#include &lt;opencv2/imgproc/imgproc.hpp&gt;
#include &lt;opencv2/highgui.hpp&gt; // for imshow

int main(int argc, char** argv){
  cv::RotatedRect rect;
  rect.angle = 6.52944;
  rect.center.x = 201.968;
  rect.center.y = 373.492;
  rect.size.width = 65.2557;
  rect.size.height = 20.5783;

  cv::Mat test(848,800,CV_8UC3);
  cv::ellipse(test,rect,cv::viz::Color::magenta(),2);
  cv::imshow("windowName", test);
  cv::waitKey(0);
}
</code></pre></div>
<p dir="auto">When using a higher thickness (e.g., 5) the problem goes away.</p>