Skip to content

Commit

Permalink
Merge pull request #1310 from s-trinh/fix_cv_intrinsics_API
Browse files Browse the repository at this point in the history
Update usage of operators with the new Universal Intrinsics API
  • Loading branch information
fspindle authored Jan 18, 2024
2 parents d70f9cd + 9ed0300 commit ebfa260
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/tracker/mbt/src/depth/vpMbtFaceDepthDense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,15 @@ void vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(const vpHomogeneousM
cv::v_float64x2 vx, vy, vz;
cv::v_load_deinterleave(ptr_point_cloud, vx, vy, vz);

#if (VISP_HAVE_OPENCV_VERSION >= 0x040900)
cv::v_float64x2 va1 = cv::v_sub(cv::v_mul(vnz, vy), cv::v_mul(vny, vz)); // vnz*vy - vny*vz
cv::v_float64x2 va2 = cv::v_sub(cv::v_mul(vnx, vz), cv::v_mul(vnz, vx)); // vnx*vz - vnz*vx
cv::v_float64x2 va3 = cv::v_sub(cv::v_mul(vny, vx), cv::v_mul(vnx, vy)); // vny*vx - vnx*vy
#else
cv::v_float64x2 va1 = vnz*vy - vny*vz;
cv::v_float64x2 va2 = vnx*vz - vnz*vx;
cv::v_float64x2 va3 = vny*vx - vnx*vy;
#endif

cv::v_float64x2 vnxy = cv::v_combine_low(vnx, vny);
cv::v_store(ptr_L, vnxy);
Expand All @@ -630,7 +636,12 @@ void vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(const vpHomogeneousM
cv::v_store(ptr_L, vnxy);
ptr_L += 2;

#if (VISP_HAVE_OPENCV_VERSION >= 0x040900)
cv::v_float64x2 verr = cv::v_add(vd, cv::v_muladd(vnx, vx, cv::v_muladd(vny, vy, cv::v_mul(vnz, vz))));
#else
cv::v_float64x2 verr = vd + cv::v_muladd(vnx, vx, cv::v_muladd(vny, vy, vnz*vz));
#endif

cv::v_store(ptr_error, verr);
ptr_error += 2;
#elif USE_SSE
Expand Down

0 comments on commit ebfa260

Please sign in to comment.