Hi,
What I did once is to make a copy of imadjdemo.m (Image processing toolbox) and change it for my needs. This allow for interactive change of histogram, brightness and gamma until you get the best results. You can get out the final parameters for use in imadjust function for other images of the same type.
To accomplish this task open the original function:
>> open imadjdemo % assuming it's on your Matlab path. Or:
open(which('imadjdemo'))
Use file -> saveas of the debugger to keep a copy named say,'interactiveEdjust'.
Go to line 262 (on the version I have) and change the images list of ud.hImgPop object to the names of your images files (few typical).
Go to line 956 (that's in LoadNewImage subroutine) and change the names according to the new list. Also change the load command for each case to fit your files (may be use imread instead of load).
Write (or copy from here) a close_me function at the end of the file:
*code*
function close_me
A=get(gcbf,'UserData');
B.Gamma=A.Gamma;
B.Lims=A.LowHiBotTop;
B.origlims=A.StartingLowHiBotTop;
assignin('base','Result',B)
close(gcbf)
*code end*
At line 461 change the callback of ud.hClose (the close button) to: 'imadjdemo(''close_me'')'.
Finally, replace in all callbacks the 'imadjdemo' string by the new file name using the Find and Replace edit utility.
You will get a Result structure in the base workspace.
Type Result at the Matlab prompt after closing the GUI.
Joe Sababa
BSTeX - Equation viewer for Matlab
Joe
BSTeX- Equation viewer for Matlab