Results 1 to 9 of 9

Thread: Image Processing on textures

  1. #1
    Guest

    Image Processing on textures

    I want to do simple filter operations on a loaded image (maybe a texture on a one sided quad) , I was wondering if there are methods such as getPixel() etc to get the grey level intensity or RGB of a particular region on a image ?

  2. #2
    Guest

    Re: Image Processing on textures

    There is no such function.

    You can do the same thing on the CPU with the raw image data. If you only need to do this once, you'll probably want to do this on the cpu, at image load time. If you need to do this often at runtime, you'll probably want programs/shaders.

    What kind of filter did you have in mind?

    Hlz

  3. #3
    Guest

    Re: Image Processing on textures

    I simply want to get the average of all the pixels in a NxN mask over the whole image (So the new image will be rather pixellated version of the original) , I'll use this in a path finding algorithm where the grey level intensity represents weighting.

    I was hoping openGL could supply some methods but I may have to find a image Library somewhere.

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Image Processing on textures

    glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE );
    then get the texture lod you want, ie with glReadPixels.
    will work only for n=2^k

  5. #5
    Guest

    Re: Image Processing on textures

    Good idea, ZbuffeR.

    I'll use this in a path finding algorithm where the grey level intensity represents weighting.
    interesting. What's the source of your data?

  6. #6
    Guest

    Re: Image Processing on textures

    It's just an 8 bit terrain heightmap

  7. #7
    Guest

    Re: Image Processing on textures

    Does your source heightmap change at all, over time?

  8. #8
    Guest

    Re: Image Processing on textures

    No but my representative grid taken from the Heightmap (i.e through the NxN filter I'm trying to build) will change depending on how many units are nearby, if that grid is an objective , if it has been acquired by friend or enemy etc. I'm really trying to lower the original resolution of the heightmap down to about 60x60 (keeping aspect ratio) because I think the A* pathfinding algorithm works better within that range. Each Grid square within that 60x60 will be the average (using neighbourhood averaging filter) of that region on the heightmap.

  9. #9
    Guest

    Re: Image Processing on textures

    Cool idea.

    I'm also thinking a precomputed quadtree might be an intersting alternative. Selective adaptation is easy if a parent is the average of its children (2x2 filter). But this is getting into a realm unrelated to opengl...

    Good luck with this.

    Hlz

Similar Threads

  1. help on image processing
    By Stiliyan in forum OpenCL
    Replies: 1
    Last Post: 09-24-2014, 06:19 AM
  2. CPU + GPU processing of same image
    By chanakya.sun in forum OpenCL
    Replies: 2
    Last Post: 02-09-2012, 11:01 AM
  3. Image Processing
    By Mark Shaxted in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-12-2006, 10:33 AM
  4. which one is fit for image processing?CPU or GPU?
    By pango in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-14-2004, 11:00 PM
  5. Image processing
    By lhomme in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 05-24-2001, 10:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean