Note that there are some explanatory texts on larger screens.

plurals
  1. POimage focus and FFT
    primarykey
    data
    text
    <p>I am a new to Matlab and I have a project that involves image processing.</p> <p>I have a number of RGB images and I need to find a way to separate the out of focus from the in focus images. I do not need to correct the focus of the out of focus ones, I just need to find which are out of focus and remove them. I have done <code>FFT2</code> to the image and then used the radial average of the image of the power spectrum to see if there is a difference between the in focus or out of focus but I do not see a difference between the two.</p> <p>I decided to use the gradient of the image </p> <pre><code>[gradx,grady]=gradient(image) </code></pre> <p>and then take the magnitude </p> <pre><code>new_image=sqrt((gradx.^2)+(grady.^2)) </code></pre> <p>and try to do the <code>FFT2</code> using the <code>new_image</code> now instead of the <code>image</code>. The power spectrum does not look like what I expect so I am not sure if I should do the <code>FFT2</code> on the <code>new_image</code> of the <code>gradx</code> and <code>grady</code> separately. Has anyone have any thoughts about whether this is the right way to do this?</p> <p>I was also thinking that instead of using the gradient to use a Sobel mask</p> <pre><code>mask=fspecial('sobel') mask_x=imfilter(image,mask) mask_y=imfilter(image,mask') new_image=sqrt((mask_x.^2)+(mask_y.^2)) </code></pre> <p>and then do <code>FFT2</code> in the <code>new_image</code> but again the power spectrum is not right. I expect it to start from zero and instead it starts from the highest value and drops exponentially.</p> <p>Has anyone tried to classify images using this method? Thank you for reading.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload