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

Home » Public Forums » archive » Re: Need help with vector processing.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Need help with vector processing. [message #10872] Thu, 12 February 1998 00:00 Go to previous message
Dan Bergmann is currently offline  Dan Bergmann
Messages: 2
Registered: February 1998
Junior Member
S Penzes wrote:
>
> Hi one and all,
> I am looking for a smart solution to a problem that keeps occuring
> and that I can't
> seem to find a smart solution for.
> Bear in mind that the example I am using here is much simplified from
> the image
> processing I am trying to do. The goal is to find a solution that
> minimizes compute time (ie no loops).
> Given a vector (lets say vector=[0,0,6,7,8,8,7,0,0,7,8,0,0]) and the
> fact that I have a window that is 3 wide, how do I process vector so
> that any data that is greater than 5 and stays that way for more than 3
> indexes remains and everything else is set to 0.
>
> vector -> process -> [0,0,6,7,8,8,7,0,0,0,0,0,0]

How about

vector=[0,0,6,7,8,8,7,0,0,7,8,0,0]
limit = 5
len = (size(vector))(1)
pad = [limit,limit,vector,limit,limit] gt limit
vector = vector * $
(pad(2:len+1) and $
((pad(1:len) and pad(3:len+2)) $
or(pad(1:len) and pad(0:len-1)) $
or(pad(3:len+2) and pad(4:len+3))))


This is finding the locations where the data and its two nearest
neighbors is greater than the limit, or where the data and its
two neighbors to the left are greater than the limit, or where
the data and its two neighbors to the right are greater than the
limit. Is this what you need??
--
************************************************************ ***
** Dan Bergmann dbergmann@llnl.gov **
** Atmospheric Science Division fax (510) 423-4908 **
** Lawrence Livermore National Lab human (510) 423-6765 **
************************************************************ ***
[Message index]
 
Read Message
Read Message
Previous Topic: Object Program Memory Leaking Everywhere!
Next Topic: Re: How to use hardware fonts in PS and X?

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

Current Time: Sat Oct 11 16:11:56 PDT 2025

Total time taken to generate the page: 0.80358 seconds