File Exchange

image thumbnail

program Color balancing

version 1.0 (1.35 KB) by

A simple program for color balancing

7 Ratings



View License

A simple program for color balancing

Comments and Ratings (12)

xu rui

xu rui (view profile)

Matlab code could run,but the speed is ont fast.Maybe there are double for-loop in code.


The function is badly written. There are unused variables lying around, and the 2 for loops could be removed in favor of the usual Matlab tricks for computational efficiency.
The results are not that visually satisfying either - the color temperature is definitely off on some of the images I tried this function on.


hai , i am hussain
i need how to improve an image white balanced , and colour corrected....
plz help me


Yu (view profile)



ji (view profile)

very good


Austin (view profile)

Thanks this was useful. This script is slow only because of the first double for-loop doing a dynamic memory allocation each time the condition is met. MATLAB is terrible with dynamic memory allocations. Simply add:

Ciny = zeros(1,x*y);

right before the outer for loop (for i=1:x), and then add:

Ciny(cnt:end) = [];

right at the end of the for loop (right above cnt=cnt-1; and then the sort) to get rid of the unused memory. This speeds up the code tremendously.



Tony (view profile)

The program is good. But computationally intensive.

pupu QQ

the effect is good enough,better than some comercial software in China ,for exmaple neo imaging.theory based on a taiwan paper on IEEE

Zhao Quanyou

program for this paper
A Novel Automatic White Balance Method
For Digital Still Cameras

randy copl

Jacques Landry

No commenting of any kind in the file! No description! Mileading keywords. Color or white balances require a calibration file. This does not so is useless.



adding BSD license

MATLAB Release
MATLAB 7.0.1 (R14SP1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video