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

<ul dir="auto">
<li>OpenCV =&gt; :4.0.1  Android pack</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">When using Opencv Javacamera2View , I get a green color on the camera preview. When i switch to JavaCameraView, the camera diplays well.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/20979107/50424414-00348980-085b-11e9-94d5-88414dc48d72.png"><img src="https://user-images.githubusercontent.com/20979107/50424414-00348980-085b-11e9-94d5-88414dc48d72.png" alt="screenshot_20181225-162646" style="max-width: 100%;"></a></p>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 3.2.0</li>
<li>Operating System / Platform =&gt; RHEL 7</li>
<li>Compiler =&gt; GCC 6.2.1 20161010 (for GNAT Pro 17.1 20170104)</li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">When doing a matrix operation, if the output matrix is of an incompatible type the results will neither be converted to the correct type, nor will any warning/error be thrown.</p>
<p dir="auto">One of these things should happen because the current behavior leads to some very dangerous and difficult to find bugs.</p>
<h5 dir="auto">Steps to reproduce</h5>
<div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="cv::Mat testmat1(3,3, CV_16S, cv::Scalar(0));
cv::Mat testmat2(3,3, CV_32F, cv::Scalar(0));

testmat1.at&lt;int16_t&gt;(1,1) = 50;

cv::blur(testmat1, testmat2, cv::Size(3,3));

std::cout &lt;&lt; testmat2.at&lt;float&gt;(1,1) &lt;&lt; std::endl;"><pre class="notranslate">cv::Mat <span class="pl-en">testmat1</span>(<span class="pl-c1">3</span>,<span class="pl-c1">3</span>, CV_16S, cv::Scalar(<span class="pl-c1">0</span>));
cv::Mat <span class="pl-en">testmat2</span>(<span class="pl-c1">3</span>,<span class="pl-c1">3</span>, CV_32F, cv::Scalar(<span class="pl-c1">0</span>));

testmat1.at&lt;<span class="pl-c1">int16_t</span>&gt;(<span class="pl-c1">1</span>,<span class="pl-c1">1</span>) = <span class="pl-c1">50</span>;

<span class="pl-en">cv::blur</span>(testmat1, testmat2, cv::<span class="pl-c1">Size</span>(<span class="pl-c1">3</span>,<span class="pl-c1">3</span>));

std::cout &lt;&lt; testmat2.at&lt;<span class="pl-k">float</span>&gt;(<span class="pl-c1">1</span>,<span class="pl-c1">1</span>) &lt;&lt; std::endl;</pre></div>
<p dir="auto">This doesn't give the expected output of 5.55555556.</p>