I am trying to find the image which has the optimum focus of a focus stack (10 images). I am able to find the best two images by using the minimum gray intensity values but now the problematic part comes.

All standard methods fail because I have a very strong background with sharp edges which are laying under my object, the green cell.

Best image for human eye:

Best image for human eye

Best image choose by CV methods:

Best image choose by CV methods

I tried already many things like FFT, filters, edge detection but most of the time it fails...

Any hints would be very much appreciated.

  • $\begingroup$ why don’t you use the colors? $\endgroup$ – Stanley Pawlukiewicz Nov 8 '17 at 6:16
  • $\begingroup$ Because sometimes the dye is leaking outside the cell...This is a nice example but it's not always so clear. $\endgroup$ – snowflake Nov 8 '17 at 6:38
  • $\begingroup$ But would it help most of the time? Automation or people are never perfect $\endgroup$ – Stanley Pawlukiewicz Nov 8 '17 at 12:20
  • $\begingroup$ Not really...If you look at the example above in the second image, those strong structures also appear inside the green cell (upper cell wall), which means any method would favor the second image... $\endgroup$ – snowflake Nov 8 '17 at 13:19
  • $\begingroup$ You might want to look at lightfield cameras. You can set the focal plane computationally. There is an interesting literature on computational photography. I don’t have enough experience with it to know if having multiple focal planes can be used $\endgroup$ – Stanley Pawlukiewicz Nov 8 '17 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.