Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!usc!apple!bionet!ames!haven!ni.umd.edu!uc780.umd.edu!cs450a03 From: cs450a03@uc780.umd.edu Newsgroups: comp.lang.apl Subject: RE: Histogram Message-ID: <31MAR91.18441674@uc780.umd.edu> Date: 31 Mar 91 18:44:16 GMT References: <27764@uflorida.cis.ufl.EDU> Sender: usenet@ni.umd.edu (USENET News System) Organization: The University of Maryland University College Lines: 13 Nntp-Posting-Host: uc780.umd.edu Ken Block writes: >What would be an efficient way to generate a histogram? I have a >64x64 greyscale (0 to 255) image and I need the frequencies. The >obvious methods produce large amounts of data O(64*64*265) and cause >the machine thrash. Any suggestions... I can think of two easy solutions. (1) break that 64x64 image into smaller pieces, apply your code to each piece and assemble the results. (2) I'm not sure what kind of histogram you are trying to generate, but can't you just ravel the image data, sort the intensities, then find the length of each partition? Raul