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

Method maskHair

jni/venus/Extractor.cpp:278–295  ·  view source on GitHub ↗

@see Automatic Hair Extraction from 2D Images Chuan-Kai Yang and Chia-Ning Kuo Department of Information Management National Taiwan University of Science and Technology */

Source from the content-addressed store, hash-verified

276 Department of Information Management
277 National Taiwan University of Science and Technology
278*/
279cv::Mat Extractor::maskHair() const
280{
281 Mat mask;
282// Point2f center = (points[0] + points[12])/2; // (ASM0 + ASM12)/2
283 Vec4f line = getSymmetryAxis();
284 Point2f center(line[2], line[3]);
285
286 const int N = 13;
287 Point2f hair[N];
288 for(int i = 0; i < N; ++i)
289 {
290 float x = static_cast<float>(i<<1)/N - 1.0f;
291 float k = 1 + 0.2f * (x*x);
292 hair[i] = k *(points[i] - center) + center;
293 }
294
295 return mask;
296}
297
298void Extractor::assignRegion()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected