Using fminsearch to optimize image noise

I have a MRI image I want to add noise to it and use the fminsearch to optimize the error(noise) this is my code:
im1 = imread('C:\Users\..')%load the image
four1 = fft2 ( im1); %Fourier transform for image
noise = randi ([-20,20],(size(im1))); % create a noise matrix
im2 = im1 + uint8(noise); %add noise to the image
four2 = fft2(im2); %furrier transform for image2
I'm stuck here i need to use the fminsearch to reduce noise and reconstruct image 1.I think my objective function is double sum of (four1-four2)^2.

2 Comments

Pray tell, what parameters are you minimizing over? What are the unknowns? Don't tell me that you intend to do something silly like search over the entire nrows*ncols space of the image, and do that using fminsearch.
And, you should realize that fft2 of an image will be complex, so computing the simple square of the difference of the pair of ffts will also yield a complex result, again a problem for fminsearch.
1st sorry if my question is not clear enough I am new to matlab. my objective is to get an image add noise to it optimize the error to get as close as possible to the initial image I can use different optimization function if fminsearch does not work. And yes I was trying to search over the entire image space:/. Thank you for your help.

Sign in to comment.

Answers (0)

Categories

Products

Asked:

on 19 Oct 2015

Edited:

on 19 Oct 2015

Community Treasure Hunt

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

Start Hunting!