Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9212871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:37:22+00:00 2026-06-18T01:37:22+00:00

I am programming automatic focusing on a microscope with programmable axis controller. For testing,

  • 0

I am programming automatic focusing on a microscope with programmable axis controller.
For testing, I’ve implemented a simulation, which returns an image depending on exposure, axis position, etc. The simulation takes a good image, and distorts it – e.g. makes brighter, darker.

The primer indicator for good focus are sharp edges (works well for my type of images). Basically I sum the intensity differences between neighboirung pixels. The higher the sum, the better focus.

My question is, how to simulate unfocused image? Did anyone implemented it already?
A sequence of filters would be great.

I’ve tried cvSmooth, but it didn’t give realistic results.

PS: My current workaround is changing ROI-size inversily proportional to distance from focus-position. It works well for testig my algorithms, but not good for demonstrations – as the image doesn’t change during simulation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:37:23+00:00Added an answer on June 18, 2026 at 1:37 am

    (I’m not sure if stack overflow is the right site for your problem, since it is heavily domain-specific)

    View your microscope within the terms of a Point Spread Function (PSF). The PSF is the function that describes the image of a point-like light source in the microscope. If you take a single plane from the 3D point spread function, you have the defocussing behaviour for this axial distance. Fold your image with the point spread function image, and you have the defocussed image. This operation is usually called “folding”, “convolution” or “smooth with kernel”.

    Of course, you’ll need a point spread function for your microscope, and there are plenty of details to consider – most importantly, the type of optics involved, the numerical aperture, etc. Ask the relevant optical literature. Sibaritas Deconvolution Microscopy seems like a good start.

    Be aware that, in general, 3D defocussing involves integrating a Bessel function through the phases. You might be able to approximate the behaviour with a Gaussian mask if the axial defocus is within roughly 2 times the lateral resolution of your microscope. This is something like one or two microns on normal microscopes. For larger axial defocusings, you need to compute the integral. I doubt that this is within OpenCV’s scope, so you’d need to pre-compute a defocus function.

    My dissertation project rapidSTORM has an implementation for oil objectives, but the code (pixelatedBessel.cpp) is not in opencv.

    Especially for high-aperture microscopes, the computations become pretty involved, however – at my lab, we usually preferred to just put a point-like light source (e.g. a quantum dot) on the microscope and let the Z stage do the job.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to understand Automatic Reference Counting, as I come from a high-level programming
I'm programming a preferences panel with a UITableView which looks like this: The first
I am new to android programming. In my application, i want to implement automatic
I'm reading Programming for the Java Virtual Machine which discusses the Oolong assembler and
I'm experiencing a bit of cognitive dissonance between C-style stack-based programming, where automatic variables
I know about iOS Automatic Reference Counting, which is compiler based feature. But, i
Programming is at the heart about automating tasks on a computer. Presumably those tasks
Consider me a novice to Windows environment and COM programming. I have to automate
Programming language: Java Ok, so I want to have a BufferedImage that keeps rotating
Programming is (so far) just a hobby for me, so I try to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.