CCNYRoboticsLab / ccny_rgbd_tools

ccny_rgbd_tools
GNU Lesser General Public License v3.0
125 stars 76 forks source link

avg_logger in calibration branch outputs false mean and std_dev images #11

Closed loam closed 11 years ago

loam commented 11 years ago

the values of the c_img need to be updated (incremented) before calculating the moving average values

idryanov commented 11 years ago

Good catch! Thanks for the ticket, I've updated the code but I havent been able to verify if it works yet

loam commented 11 years ago

I would suggest this:

  if (!isnan(z))
  {
    c_img_.at<uint16_t>(v, u) += 1;
    int   c = c_img_.at<uint16_t>(v, u);

    double old_m = m_img_.at<double>(v, u);
    double new_m = old_m + (z - old_m) / (double)c;
idryanov commented 11 years ago

Fixed