* Paper's Eq(1) */
| 100 | * Paper's Eq(1) |
| 101 | */ |
| 102 | cv::Vec3f ETF::computeNewVector(const int x, const int y, const int kernel) |
| 103 | { |
| 104 | const cv::Vec3f t_cur_x = flowField.at<cv::Vec3f>(y, x); |
| 105 | cv::Vec3f t_new = cv::Vec3f(0, 0, 0); |
| 106 | |
| 107 | for (int r = y - kernel; r <= y + kernel; ++r) { |
| 108 | for (int c = x - kernel; c <= x + kernel; ++c) { |
| 109 | if (r < 0 || r >= refinedETF.rows || c < 0 || c >= refinedETF.cols) continue; |
| 110 | |
| 111 | const cv::Vec3f t_cur_y = flowField.at<cv::Vec3f>(r, c); |
| 112 | |
| 113 | const float phi = computePhi(t_cur_x, t_cur_y); |
| 114 | const float w_s = computeWs(cv::Point2f(x, y), cv::Point2f(c, r), kernel); |
| 115 | const float w_m = |
| 116 | computeWm(cv::norm(gradientMag.at<cv::Vec3f>(y, x)), cv::norm(gradientMag.at<float>(r, c))); |
| 117 | const float w_d = computeWd(t_cur_x, t_cur_y); |
| 118 | t_new += phi * t_cur_y * w_s * w_m * w_d; |
| 119 | } |
| 120 | } |
| 121 | return cv::normalize(t_new); |
| 122 | } |
| 123 | |
| 124 | /* |
| 125 | * Paper's Eq(5) |
nothing calls this directly
no outgoing calls
no test coverage detected