• Advertisement

Aethanol

Member
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

108 Neutral

About Aethanol

  • Rank
    Newbie
  1. Hello, I'm trying to write an image fusion program in OpenGL/GLSL. At one point I need to calculate a cumulated histogram for a 7x7 pixel area. In fragment shader I'm trying to use a function: [CODE] float graythresh(float aArea[49]) { float hist[256]; for(int i = 0; i < 49; i++) hist[(int)(aArea[i]*255)]+= 1.0; for(int i = 0; i < 256; i++) hist[i] /= 49.0; for(int i = 255; i >= 0; i--) for(int j = 255; j >= 0; j--) if(j > i) hist[i] += hist[j]; return 0.0; } [/CODE] The last loop causes application crash and error "driver stopped responding". I tried using older drivers, and testing the application on different computer, nothing changed. [CODE] for(int i = 255; i >= 0; i--) for(int j = i-1; j >= 0; j--) hist[i] += hist[j]; [/CODE] Gave same error. Is it even possible to this? Thanks in Advance, any help will be appreciated. (I'm using GeForce GT 420M, windows 7)
  • Advertisement