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 6320145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:55:14+00:00 2026-05-24T15:55:14+00:00

I have some discrete values and assumption, that these values lie on a Gaussian

  • 0

I have some discrete values and assumption, that these values lie on a Gaussian curve.
There should be an algorithm for max-calculation using only 3 discrete values.
Do you know any library or code in C/C++ implementing this calculation?

Thank you!

P.S.:
The original task is auto-focus implementation. I move a (microscope) camera and capture the pictures in different positions. The position having most different colors should have best focus.

EDIT
This was long time ago 🙁
I’just wanted to remove this question, but left it respecting the good answer.

  • 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-05-24T15:55:14+00:00Added an answer on May 24, 2026 at 3:55 pm

    You have three points that are supposed to be on a Gaussian curve; this means that they lie on the function:

    generic Gaussian function

    If you take the logarithm of this function, you get:

    log of the Gaussian function

    which is just a simple 2nd grade polynomial, i.e. a parabola with a vertical axis of simmetry:

    generic 2nd grade polynomial

    with

    coefficient definitions

    So, if you know the three coefficients of the parabola, you can derive the parameters of the Gaussian curve; incidentally, the only parameter of the Gaussian function that is of some interest to you is b, since it tells you where the center of the distribution, i.e. where is its maximum. It’s immediate to find out that

    b from beta and alpha

    All that remains to do is to fit the parabola (with the “original” x and the logarithm of your values). Now, if you had more points, a polynomial fit would be involved, but, since you have just three points, the situation is really simple: there’s one and only one parabola that goes through three points.

    You now just have to write the equation of the parabola for each of your points and solve the system:

    system of the three points

    (with y and z, where the zs are the actual values read at the corresponding x)

    This can be solved by hand (with some time), with some CAS or… looking on StackOverflow 🙂 ; the solution thus is:

    solution of the parabola through three points

    So using these last equations (remember: the ys are the logarithm of your “real” values) and the other relations you can easily write a simple algebraic formula to get the parameter b of your Gaussian curve, i.e. its maximum.

    final result

    (I may have done some mess in the calculations, double-check them before using the results, anyhow the procedure should be correct)

    (thanks at http://www.codecogs.com/latex/eqneditor.php for the LaTeX equations)

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

Sidebar

Related Questions

I have some UI in VB 2005 that looks great in XP Style, but
We have some input data that sometimes appears with &nbsp characters on the end.
We have some files on our website that users of our software can download.
Assume that I have some array of data (a vector to be specific). Can
I have previous experience with MATLAB, but the problem that I face is some
Lets say we have some discrete distribution with finite number of possible results, is
I have been using JGraphX to display some data (simple discrete graphs) and I
Is there some process that can determine / remove an unknown DC offset from
I have some perl code that looks something like this: my @array = map
I have some input elements that the users are request special behavior on pageup

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.