Image Smoothing 3 by 3 Matrix...

  1. #1
    Cloud's Hair Spray Reputation: 10

    Join Date
    May 2006
    Posts
    63
    Rep Power
    8

    Default Image Smoothing 3 by 3 Matrix...

    I didnt know wether this would fit under Game dev or General Programming but it seems to be more programming than game deving.... I'ts for my map editor I'm trying to create a smoothing algorithim... it takes the 8 pixels around the pixel your smoothing and averages them to get the middle of the 3 by 3 matrice's height. question is do I include the middle point's height value in the averaging?


    like you have

    1|9|1
    1|1|1

    1|1|1

    1+9+1+1+1+1+1+1+1 = 17/9 which is 1.8888888888888888888 etc...

    or

    1+9+1+1+1+1+1+1 = 16/8 = 2....


    so which one's the most efficient smoothing algorithm?
    Legends of Alterion - Under Development

    toast lands butter down, cats land on their feet, what happens when u strap toast to a cat?.....
    Math indicates they will hover in quatom indecision...(yet to be tested)

  2. #2
    Orc's Breathmint Reputation: 10
    HopeDagger's Avatar
    Join Date
    May 2006
    Location
    Ontario, Canada
    Posts
    119
    Rep Power
    8

    Default

    Try a Google search on "convolution linear filtering". There's heaps of resources on this flavour of filtering.
    Gauntlets of Recursion (+5) - My game development journal.

  3. #3
    Cloud's Hair Spray Reputation: 10

    Join Date
    May 2006
    Posts
    63
    Rep Power
    8

    Default

    hmm interesting.... Anyone know how they changed File IO in .Net with c++ because i've tried googling and i still get the old fstream.h and its not popping up
    Legends of Alterion - Under Development

    toast lands butter down, cats land on their feet, what happens when u strap toast to a cat?.....
    Math indicates they will hover in quatom indecision...(yet to be tested)

  4. #4
    Orc's Breathmint Reputation: 10
    HopeDagger's Avatar
    Join Date
    May 2006
    Location
    Ontario, Canada
    Posts
    119
    Rep Power
    8

    Default

    Quote Originally Posted by Tocs1001
    Anyone know how they changed File IO in .Net with c++ because i've tried googling and i still get the old fstream.h and its not popping up
    You using Visual C++ 2005 Express? You'll need to download the Platform SDK before you can access those headers.
    Gauntlets of Recursion (+5) - My game development journal.

  5. #5
    Cloud's Hair Spray Reputation: 10

    Join Date
    May 2006
    Posts
    63
    Rep Power
    8

    Default

    express no.... I have Microsoft Visual Studio 2003 .NET and they changed <fstream.h> and <iostream.h> to <fstream> and <iostream>, I also had to usenamespace std... and now fstream::get () is giving me -1, but thanks for the help I just gotta tangle with this for a while, things have changed since I last wrote my .raw heightmap loader in MSVS 6.0 ... Good news is thanks to u I got a smoothing function working thx ^.^ File I/O always drove me crazy >.>
    Last edited by Tocs1001; 05-29-2006 at 03:49 AM.
    Legends of Alterion - Under Development

    toast lands butter down, cats land on their feet, what happens when u strap toast to a cat?.....
    Math indicates they will hover in quatom indecision...(yet to be tested)

Posting Permissions

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