aihot  2017-04-26 11:51:54  OpenCV |   查看评论   
  •             double d = B_Imag.at<double>(i, j);  
  •   
  •             if (flag)  
  •             {  
  •                 // division: (a+bj) / (c+dj)  
  •                 R_Real.at<double>(i, j) = (a * c + b * d) / (c * c + d * d + 0.000001);  
  •                 R_Imag.at<double>(i, j) = (b * c - a * d) / (c * c + d * d + 0.000001);  
  •             }  
  •             else  
  •             {  
  •                 // multiplication: (a+bj) * (c+dj)  
  •                 R_Real.at<double>(i, j) = a * c - b * d;  
  •                 R_Imag.at<double>(i, j) = b * c + a * d;  
  •             }  
  •         }  
  •     }  
  •     merge(planes, dst);  
  • }  
  •   
  • /************ 获得前后概率 ***********/  
  • void STCTracker::getCxtPriorPosteriorModel(const Mat image)  
  • {  
  •     CV_Assert(image.size == cxtPriorPro.size);  
  •   
  •     double sum_prior(0), sum_post(0);  
  •     for (int i = 0; i < cxtRegion.height; i++)  
  •     {  
  •         for (int j = 0; j < cxtRegion.width; j++)  
  •         {  
  •             double x = j + cxtRegion.x;  
  •             double y = i + cxtRegion.y;  
  •             double dist = sqrt((center.x - x) * (center.x - x) + (center.y - y) * (center.y - y));  
  •   
  •             // 方程(5)在文中
  •             cxtPriorPro.at<double>(i, j) = exp(- dist * dist / (2 * sigma * sigma));  
  •             sum_prior += cxtPriorPro.at<double>(i, j);  
  •   
  •             // 
  •  

    除特别注明外,本站所有文章均为 赢咖4注册 原创,转载请注明出处来自时空上下文视觉跟踪(STC)算法的解读与代码复现

    留言与评论(共有 0 条评论)
       
    验证码:
    [lianlun]1[/lianlun]