Code Monkey home page Code Monkey logo

Comments (1)

puzzlepaint avatar puzzlepaint commented on July 18, 2024

Looking at the computation in PixelCornerConvToGridPoint() for the x coordinate as an example:

1.f + (m_grid_width - 3.f) * (x - m_calibration_min_x) / (m_calibration_max_x + 1 - m_calibration_min_x)
  • If the function is called with x == m_calibration_min_x, then (x - m_calibration_min_x) will be zero, so this will result in a grid point x coordinate of 1.f.
  • If the function is called with x == m_calibration_max_x + 1, then the quotient on the right will be one, so this will result in a grid point x coordinate of m_grid_width - 2.f.

This range of values is returned because there is one extra grid point placed beyond the calibrated image area on each of its sides. This has the purpose of providing a full 4x4 surrounding patch of grid values for interpolation for every pixel location within the calibrated image area.

So, a more descriptive formulation might for example be:

constexpr int kExternalPoints = 1;
[...]
kExternalPoints + (m_grid_width - 2 * kExternalPoints - 1) * (x - m_calibration_min_x) / (m_calibration_max_x + 1 - m_calibration_min_x)

The -3.f is thus computed from - 2 * kExternalPoints - 1, where 2 * kExternalPoints accounts for the external points on each side, and the -1 accounts for "computing the index of the last point from the point count" with a starting index of zero (rather than one).

from camera_calibration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.