Ask Your Question

qq456cvb's profile - activity

2016-03-06 21:48:17 -0600 asked a question OpenCV's findEssentialMat() API doc seems to be wrong

I'm studying essential matrix and fundamental matrix and notice that the formula on OpenCV's site does not confirm to what I learnt elsewhere.

It says '[p2;1] (K^T) E(K) [p1;1] = 0' but wouldn't it be '[p2;1] (K^-T) E (K^-1) [p1;1] = 0' since 'F = (K^-T) E (K^-1)'. And for essential matrix, 'p2^T E p1 = 0' just takes the camera coordinate so '[p2;1] (K^-T) E (K^-1) [p1;1] = 0' is correct from my opinion since it transfers the image coordinate to the camera coordinate by multiplying the inverse K matrix, which is for the intrinsic parameters of the camera.

The doc containing the formula is here http://docs.opencv.org/3.0-beta/modul...

2015-11-08 22:34:38 -0600 asked a question opencv brisk function refine1D?

Hello, I am a bit confusing with the brisk src code and I've found this function:

inline float
    BriskScaleSpace::refine1D(const float s_05, const float s0, const float s05, float& max) const
    {
  int i_05 = int(1024.0 * s_05 + 0.5);
  int i0 = int(1024.0 * s0 + 0.5);
  int i05 = int(1024.0 * s05 + 0.5);

  //   16.0000  -24.0000    8.0000
  //  -40.0000   54.0000  -14.0000
  //   24.0000  -27.0000    6.0000

  int three_a = 16 * i_05 - 24 * i0 + 8 * i05;
  // second derivative must be negative:
  if (three_a >= 0)
  {
    if (s0 >= s_05 && s0 >= s05)
    {
      max = s0;
      return 1.0f;
    }
    if (s_05 >= s0 && s_05 >= s05)
    {
      max = s_05;
      return 0.75f;
    }
    if (s05 >= s0 && s05 >= s_05)
    {
      max = s05;
      return 1.5f;
    }
  }

  int three_b = -40 * i_05 + 54 * i0 - 14 * i05;
  // calculate max location:
  float ret_val = -float(three_b) / float(2 * three_a);
  // saturate and return
  if (ret_val < 0.75)
    ret_val = 0.75;
  else if (ret_val > 1.5)
    ret_val = 1.5; // allow to be slightly off bounds ...?
  int three_c = +24 * i_05 - 27 * i0 + 6 * i05;
  max = float(three_c) + float(three_a) * ret_val * ret_val + float(three_b) * ret_val;
  max /= 3072.0f;
  return ret_val;
}

I found that this function is the implementation of the BRISK paper to fit a 1D parabola and get the maximum given three values. However, I just can't understand the code, what is 1D parabola fitting and how can it just use a hardcoded matrix to fit the parabola? What is the purpose of i05,i0... by multiplying 1024.0f? Can someone explain the function for me, I guess there must be some formula convention behind this.

Thanks.