Logo by KRAFTWERK - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. March 29, 2024, 02:07:23 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Histogram equalization tests  (Read 851 times)
Description: Theory + images
0 Members and 2 Guests are viewing this topic.
SeryZone
Strange Attractor
***
Posts: 253


Contemplate...


« on: May 02, 2014, 07:58:02 PM »

Hello to all, who here!
I wrote visualization, thanks for Dunkan C for helping with this idea.

Code:
begin
        index := 0;
        inc(max);
        Histogram := nil; Percentage:=nil;
        SetLength(Histogram, (max-min));
        SetLength(Percentage, (max-min));
        NUM:=0;
        for x:=0 to (maxx*maxy-1) do
          if Iterdat[x]<max then
          inc(Histogram[IterDat[x]-min]);
        //quicks(0, Length(Histogram), Histogram);  //<----------
        for x:=1 to max-min do
          NUM:=NUM+Histogram[x];
        running_total:=0;
        for x:=1 to max-min do
          begin
            running_total := running_total + histogram[x];
            percentage[x] := running_total / NUM;
          end;
          for y := 0 to maxy-1 do
            for x := 0 to maxx-1 do
          begin
            if (IterDat[x*maxy+y] >= max) then
            begin
              buffer[index] := 0; // red
              buffer[index + 1] := 0; // green
              buffer[index + 2] := 0; // blue
            end
            else if (IterDat[x*maxy+y] > 0) and (IterDat[x*Maxy+y]<max) then
              ColorIndex := round( 4096*(percentage[IterDat[x*maxy+y]-min]) ) mod 4096;
            begin
              buffer[index] := pal[ColorIndex].b; // red
              buffer[index + 1] := pal[ColorIndex].g; // green
              buffer[index + 2] := pal[ColorIndex].r; // blue
            end;
            inc(index, 4)
          end;
          dec(max);
      end;

okay, this part have many-many-many bugs, but I don't gave up and made some experiments. How to make rank-ordered list??? If you help me, I will be very glad!

1) I test this part:
Code:
quicks(0, Length(Histogram), Histogram);  //Sorting Histogram[] array
            ColorIndex := round( 4096*(percentage[IterDat[x*maxy+y]-min]) ) mod 4096;
Result is:



Reminds to me 'Prodigy' spider, ahaha)))  cheesy

2) Here, without sort:



3) Here, I tested squaring:

Code:
ColorIndex := round( 4096*sqr(percentage[IterDat[x*maxy+y]-min]) ) mod 4096;



Very nice result: lower density and more details!

4) And last low-density test - fourth power:

Code:
ColorIndex := round( 4096*sqr(sqr(percentage[IterDat[x*maxy+y]-min])) ) mod 4096;



So, If you can help me with solving mistakes - please, help. This equalization very important for me as designer.

P.s. Hope, you rate it...
Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Histogram jitter test 1 FractalWorks Gallery Duncan C 0 1816 Last post December 20, 2008, 03:57:59 AM
by Duncan C
Histogram jitter test 2 FractalWorks Gallery Duncan C 0 1504 Last post December 20, 2008, 03:58:00 AM
by Duncan C
Histogram Coloring Issue Programming clonexpert 9 3816 Last post February 21, 2010, 04:29:28 AM
by Duncan C
Histogram/Sort equalization Help & Support SeryZone 13 724 Last post May 05, 2014, 07:02:31 PM
by SeryZone
histogram colouring is really streching (not true histogram) Kalles Fraktaler claude 3 10753 Last post December 14, 2014, 11:34:00 PM
by claude

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.144 seconds with 24 queries. (Pretty URLs adds 0.005s, 2q)