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

Function stretchImage

jni/venus/region_operation.cpp:978–999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

976}
977
978Mat stretchImage(const Mat& image, const Size& src_size, const Size& dst_size, const std::vector<Point2f>& src_points, const std::vector<Point2f>& dst_points, const std::vector<Vec3i>& indices)
979{
980 assert(src_points.size() == dst_points.size());
981 Mat result(dst_size, image.type());
982
983 Rect src_rect(Point(0, 0), src_size);
984 Rect dst_rect(Point(0, 0), dst_size);
985#ifndef NDEBUG
986 for(const Point2f& point: src_points)
987 assert(point.inside(src_rect));
988
989 for(const Point2f& point: dst_points)
990 assert(point.inside(dst_rect));
991#endif
992
993 Mat image_f;
994 int type = image.type();
995 if(type != CV_32F)
996 image.convertTo(image_f, CV_32F);
997 assert(false); // TODO
998 return image;
999}
1000
1001// http://www.learnopencv.com/face-morph-using-opencv-cpp-python/
1002// https://www.learnopencv.com/warp-one-triangle-to-another-using-opencv-c-python/

Calls

no outgoing calls

Tested by

no test coverage detected