MCPcopy Create free account
hub / github.com/davisking/dlib / test_find_similarity_transform

Function test_find_similarity_transform

dlib/test/geometry.cpp:778–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776
777 template <typename T>
778 void test_find_similarity_transform()
779 {
780 print_spinner();
781 std::vector<dlib::vector<T,2> > from_points, to_points;
782
783 from_points.push_back(dlib::vector<T,2>(0,0));
784 from_points.push_back(dlib::vector<T,2>(0,1));
785 from_points.push_back(dlib::vector<T,2>(1,0));
786
787 to_points.push_back(dlib::vector<T,2>(8,0));
788 to_points.push_back(dlib::vector<T,2>(6,0));
789 to_points.push_back(dlib::vector<T,2>(8,2));
790
791 point_transform_affine tform = find_similarity_transform(from_points, to_points);
792
793 for (unsigned long i = 0; i < from_points.size(); ++i)
794 {
795 DLIB_TEST(length(tform(from_points[i]) - to_points[i]) < 1e-14);
796 }
797 }
798
799 template <typename T>
800 void test_find_similarity_transform2()

Callers

nothing calls this directly

Calls 6

print_spinnerFunction · 0.85
vector<T,2>Class · 0.85
lengthFunction · 0.50
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected