gaoxiang12 / slambook2

edition 2 of the slambook
MIT License
5.3k stars 1.99k forks source link

关于 cv::RNG::gaussian() 使用的问题 #265

Open Li-Jun-SD opened 1 year ago

Li-Jun-SD commented 1 year ago

OpenCV 中 RNG::gaussian() 的定义为:

    /** @brief Returns the next random number sampled from the Gaussian distribution
    @param sigma standard deviation of the distribution.

    The method transforms the state using the MWC algorithm and returns the
    next random number from the Gaussian distribution N(0,sigma) . That is,
    the mean value of the returned random numbers is zero and the standard
    deviation is the specified sigma .
    */
    double gaussian(double sigma);

其参数接收应为标准差, 但是在第六章代码中使用时均如: rng.gaussian(w_sigma * w_sigma) 虽然 double w_sigma = 1.0, 实际输入并无区别, 但是改为 rng.gaussain(w_sigma) 似乎更好.