<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>... Ok, my approach:<br><br><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">R = img( : , : , 1)<br></span><span style="color:rgb(0,0,0)">G = img( : , : , 2)<br></span><span style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">B = img( : , : , 3)</span></span><span style="color:rgb(0,0,0)"></span></pre>does not work ... although I remember it somehow using it with IPD & scilab 5.4.1...good old times :-)<br></div><br></div><div>In SciCV a image is a mlist<br><br></div><div>But still same issue:<br></div><div><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)"><span style="color:rgb(100,174,100);font-style:italic">/</span></span><span style="color:rgb(100,174,100);font-style:italic">// build the image</span>
<span style="color:rgb(0,0,0)">img</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(50,185,185)">mlist</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(74,85,219)">[</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(188,143,143)">v</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(188,143,143)">r</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(188,143,143)">g</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(188,143,143)">b</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(188,143,143)">a</span><span style="color:rgb(188,143,143)">'</span><span style="color:rgb(74,85,219)">]</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(50,185,185)">zeros</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">10</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">10</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(50,185,185)">zeros</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">10</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">10</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(50,185,185)">zeros</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">10</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">10</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(50,185,185)">zeros</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">10</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">10</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(100,174,100);font-style:italic">// extract the R-plane</span>
<span style="color:rgb(0,0,0)">R</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">img</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">r</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(100,174,100);font-style:italic">// modify the R-plane</span>
<span style="color:rgb(0,0,0)">R</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">3</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(188,143,143)">6</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(188,143,143)">4</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(188,143,143)">8</span><span style="color:rgb(74,85,219)">)</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">255</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(100,174,100);font-style:italic">// write the R-plane back to the image</span>
<span style="color:rgb(0,0,0)">img</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">r</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">R</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(100,174,100);font-style:italic">// check the image content</span>
<span style="color:rgb(50,185,185)">disp</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">img</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span><span style="color:rgb(0,0,0)"></span></pre>Why is this not possible with an image nativly created with SciCV ?<br><br></div><div>Thanks,<br></div><div>Philipp<br></div><div><br></div><div dir="ltr"><br><br><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Di., 5. März 2019 um 10:24 Uhr schrieb P M <<a href="mailto:p.muehlmann@gmail.com">p.muehlmann@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear all,<br><br></div>I read an RGB image with ScCV imread:<br><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">img</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(50,185,185)">imread</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">path_to_image</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">CV_LOAD_IMAGE_COLOR</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">The result is an image of type: CV_8UC3</span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">I can display the image pixel values with: disp(img)<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">The image itself is of type: Mat (Mlist)<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">So far, so clear.<br><br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">Now, I want to extract a single plane..lets say the R-plane<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">I would normally do something like this:<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">R = img( : , : , 1)<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">But for some reason it does not work.<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">It seems that one can only extract pixel values from all 3 planes altogether.....If so, why?<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">So the question comes down to: How to extract/change a single pixel value of a single plane in SciCV ?<br><br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">Thank you,<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">Philipp<br></span></pre></div></div></div>
</blockquote></div></div></div></div></div></div></div></div></div>