iDevGames Forums
Histogram equalization - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Histogram equalization (/thread-9385.html)



Histogram equalization - g00se - Oct 3, 2011 12:52 PM

I want to ask for histogram equalization. First i count histogram:

Code:
for (i=0; i<width; i++) {
        for (j=0; j<height; j++) {
            pixelValue = pixels[(j*width + i)];
            tablica[pixelValue] += 1;
        }
    }

Second thing is distribution:

Code:
for (int i=0; i<[histogram count]; i++) {
        sum += [[histogram objectAtIndex:i] intValue];
        [dystrybuanta addObject:[NSNumber numberWithInteger:sum]];
    }

But now i should count Look Up Table and apply this LUT at picture. Can anyone help me with this?