optimization for image processing

Hi, I have written a myfunction handle, which performs certain operations on image matrix based on another internal function using a variable x. By changing the value of x, I can modify my image matrix output (in other words image matrix is dependent on variable x, provided by the user). The output of this function is a matrix. This function handle I am trying to optimize with MATLAB's imbuilt function fmincon; which is suposed to optimize the function for variable x; based on constraint equation written for x. But for some reason, it seems to give an error "User supplied objective function must return a scalar value". Can some please tell me how to correct this error. Also are there any other optimization functions which I can use on Matrix. I am currently using MATLAB R2012a version. Many Thanks. IA|monospaced|

 Accepted Answer

Walter Roberson
Walter Roberson on 22 Nov 2012
The function handle that you invoke in fmincon should not return the image matrix: instead it should return a measure of how good the version based on the value of "x" is, with lower results being better. Then at the end, you can reconstruct the appropriate image matrix by looking at the fmincon outputs, which will include the value of x at which the minimum (best) occurred.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!