X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 03 Feb 2014 03:53 AM by  anon
median statistics
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
03 Feb 2014 03:53 AM
    Hello, I want to calculate median value for panchromatic raster image (1 band greyscale). Could you explain me how to adapt this function in envi+idl 5.1 to my needs? Like i understand, and i don't understand much from idl, it's a median filter function. ; Create a simple image and display it: D = SIN(DIST(200)^0.8) & TVSCL, D ; Display D median-filtered with a width of 9: TVSCL, MEDIAN(D, 9) ; Print the median of a four-element array, with and without ; the EVEN keyword: PRINT, MEDIAN([1, 2, 3, 4], /EVEN) PRINT, MEDIAN([1, 2, 3, 4]) IDL prints: 2.50000 3.00000 Best regards, Jevgenijs

    Deleted User



    New Member


    Posts:
    New Member


    --
    06 Feb 2014 06:01 PM
    To use the MEDIAN without filtering, just call it as: img = fix(randomu(sd, 400,400)*256) ; 400x400 image in range 0 - 255 med = median(img) ; returns a single value. print, med If the array is of even length ie 400x400, then a real value from the array is returned. If you want an interpolated value (essentially the average of the two middle values), then set the /EVEN keyword. Hope that helps. Cheers Josh
    You are not authorized to post a reply.