MCPcopy Create free account
hub / github.com/SSARCandy/Coherent-Line-Drawing / visualizeFlowfield

Function visualizeFlowfield

src/postProcessing.cpp:60–76  ·  view source on GitHub ↗

visualize ETF by drawing red arrowline

Source from the content-addressed store, hash-verified

58
59// visualize ETF by drawing red arrowline
60cv::Mat visualizeFlowfield(const cv::Mat &flowfield)
61{
62 constexpr int resolution = 10;
63 cv::Mat dst{flowfield.size(), CV_32FC3, cv::Scalar(1, 1, 1)};
64
65 for (int i = 0; i < dst.rows; i += resolution) {
66 for (int j = 0; j < dst.cols; j += resolution) {
67 const cv::Vec3f v = flowfield.at<cv::Vec3f>(i, j);
68 const cv::Point2f p1(j, i);
69 const cv::Point2f p2(j + v[1] * 5, i + v[0] * 5);
70
71 cv::arrowedLine(dst, p1, p2, cv::Scalar(1, 0, 0), 1.5, 8, 0, 0.3);
72 }
73 }
74
75 return dst;
76}
77
78cv::Mat antiAlias(const cv::Mat &src)
79{

Callers 2

renderMethod · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected