Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Histogram and 'auto-levels'

  1. #1
    Intern Newbie
    Join Date
    Oct 2003
    Location
    Russia, Moskow
    Posts
    38

    Histogram and 'auto-levels'

    Hi everyone! Faced an interesting problem.

    It's clear to me how get a histogram for an on-screen image. 2 questions:

    1) How to get (compose?) a histogram for a floating-point image (texture)?

    2) How to perform an 'auto-levels' (see <your favourite graphics editor>) operation on this fp-image (texture)?

    Thanks in advance,

    Dmitry.

  2. #2
    Intern Contributor
    Join Date
    Oct 2005
    Posts
    51

    Re: Histogram and 'auto-levels'

    1. Текстура с одним каналом - это и есть гисторамма. Для текстуры RGB гистораммой будет текстура с одним каналом, полученным как максимум соответстующих точек.

    2. Найди максимальное число в гисторамме - М. Это число нужно поднять до максимально возможного в формате текстуры. Например, если М = 200, а макс. возм. = 255, то все каналы первоначальной текстуры умножай на (255 / 200).

    З.Ы. Приятно встретить земляка на иноземном форуме, и диалог получился приватный

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Aug 2004
    Location
    munich, germany
    Posts
    659

    Re: Histogram and 'auto-levels'

    well, that's what i call a clear answer to the problem.

    but, may i add the following comment: if you solve your problem in the recommended way,
    you should not forget to это и есть гисторамма, before you Найди максимальное число в гисторамме...

  4. #4
    Intern Newbie
    Join Date
    Oct 2003
    Location
    Russia, Moskow
    Posts
    38

    Re: Histogram and 'auto-levels'

    Grand thanks to both of you! Признаюсь, поначалу был слегка шокирован языком ответа, нельзя так людей пугать :-)

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Nov 2002
    Location
    Latvia
    Posts
    626

    Re: Histogram and 'auto-levels'

    AFAIK, histogramm value is not max from RGB, it's the luminance value for given pixel...
    float pix_lm = pixcol.r*0.2125f+pixcol.g*0.7154f+pixcol.b*0.0721f ;

  6. #6
    Intern Contributor
    Join Date
    Jul 2001
    Location
    Santa Clara, CA
    Posts
    84

    Re: Histogram and 'auto-levels'

    Calculating histograms for floating point images is a bit more complicated since there are an arbitrary number of color ranges in the image, but usually you just find the minimum and maximum and then subdivide this range into n buckets.

    Auto levels in Photoshop essentially just scales the colors in an image so that the minimum value is mapped to 0 and the maximum to 255 for each channel.

    It an attempt to make this relevant to OpenGL - there is an example of using occlusion query to calculate histograms in our SDK:
    http://download.developer.nvidia.com/dev...gproc_histogram

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Sep 2004
    Location
    Prombaatu
    Posts
    1,386

    Re: Histogram and 'auto-levels'

    и диалог пришел из приватного.
    как приватно как вы могл думать...не технология перевода чудесна?

    возможно мы будем свободно языковойа барьер скоро.

    наилучшия пожелания,
    bonehead

  8. #8
    Intern Newbie
    Join Date
    Oct 2003
    Location
    Russia, Moskow
    Posts
    38

    Re: Histogram and 'auto-levels'

    Problem solved, thank you all!

    And, as I see, language barrier is a problem no more too :-))

  9. #9
    Intern Contributor
    Join Date
    Oct 2005
    Posts
    51

    Re: Histogram and 'auto-levels'

    As transfer technics is working than why not writing on rus layout...

    Are coefficients may be other. There are many colorymetry government standarts in Russia at any rate are existing. But I am sure what this type of histogram is shall suit to declared intend.

  10. #10
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    807

    Re: Histogram and 'auto-levels'

    May I point out that this is an international forum? Please post in English or don't post at all.

Posting Permissions

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