<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.2</li>
<li>Operating System / Platform =&gt; osx</li>
<li>Compiler =&gt; clang</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">copyTo does not use the type information available when copying between two typed matrices.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">cv::Mat1b a{10, 10};<br>
cv::Mat2b b{10, 10};<br>
b.copyTo(a) // will fail at runtime, though it should not compile</p>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 4.1.1</li>
<li>Operating System / Platform =&gt; Webassembly</li>
<li>Compiler =&gt; emscripten</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I got this error message while compiling my C++ program that uses VideoCapture object<br>
I compiled OpenCV using this build_js.py</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
def get_cmake_cmd(self):
        cmd = [&quot;cmake&quot;,
               &quot;-DCMAKE_BUILD_TYPE=Release&quot;,
               &quot;-DCMAKE_TOOLCHAIN_FILE='%s'&quot; % self.get_toolchain_file(),
               &quot;-DCPU_BASELINE=''&quot;,
               &quot;-DCPU_DISPATCH=''&quot;,
               &quot;-DCV_TRACE=OFF&quot;,
               &quot;-DBUILD_SHARED_LIBS=OFF&quot;,
               &quot;-DWITH_1394=OFF&quot;,
               &quot;-DWITH_ADE=OFF&quot;,
               &quot;-DWITH_VTK=OFF&quot;,
               &quot;-DWITH_EIGEN=OFF&quot;,
               &quot;-DWITH_FFMPEG=ON&quot;,
               &quot;-DWITH_GSTREAMER=ON&quot;,
               &quot;-DWITH_GTK=ON&quot;,
               &quot;-DWITH_GTK_2_X=OFF&quot;,
               &quot;-DWITH_IPP=OFF&quot;,
               &quot;-DWITH_JASPER=OFF&quot;,
               &quot;-DWITH_JPEG=ON&quot;,
               &quot;-DWITH_WEBP=ON&quot;,
               &quot;-DWITH_OPENEXR=OFF&quot;,
               &quot;-DWITH_OPENGL=OFF&quot;,
               &quot;-DWITH_OPENVX=OFF&quot;,
               &quot;-DWITH_OPENNI=OFF&quot;,
               &quot;-DWITH_OPENNI2=OFF&quot;,
               &quot;-DWITH_PNG=ON&quot;,
               &quot;-DWITH_TBB=OFF&quot;,
               &quot;-DWITH_PTHREADS_PF=OFF&quot;,
               &quot;-DWITH_TIFF=ON&quot;,
               &quot;-DWITH_V4L=ON&quot;,
               &quot;-DWITH_OPENCL=ON&quot;,
               &quot;-DWITH_OPENCL_SVM=ON&quot;,
               &quot;-DWITH_OPENCLAMDFFT=ON&quot;,
               &quot;-DWITH_OPENCLAMDBLAS=ON&quot;,
               &quot;-DWITH_GPHOTO2=OFF&quot;,
               &quot;-DWITH_LAPACK=OFF&quot;,
               &quot;-DWITH_ITT=OFF&quot;,
               &quot;-DWITH_QUIRC=OFF&quot;,
               &quot;-DBUILD_ZLIB=ON&quot;,
               &quot;-DBUILD_opencv_apps=ON&quot;,
               &quot;-DBUILD_opencv_calib3d=ON&quot;,
               &quot;-DBUILD_opencv_dnn=ON&quot;,
               &quot;-DBUILD_opencv_features2d=ON&quot;,
               &quot;-DBUILD_opencv_flann=ON&quot;,  # No bindings provided. This module is used as a dependency for other modules.
               &quot;-DBUILD_opencv_gapi=OFF&quot;,
               &quot;-DBUILD_opencv_ml=OFF&quot;,
               &quot;-DBUILD_opencv_photo=ON&quot;,
               &quot;-DBUILD_opencv_imgcodecs=ON&quot;,
               &quot;-DBUILD_opencv_shape=OFF&quot;,
               &quot;-DBUILD_opencv_videoio=ON&quot;,
               &quot;-DBUILD_opencv_videostab=ON&quot;,
               &quot;-DBUILD_opencv_highgui=ON&quot;,
               &quot;-DBUILD_opencv_superres=OFF&quot;,
               &quot;-DBUILD_opencv_stitching=OFF&quot;,
               &quot;-DBUILD_opencv_java=OFF&quot;,
               &quot;-DBUILD_opencv_java_bindings_generator=OFF&quot;,
               &quot;-DBUILD_opencv_js=ON&quot;,
               &quot;-DBUILD_opencv_python2=OFF&quot;,
               &quot;-DBUILD_opencv_python3=OFF&quot;,
               &quot;-DBUILD_opencv_python_bindings_generator=OFF&quot;,
               &quot;-DBUILD_EXAMPLES=OFF&quot;,
               &quot;-DBUILD_PACKAGE=OFF&quot;,
               &quot;-DBUILD_TESTS=OFF&quot;,
               &quot;-DBUILD_PERF_TESTS=OFF&quot;]"><pre class="notranslate"><span class="pl-k">def</span> <span class="pl-en">get_cmake_cmd</span>(<span class="pl-s1">self</span>):
        <span class="pl-s1">cmd</span> <span class="pl-c1">=</span> [<span class="pl-s">"cmake"</span>,
               <span class="pl-s">"-DCMAKE_BUILD_TYPE=Release"</span>,
               <span class="pl-s">"-DCMAKE_TOOLCHAIN_FILE='%s'"</span> <span class="pl-c1">%</span> <span class="pl-s1">self</span>.<span class="pl-en">get_toolchain_file</span>(),
               <span class="pl-s">"-DCPU_BASELINE=''"</span>,
               <span class="pl-s">"-DCPU_DISPATCH=''"</span>,
               <span class="pl-s">"-DCV_TRACE=OFF"</span>,
               <span class="pl-s">"-DBUILD_SHARED_LIBS=OFF"</span>,
               <span class="pl-s">"-DWITH_1394=OFF"</span>,
               <span class="pl-s">"-DWITH_ADE=OFF"</span>,
               <span class="pl-s">"-DWITH_VTK=OFF"</span>,
               <span class="pl-s">"-DWITH_EIGEN=OFF"</span>,
               <span class="pl-s">"-DWITH_FFMPEG=ON"</span>,
               <span class="pl-s">"-DWITH_GSTREAMER=ON"</span>,
               <span class="pl-s">"-DWITH_GTK=ON"</span>,
               <span class="pl-s">"-DWITH_GTK_2_X=OFF"</span>,
               <span class="pl-s">"-DWITH_IPP=OFF"</span>,
               <span class="pl-s">"-DWITH_JASPER=OFF"</span>,
               <span class="pl-s">"-DWITH_JPEG=ON"</span>,
               <span class="pl-s">"-DWITH_WEBP=ON"</span>,
               <span class="pl-s">"-DWITH_OPENEXR=OFF"</span>,
               <span class="pl-s">"-DWITH_OPENGL=OFF"</span>,
               <span class="pl-s">"-DWITH_OPENVX=OFF"</span>,
               <span class="pl-s">"-DWITH_OPENNI=OFF"</span>,
               <span class="pl-s">"-DWITH_OPENNI2=OFF"</span>,
               <span class="pl-s">"-DWITH_PNG=ON"</span>,
               <span class="pl-s">"-DWITH_TBB=OFF"</span>,
               <span class="pl-s">"-DWITH_PTHREADS_PF=OFF"</span>,
               <span class="pl-s">"-DWITH_TIFF=ON"</span>,
               <span class="pl-s">"-DWITH_V4L=ON"</span>,
               <span class="pl-s">"-DWITH_OPENCL=ON"</span>,
               <span class="pl-s">"-DWITH_OPENCL_SVM=ON"</span>,
               <span class="pl-s">"-DWITH_OPENCLAMDFFT=ON"</span>,
               <span class="pl-s">"-DWITH_OPENCLAMDBLAS=ON"</span>,
               <span class="pl-s">"-DWITH_GPHOTO2=OFF"</span>,
               <span class="pl-s">"-DWITH_LAPACK=OFF"</span>,
               <span class="pl-s">"-DWITH_ITT=OFF"</span>,
               <span class="pl-s">"-DWITH_QUIRC=OFF"</span>,
               <span class="pl-s">"-DBUILD_ZLIB=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_apps=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_calib3d=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_dnn=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_features2d=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_flann=ON"</span>,  <span class="pl-c"># No bindings provided. This module is used as a dependency for other modules.</span>
               <span class="pl-s">"-DBUILD_opencv_gapi=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_ml=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_photo=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_imgcodecs=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_shape=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_videoio=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_videostab=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_highgui=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_superres=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_stitching=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_java=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_java_bindings_generator=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_js=ON"</span>,
               <span class="pl-s">"-DBUILD_opencv_python2=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_python3=OFF"</span>,
               <span class="pl-s">"-DBUILD_opencv_python_bindings_generator=OFF"</span>,
               <span class="pl-s">"-DBUILD_EXAMPLES=OFF"</span>,
               <span class="pl-s">"-DBUILD_PACKAGE=OFF"</span>,
               <span class="pl-s">"-DBUILD_TESTS=OFF"</span>,
               <span class="pl-s">"-DBUILD_PERF_TESTS=OFF"</span>]</pre></div>