Notices
Results 1 to 7 of 7

Thread: finding a weighted average using "linear weight"

  1. #1 finding a weighted average using "linear weight" 
    Forum Freshman
    Join Date
    Oct 2009
    Posts
    13
    say i have and image of 1000 pixels by 1000 pixels, and each pixel holds a value. but there are some pixels that are blocked out (ie value-less). now, i want to find a value for a value-less pixel, and how i want to do this is by finding a weighted-average from the surrounding pixels. what this means is that i will pick out the valued pixels that lie within, say, 10 pixel steps from the valueless pixel, then assign a weight to these valued pixels based on their distances away from the valueless pixel. the further away it is, the less weight is assigned.

    the problem is, what kind of linear weight trend should i use? what kind of weight do i assign to a pixel of a particular distance? can i use any arbitrary assignments or is there some kind of commonly-used method?


    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Professor
    Join Date
    Sep 2007
    Posts
    1,079
    Perhaps this is a mathematical question rather than earth sciences?


    Reply With Quote  
     

  4. #3  
    Forum Freshman
    Join Date
    Oct 2009
    Posts
    13
    oh i posted it here because it's related to satellite image processing, and not mathematical enough. should i post it there instead?
    Reply With Quote  
     

  5. #4  
    WYSIWYG Moderator marnixR's Avatar
    Join Date
    Apr 2007
    Location
    Cardiff, Wales
    Posts
    5,810
    moved to maths
    "Reality is that which, when you stop believing in it, doesn't go away." (Philip K. Dick)
    Reply With Quote  
     

  6. #5  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    You could start with either the median or use Gaussian weights. I'm not sure that's exactly what you're looking for though.
    Reply With Quote  
     

  7. #6  
    Forum Professor sunshinewarrior's Avatar
    Join Date
    Sep 2007
    Location
    London
    Posts
    1,525
    Quote Originally Posted by MagiMaster
    You could start with either the median or use Gaussian weights. I'm not sure that's exactly what you're looking for though.
    I presume it's for image enhancement - to match an unassigned pixel to surrounding pixels that already have a weighting.

    The problem I foresee is trying to figure out a programme/equation that will take into account the two dimensional nature of this matter: suppose East -West (to arbitrarily assign a direction), the pixels are all pretty much the same, but North-South there's a steep gradient (if using grayscale, say, there's a big difference in tone), then any equation that takes all the surrounding pixels into account might well give it an aberrant value.

    I presume, however, that there are loads of image enhancement programs around tht would take all this into acount.

    bobby2009: Are you sure you want to do this from scratch?
    Reply With Quote  
     

  8. #7  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    The Gaussian should give a reasonably close answer in most such cases, assuming you don't make it too big. But yeah, there are probably some gradient based methods that would take such things into account more directly.
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •