[scilab-Users] Finding continuous parts in a mask (ie a binary matrix)

Mike Page Mike at Page-One.Waitrose.com
Tue Mar 8 11:21:38 CET 2011


Hi Antoine,

You could use a Sobel transform to detect the edges where the value changes
from 0 to 1 or 1 to 0.

But maybe you were looking for something simpler?

Mike.


-----Original Message-----
From: Antoine Monmayrant [mailto:antoine.monmayrant at laas.fr]
Sent: 08 March 2011 09:58
To: users at lists.scilab.org
Subject: [scilab-Users] Finding continuous parts in a mask (ie a binary
matrix)


Hi everyone,

I have question that is more about image filtering than scilab, but I
haven't found any answer so far so I'm turning towards scilab users.
I am looking for a way to determine continuous parts in a matrix made of
1 or 0.
Basically, this matrix is used as a mask to filter an image and I need
to determine the number of isolated "grains" (ie continuous parts where
the matrix is equal to 1) in this mask.
As an example, here is a mask:

-->mask
  mask  =

     0.    0.    0.    0.    0.    0.    0.    0.    0.    0.
     0.    0.    0.    0.    0.    0.    1.    1.    1.    0.
     0.    0.    0.    0.    0.    0.    1.    1.    1.    0.
     0.    0.    0.    0.    0.    0.    1.    1.    1.    0.
     0.    1.    1.    0.    0.    0.    0.    0.    0.    0.
     0.    1.    1.    1.    0.    0.    0.    0.    0.    0.
     0.    0.    1.    1.    0.    0.    0.    0.    0.    0.
     0.    0.    0.    0.    0.    0.    0.    0.    0.    0.
     0.    0.    0.    0.    0.    0.    0.    0.    0.    0.
     0.    0.    0.    0.    0.    0.    0.    0.    0.    0.


It contains 2 "grains", one in the upper-right corner, and one in the
middle-left.
I would like to be able to isolate them in order to determine their
position in the matrix, size,...
Do any of you know of a good algorithm to achieve this?
Do any of you know what are the relevant names or keywords associated to
this kind of algorithm?

Thank you in advance,

Antoin

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.872 / Virus Database: 271.1.1/3488 - Release Date: 03/07/11
20:43:00




More information about the users mailing list