comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Efficient finding of locations where two 'on' pixels are next to one another
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Efficient finding of locations where two 'on' pixels are next to one another [message #74361] Thu, 13 January 2011 09:28
Robin Wilson is currently offline  Robin Wilson
Messages: 40
Registered: August 2010
Member
Hi,

I'm working with a binary image which is the output of another procedure
I've run. I am trying to write a routine to post-process this image, and
clean it up a bit. As part of this, I want to find the indices of pixels
that are set to 1 (ie. 'on') that are next to other pixels that are set
to 1, but only in the X direction. To make that a bit clearer, there is
a diagram below:


(0) . . . * * . .
(1) . . . * . . .
(2) . . * * * . .
(3) . . . * . . .
(4) . . . * . . .

In this example I would want the indices of both 'on' pixels in Row 0,
nothing in Row 1 (as the pixel is not touching anything in the X
direction), all three in Row 2, and nothing in Rows 3 and 4.

At the moment all I can think of some kind of ghastly FOR loop with
loads of state-checking. I'm thinking that there must be a nicer (that
is more efficient and cleaner code) way...is there?

Cheers again,

Robin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: 2d min
Next Topic: Re: Efficient finding of locations where two 'on' pixels are next to one another

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 22:33:56 PDT 2025

Total time taken to generate the page: 0.64232 seconds