动态计算平均值

\[weight=0 \\ mean = \frac {meam*weight+curVal}{weight+1} \]

int weight = 0;
Vec3i pixel = {0,0,0};
for(size_t index=0; index < singlePairFish->fishImgs.size(); index++){
  pixel = (pixel * weight + curPixel) / (weight + 1);
  weight++;


}

posted @ 2023-10-12 21:30  小小灰迪  阅读(11)  评论(0编辑  收藏  举报