<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Another possibility: compute the connected components of the
green plane bitmap image and keep only the largest one. You can
use imlabel then imblobprop (in IPCV):</p>
<p>im=im2bw(imread("G.jpg"),0.5); // I took a screenshot of your G
plane image<br>
<br>
clf<br>
subplot(1,2,1)<br>
imshow(im)<br>
<br>
[im_labeled,n] = imlabel(im);<br>
[a,bb,c] = imblobprop(im_labeled);<br>
[as,k]=gsort(a);<br>
for i=2:n<br>
im(im_labeled==k(i))=0;<br>
end<br>
<br>
subplot(1,2,2)<br>
imshow(im)<br>
</p>
<p>S.<br>
</p>
<div class="moz-cite-prefix">Le 15/07/2020 à 20:39, P M a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CACf7ODtn8r9t6Xj=7FstjKEbXBFQ2V20Oxw1OkTK3TgsJF7_jQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Stéphane,</div>
<div><br>
</div>
<div>Thanks for the hint.</div>
<div><br>
</div>
<div>This is nice for dots being completely surrounded by the
green area.</div>
<div><br>
</div>
<div>In general there might be cases, where the dots are part of
the red and part of the green area.</div>
<div><br>
</div>
<div>The result would than be like this:</div>
<div><br>
</div>
<div>
<div><img src="cid:part1.8D9A2BA2.47D0942F@utc.fr"
alt="grafik.png" class="" width="527" height="399"></div>
<div><br>
</div>
<div>Appreciate your input.</div>
<div>Philipp<br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Am Mi., 15. Juli 2020 um
18:21 Uhr schrieb Stéphane Mottelet <<a
href="mailto:stephane.mottelet@utc.fr"
moz-do-not-send="true">stephane.mottelet@utc.fr</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>
<p>Hello,</p>
<p>Maybe this is not relevant, but if the green region is
garanteed to be always simply connected, you just have to
fill holes in your absdiff(G,B) image (imfill function in
IPCV).<br>
</p>
<p>S.</p>
<p><br>
</p>
<div>Le 15/07/2020 à 17:58, P M a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Dear Scilab community,</div>
<div><br>
</div>
<div>Thanks to Antoine's functions I am able to read
tif-files as M x N x Channel - matrix.</div>
<div><br>
</div>
<div>Px values are:</div>
<div><br>
</div>
<div>red => 255, 0, 0<br>
</div>
<div>green => 0, 255, 0 </div>
<div>black => 0, 0, 0 </div>
<div>white => 255, 255, 255 </div>
<div><br>
</div>
<div>Now: I want to only keep the green pixel values.</div>
<div>This can be done due to: G = img(:,:,2);</div>
<div><br>
</div>
<div>However, this plane does also include the white
pixels, since white has a pixel value of 255 in the
green plane.</div>
<div>This is Ok, as long as the white pixels are
surrounded by the green area.</div>
<div><br>
</div>
<div>However there are also white pixels in the red and
black area.</div>
<div>These white pixels should be set to 0.</div>
<div><br>
</div>
<div>I started to work with differential images , but
somehow I can not get around the problem.</div>
<br>
<div>Please find below an example of my output.</div>
<div><br>
</div>
<div>upper line: RGB; R-plane; G-plane ; B-plane</div>
<div><br>
</div>
<div>As you can see, the G-plane contains white pixel (2
dots), which are within the red-area</div>
<div>The desired output would be to have the G-plane
without the 2 dots.<br>
</div>
<div>
<div><br>
</div>
<div>Any Idea?</div>
<div><br>
</div>
<div>Best Regards,</div>
<div>Philipp<br>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div><img src="cid:part3.9120DAA9.5C603B9B@utc.fr"
alt="grafik.png" style="margin-right: 0px;"
class="" width="1121" height="670"><br>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org" target="_blank" moz-do-not-send="true">users@lists.scilab.org</a>
<a href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" target="_blank" moz-do-not-send="true">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre cols="72">--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.utc.fr/~mottelet" target="_blank" moz-do-not-send="true">http://www.utc.fr/~mottelet</a>
</pre>
</div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank"
moz-do-not-send="true">users@lists.scilab.org</a><br>
<a
href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" moz-do-not-send="true">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users" moz-do-not-send="true">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet" moz-do-not-send="true">http://www.utc.fr/~mottelet</a>
</pre>
</body>
</html>