Skip to content

Commit

Permalink
人脸交换完成
Browse files Browse the repository at this point in the history
  • Loading branch information
iFinVer committed Dec 27, 2016
1 parent 1ebebc0 commit ce88305
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
Binary file added finengine/src/main/assets/m.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions finengine/src/main/cpp/opencv/FaceSwapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ cv::Mat FaceSwapper::getMinFrame(cv::Mat frame, cv::Rect2i rect_ann, cv::Rect2i
}
affine_transform_keypoints_ann[0] = points_ann[9];
affine_transform_keypoints_ann[1] = points_ann[21];
affine_transform_keypoints_ann[2] = points_ann[28];
affine_transform_keypoints_ann[2] = points_ann[22];

affine_transform_keypoints_bob[0] = points_bob[9];
affine_transform_keypoints_bob[1] = points_bob[21];
affine_transform_keypoints_bob[2] = points_bob[28];
affine_transform_keypoints_bob[2] = points_bob[22];

feather_amount.width = feather_amount.height = (int) cv::norm(points_ann[1] - points_ann[17]) / 8;

Expand Down
2 changes: 1 addition & 1 deletion finengine/src/main/cpp/opencv/xcvcore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ unsigned char *xcv_swapFace(jbyte *data, jint width, jint height, long long int
facePointBob.clear();
if (faces > 0) {
for (int i = 0; i <= 34; i++) {
if(i > 24 && i < 29) continue;
if(i > 21 && i < 32) continue;
MPOINT ptIndex = faceData->pFaceOutlinePointOut[0 * faceData->faceOutlinePointCount + i];
facePointAnn.push_back(Point2i(ptIndex.x, ptIndex.y));
if (faces > 1) {
Expand Down
Binary file modified release/finengine-release.aar
Binary file not shown.

0 comments on commit ce88305

Please sign in to comment.