Given a binary image of a single connected object, what is
the quickest way to find a sample of pixels on its
edge/perimeter. By a sample of pixels I do not mean all
pixels on the perimeter, but just a sample of fixed number
of pixels, where each pixel is separated from the other by
some margin. (I also have the Image processing toolbox)
In article <g051aq$m6a$1@fred.mathworks.com>,
Ahmad <ahmad.humyn@gmail.com> wrote:
>Given a binary image of a single connected object, what is
>the quickest way to find a sample of pixels on its
>edge/perimeter. By a sample of pixels I do not mean all
>pixels on the perimeter, but just a sample of fixed number
>of pixels, where each pixel is separated from the other by
>some margin. (I also have the Image processing toolbox)
Could you expand on the bit about "where each pixel is separated
from the other by some margin" ? Margin in what sense?
If you are talking about geometric distances, then do you want
the -furthest- point that is at most that distance away, or
do you waht the -closest- point that is at least that distance away?
If you are talking about listing the perimeter points in a list
and taking every N'th entry from the list, then you need to
determine your traversal algorithm; for example if you are
coming down from the left-top of an "X" and you reach the centre,
then which of the three other branches is the next one to follow?
--
"Do diddle di do,
Poor Jim Jay
Got stuck fast
In Yesterday." -- Walter De La Mare
On May 10, 4:42=A0pm, "Ahmad " <ahmad.hu...@gmail.com> wrote:
> Hi there,
>
> Given a binary image of a single connected object, what is
> the quickest way to find a sample of pixels on its
> edge/perimeter. By a sample of pixels I do not mean all
> pixels on the perimeter, but just a sample of fixed number
> of pixels, where each pixel is separated from the other by
> some margin. (I also have the Image processing toolbox)
>
> Regards,
----------------------------------------------------------------------------=
--------
Ahmad:
What is it about bwboundary that you don't know how to deal with?
This gives you the boundaries of objects. You could then take a
"sample of fixed number of pixels" from that just by taking the first
N pixels, or using rand to generate indexes to extract or lots of
other methods. What are you really after when you say your want just
a sample of the boundaries rather than all of them. What good would
that be?
Regards,
ImageAnalyst
Thanks :) Nothing is wrong with bwboundary or
bwtraceboundary...I just didn't know about them. Thanks for
pointing me in the right direction. These functions were
exactly what I was looking for :)
Thank you for all the help.
Regards,
ImageAnalyst <imageanalyst@mailinator.com> wrote in message
<f41d7a04-fb33-46b9-978d-746a147f91f6@b64g2000hsa.googlegroups.com>...
> On May 10, 4:42=A0pm, "Ahmad " <ahmad.hu...@gmail.com> wrote:
> > Hi there,
> >
> > Given a binary image of a single connected object, what is
> > the quickest way to find a sample of pixels on its
> > edge/perimeter. By a sample of pixels I do not mean all
> > pixels on the perimeter, but just a sample of fixed number
> > of pixels, where each pixel is separated from the other by
> > some margin. (I also have the Image processing toolbox)
> >
> > Regards,
>
----------------------------------------------------------------------------=
> --------
> Ahmad:
> What is it about bwboundary that you don't know how to
deal with?
> This gives you the boundaries of objects. You could then
take a
> "sample of fixed number of pixels" from that just by
taking the first
> N pixels, or using rand to generate indexes to extract or
lots of
> other methods. What are you really after when you say
your want just
> a sample of the boundaries rather than all of them. What
good would
> that be?
> Regards,
> ImageAnalyst
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.