Skip to content
Raphael Kim edited this page Mar 9, 2017 · 2 revisions

CLAHE ( Contrast Limited Adaptive Histogram Equalization )

  • librawprocessor now supports CLAHE
  • Original code by Karel Zuiderveld, [email protected] in "Graphics Gems IV", Academic Press, 1994

Re-programmed for librawprocessor

Example: Adjusting tone mapped image with algorithm of Drago.

    RAWProcessor* rawp1 = new RAWProcessor( "test_3072h.img", 3072 );

    if ( rawp1 != NULL )
    {
        if ( rawp1->Loaded() == true )
        {
            RAWProcessor::WeightAnalysisReport wreport;

            wreport.threshold_wide_max = rawp1->MaximumLevel();
            wreport.threshold_wide_min = 0;
            unsigned maxv = rawp1->MaximumLevel() + 1;

            if ( rawp1->ApplyCLAHE( wreport, 8, maxv , 50.0f ) == true )
            {
                printf("CLAHE success.\n");
                rawp1->SaveToFile( "out_clahe_3072h.img" );
            }
            else
            {
                printf("CLAHE failure.\n");
            }

        }
        else
        {
            printf("Failure: file not loaded.\n");
        }

        delete rawp1;
    }
    else
    {
        printf("Error.\n");
    }
Clone this wiki locally