MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / catmullRomSpline

Function catmullRomSpline

jni/venus/region_operation.cpp:213–223  ·  view source on GitHub ↗

Cubic interpolation http://www.paulinternet.nl/?page=bicubic https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Interpolation_on_the_unit_interval_without_exact_derivatives [0 2 0 0] [p0] f(n + t) = 0.5 * [1, t, t^2, t^3] * [-1 0 1 0] * [p1] [2 -5 4 -1] [p2] [-1 3 -3 1] [p3] */

Source from the content-addressed store, hash-verified

211 [-1 3 -3 1] [p3]
212*/
213cv::Point2f catmullRomSpline(float t, const cv::Point2f& p0, const cv::Point2f& p1, const cv::Point2f& p2, const cv::Point2f& p3)
214{
215// assert(0 <= t && t <= 1);
216 float tt = t*t, ttt = tt*t;
217 float b0 = -ttt + 2*tt - t;
218 float b1 = 3*ttt - 5*tt + 2;
219 float b2 = -3*ttt + 4*tt + t;
220 float b3 = ttt - tt;
221
222 return 0.5f * (b0*p0 + b1*p1 + b2*p2 + b3*p3);
223}
224
225cv::Mat susan(const cv::Mat& image, int radius, int tolerance)
226{

Calls

no outgoing calls

Tested by

no test coverage detected