ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Area-based whitebalancing

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Ronald Posted - Feb 02 2016 : 03:54:19
Hello,

Anyone who knows how to whitebalance a whole image, based on witebalancing a selection? Should work like Proc.WhiteBalance_WhiteAt, but instead of a single point, it should take the selected area as basis. The color changes should then be applied on the whole image, not just the selection.

All I was able to do when a selection is active, is whitebalancing the selected area only. This was not my intention.

Regards, Ronald
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Feb 04 2016 : 17:14:07
Hi Ronald

If you look at the code inside Proc.WhiteBalance_WhiteAt, you will see it is calling:

var
  wavg: array [0..2] of double;
  c: Integer;
  coef: array [0..2] of double;
  min, max: array [0..2] of integer;
begin
  IEGetMinMax(bitmap, min, max);

  wavg[0] := imax(1, bitmap.Pixels_ie24RGB[white_x, white_y].b);
  wavg[1] := imax(1, bitmap.Pixels_ie24RGB[white_x, white_y].g);
  wavg[2] := imax(1, bitmap.Pixels_ie24RGB[white_x, white_y].r);

  for c := 0 to 2 do
    coef[c] := max[c]/wavg[c];

  IEApplyCoefficients(bitmap, coef, fOnProgress, Sender);
end;


You could implement this with a selection by iterating through all the pixels within the selection rect and setting wavg to an average of all the values.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com