@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 */
| 276 | Department of Information Management |
| 277 | National Taiwan University of Science and Technology |
| 278 | */ |
| 279 | cv::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 | |
| 298 | void Extractor::assignRegion() |
nothing calls this directly
no outgoing calls
no test coverage detected