X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Aug 2007 09:38 AM by  anon
substitute strange value
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
08 Aug 2007 09:38 AM
    hi, everyone. I have an image include one band, it has 7000*8000 dimensions. I want to find some strange values, such as the value great than 0.8, and substitute this strange values by the surrounding pixels which less than 0.8. How can I accomplish it in IDL? thank you very much.

    Deleted User



    New Member


    Posts:
    New Member


    --
    08 Aug 2007 09:38 AM
    The cleat start for solving this program is to invoke IDL's WHERE function, as in: outlyingDataSubscripts = where(bandData gt 0.8, nOutliers) This returns in 'outlyingDataSubscripts' the indexes of all 'bandData' elements that have value greater than 0.8. It returns in 'nOutliers' the number of elements that were returned by WHERE. Syntax like the following: bandData[outlyingDataSubscripts] = myReplacementValue is the way you could assign one constant replacement value to all the elements in 'bandData' that are currently greater than 0.8.. If you want to modify each element returned by WHERE with a function based on the neighbors in all directions around the WHERE elements, then you will also want to study the function ARRAY_INDICES. WHERE, namely, returns just the one-dimensional subscript into 'bandData' (as it the programmer had reformed 'bandData' into one long vector array). ARRAY_INDICES can be used to give you back the 2D subsciript that maps to the 1D value returned by WHERE. James Jones
    You are not authorized to post a reply.