Closed loam closed 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
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;
Fixed
the values of the c_img need to be updated (incremented) before calculating the moving average values