├── .gitignore
├── FaceAR_SDK_IOS_OpenFace_RunFull.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ └── contents.xcworkspacedata
├── FaceAR_SDK_IOS_OpenFace_RunFull
├── AppDelegate.h
├── AppDelegate.mm
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── FaceAR_SDK_IOS_OpenFace_RunFull.xcdatamodeld
│ ├── .xccurrentversion
│ └── FaceAR_SDK_IOS_OpenFace_RunFull.xcdatamodel
│ │ └── contents
├── Info.plist
├── ViewController.h
├── ViewController.mm
├── lib
│ ├── FaceARDetect
│ │ ├── FaceARDetectIOS.h
│ │ └── FaceARDetectIOS.mm
│ └── local
│ │ ├── GazeEstimate
│ │ ├── GazeEstimation.cpp
│ │ └── GazeEstimation.h
│ │ └── LandmarkDetector
│ │ ├── include
│ │ ├── CCNF_patch_expert.h
│ │ ├── LandmarkCoreIncludes.h
│ │ ├── LandmarkDetectionValidator.h
│ │ ├── LandmarkDetectorFunc.h
│ │ ├── LandmarkDetectorModel.h
│ │ ├── LandmarkDetectorParameters.h
│ │ ├── LandmarkDetectorUtils.h
│ │ ├── PAW.h
│ │ ├── PDM.h
│ │ ├── Patch_experts.h
│ │ ├── SVR_patch_expert.h
│ │ └── stdafx.h
│ │ └── src
│ │ ├── CCNF_patch_expert.cpp
│ │ ├── LandmarkDetectionValidator.cpp
│ │ ├── LandmarkDetectorFunc.cpp
│ │ ├── LandmarkDetectorModel.cpp
│ │ ├── LandmarkDetectorParameters.cpp
│ │ ├── LandmarkDetectorUtils.cpp
│ │ ├── PAW.cpp
│ │ ├── PDM.cpp
│ │ ├── Patch_experts.cpp
│ │ ├── SVR_patch_expert.cpp
│ │ └── stdafx.cpp
├── main.m
├── model
│ ├── classifiers
│ │ ├── haarcascade_frontalface_alt.xml
│ │ ├── haarcascade_frontalface_alt2.xml
│ │ ├── haarcascade_frontalface_alt_tree.xml
│ │ ├── haarcascade_frontalface_default.xml
│ │ └── haarcascade_profileface.xml
│ └── model
│ │ ├── clm-z.txt
│ │ ├── clm_general.txt
│ │ ├── clm_wild.txt
│ │ ├── clnf_general.txt
│ │ ├── clnf_wild.txt
│ │ ├── detection_validation
│ │ ├── validator_general_66.txt
│ │ └── validator_general_68.txt
│ │ ├── haarAlign.txt
│ │ ├── main_clm-z.txt
│ │ ├── main_clm_general.txt
│ │ ├── main_clm_wild.txt
│ │ ├── main_clnf_general.txt
│ │ ├── main_clnf_wild.txt
│ │ ├── model_eye
│ │ ├── clnf_left_synth.txt
│ │ ├── clnf_right_synth.txt
│ │ ├── main_clnf_synth_left.txt
│ │ ├── main_clnf_synth_right.txt
│ │ ├── patch_experts
│ │ │ ├── ccnf_patches_1.00_synth_lid_.txt
│ │ │ ├── ccnf_patches_1.50_synth_lid_.txt
│ │ │ ├── left_ccnf_patches_1.00_synth_lid_.txt
│ │ │ └── left_ccnf_patches_1.50_synth_lid_.txt
│ │ └── pdms
│ │ │ ├── pdm_28_eye_3D_closed.txt
│ │ │ └── pdm_28_l_eye_3D_closed.txt
│ │ ├── model_inner
│ │ ├── clnf_inner.txt
│ │ ├── main_clnf_inner.txt
│ │ ├── patch_experts
│ │ │ └── ccnf_patches_1.00_inner.txt
│ │ └── pdms
│ │ │ └── pdm_51_inner.txt
│ │ ├── patch_experts
│ │ ├── ccnf_patches_0.25_general.txt
│ │ ├── ccnf_patches_0.25_wild.txt
│ │ ├── ccnf_patches_0.35_general.txt
│ │ ├── ccnf_patches_0.35_wild.txt
│ │ ├── ccnf_patches_0.5_general.txt
│ │ ├── ccnf_patches_0.5_wild.txt
│ │ ├── ccnf_patches_1_wild.txt
│ │ ├── depth_patches_0.25.txt
│ │ ├── depth_patches_0.35.txt
│ │ ├── depth_patches_0.5.txt
│ │ ├── intensity_patches_0.25.txt
│ │ ├── intensity_patches_0.35.txt
│ │ ├── intensity_patches_0.5.txt
│ │ ├── svr_patches_0.25_general.txt
│ │ ├── svr_patches_0.25_wild.txt
│ │ ├── svr_patches_0.35_general.txt
│ │ ├── svr_patches_0.35_wild.txt
│ │ ├── svr_patches_0.5_general.txt
│ │ └── svr_patches_0.5_wild.txt
│ │ ├── pdms
│ │ ├── In-the-wild_aligned_PDM_68.txt
│ │ ├── Multi-PIE_aligned_PDM_66.txt
│ │ └── Multi-PIE_aligned_PDM_68.txt
│ │ ├── tris_66.txt
│ │ ├── tris_68.txt
│ │ └── tris_68_full.txt
└── opencv2.framework
│ ├── Headers
│ ├── Resources
│ ├── Versions
│ ├── A
│ │ ├── Headers
│ │ │ ├── calib3d.hpp
│ │ │ ├── calib3d
│ │ │ │ ├── calib3d.hpp
│ │ │ │ └── calib3d_c.h
│ │ │ ├── core.hpp
│ │ │ ├── core
│ │ │ │ ├── affine.hpp
│ │ │ │ ├── base.hpp
│ │ │ │ ├── bufferpool.hpp
│ │ │ │ ├── core.hpp
│ │ │ │ ├── core_c.h
│ │ │ │ ├── cuda.hpp
│ │ │ │ ├── cuda.inl.hpp
│ │ │ │ ├── cuda_stream_accessor.hpp
│ │ │ │ ├── cuda_types.hpp
│ │ │ │ ├── cvdef.h
│ │ │ │ ├── cvstd.hpp
│ │ │ │ ├── cvstd.inl.hpp
│ │ │ │ ├── directx.hpp
│ │ │ │ ├── eigen.hpp
│ │ │ │ ├── ippasync.hpp
│ │ │ │ ├── mat.hpp
│ │ │ │ ├── mat.inl.hpp
│ │ │ │ ├── matx.hpp
│ │ │ │ ├── ocl.hpp
│ │ │ │ ├── ocl_genbase.hpp
│ │ │ │ ├── opengl.hpp
│ │ │ │ ├── operations.hpp
│ │ │ │ ├── optim.hpp
│ │ │ │ ├── persistence.hpp
│ │ │ │ ├── private.cuda.hpp
│ │ │ │ ├── private.hpp
│ │ │ │ ├── ptr.inl.hpp
│ │ │ │ ├── sse_utils.hpp
│ │ │ │ ├── traits.hpp
│ │ │ │ ├── types.hpp
│ │ │ │ ├── types_c.h
│ │ │ │ ├── utility.hpp
│ │ │ │ ├── version.hpp
│ │ │ │ └── wimage.hpp
│ │ │ ├── cvconfig.h
│ │ │ ├── features2d.hpp
│ │ │ ├── features2d
│ │ │ │ └── features2d.hpp
│ │ │ ├── flann.hpp
│ │ │ ├── flann
│ │ │ │ ├── all_indices.h
│ │ │ │ ├── allocator.h
│ │ │ │ ├── any.h
│ │ │ │ ├── autotuned_index.h
│ │ │ │ ├── composite_index.h
│ │ │ │ ├── config.h
│ │ │ │ ├── defines.h
│ │ │ │ ├── dist.h
│ │ │ │ ├── dummy.h
│ │ │ │ ├── dynamic_bitset.h
│ │ │ │ ├── flann.hpp
│ │ │ │ ├── flann_base.hpp
│ │ │ │ ├── general.h
│ │ │ │ ├── ground_truth.h
│ │ │ │ ├── hdf5.h
│ │ │ │ ├── heap.h
│ │ │ │ ├── hierarchical_clustering_index.h
│ │ │ │ ├── index_testing.h
│ │ │ │ ├── kdtree_index.h
│ │ │ │ ├── kdtree_single_index.h
│ │ │ │ ├── kmeans_index.h
│ │ │ │ ├── linear_index.h
│ │ │ │ ├── logger.h
│ │ │ │ ├── lsh_index.h
│ │ │ │ ├── lsh_table.h
│ │ │ │ ├── matrix.h
│ │ │ │ ├── miniflann.hpp
│ │ │ │ ├── nn_index.h
│ │ │ │ ├── object_factory.h
│ │ │ │ ├── params.h
│ │ │ │ ├── random.h
│ │ │ │ ├── result_set.h
│ │ │ │ ├── sampling.h
│ │ │ │ ├── saving.h
│ │ │ │ ├── simplex_downhill.h
│ │ │ │ └── timer.h
│ │ │ ├── hal.hpp
│ │ │ ├── hal
│ │ │ │ ├── defs.h
│ │ │ │ ├── intrin.hpp
│ │ │ │ ├── intrin_cpp.hpp
│ │ │ │ ├── intrin_neon.hpp
│ │ │ │ └── intrin_sse.hpp
│ │ │ ├── highgui.hpp
│ │ │ ├── highgui
│ │ │ │ ├── highgui.hpp
│ │ │ │ └── highgui_c.h
│ │ │ ├── imgcodecs.hpp
│ │ │ ├── imgcodecs
│ │ │ │ ├── imgcodecs.hpp
│ │ │ │ ├── imgcodecs_c.h
│ │ │ │ └── ios.h
│ │ │ ├── imgproc.hpp
│ │ │ ├── imgproc
│ │ │ │ ├── imgproc.hpp
│ │ │ │ ├── imgproc_c.h
│ │ │ │ └── types_c.h
│ │ │ ├── ml.hpp
│ │ │ ├── ml
│ │ │ │ └── ml.hpp
│ │ │ ├── objdetect.hpp
│ │ │ ├── objdetect
│ │ │ │ ├── detection_based_tracker.hpp
│ │ │ │ ├── objdetect.hpp
│ │ │ │ └── objdetect_c.h
│ │ │ ├── opencv.hpp
│ │ │ ├── opencv_modules.hpp
│ │ │ ├── photo.hpp
│ │ │ ├── photo
│ │ │ │ ├── cuda.hpp
│ │ │ │ ├── photo.hpp
│ │ │ │ └── photo_c.h
│ │ │ ├── shape.hpp
│ │ │ ├── shape
│ │ │ │ ├── emdL1.hpp
│ │ │ │ ├── hist_cost.hpp
│ │ │ │ ├── shape.hpp
│ │ │ │ ├── shape_distance.hpp
│ │ │ │ └── shape_transformer.hpp
│ │ │ ├── stitching.hpp
│ │ │ ├── stitching
│ │ │ │ ├── detail
│ │ │ │ │ ├── autocalib.hpp
│ │ │ │ │ ├── blenders.hpp
│ │ │ │ │ ├── camera.hpp
│ │ │ │ │ ├── exposure_compensate.hpp
│ │ │ │ │ ├── matchers.hpp
│ │ │ │ │ ├── motion_estimators.hpp
│ │ │ │ │ ├── seam_finders.hpp
│ │ │ │ │ ├── timelapsers.hpp
│ │ │ │ │ ├── util.hpp
│ │ │ │ │ ├── util_inl.hpp
│ │ │ │ │ ├── warpers.hpp
│ │ │ │ │ └── warpers_inl.hpp
│ │ │ │ └── warpers.hpp
│ │ │ ├── video.hpp
│ │ │ ├── video
│ │ │ │ ├── background_segm.hpp
│ │ │ │ ├── tracking.hpp
│ │ │ │ ├── tracking_c.h
│ │ │ │ └── video.hpp
│ │ │ ├── videoio.hpp
│ │ │ ├── videoio
│ │ │ │ ├── cap_ios.h
│ │ │ │ ├── videoio.hpp
│ │ │ │ └── videoio_c.h
│ │ │ ├── videostab.hpp
│ │ │ ├── videostab
│ │ │ │ ├── deblurring.hpp
│ │ │ │ ├── fast_marching.hpp
│ │ │ │ ├── fast_marching_inl.hpp
│ │ │ │ ├── frame_source.hpp
│ │ │ │ ├── global_motion.hpp
│ │ │ │ ├── inpainting.hpp
│ │ │ │ ├── log.hpp
│ │ │ │ ├── motion_core.hpp
│ │ │ │ ├── motion_stabilizing.hpp
│ │ │ │ ├── optical_flow.hpp
│ │ │ │ ├── outlier_rejection.hpp
│ │ │ │ ├── ring_buffer.hpp
│ │ │ │ ├── stabilizer.hpp
│ │ │ │ └── wobble_suppression.hpp
│ │ │ └── world.hpp
│ │ ├── Resources
│ │ │ └── Info.plist
│ │ └── opencv2
│ └── Current
│ └── opencv2
├── FaceAR_SDK_IOS_OpenFace_RunFullTests
├── FaceAR_SDK_IOS_OpenFace_RunFullTests.m
└── Info.plist
├── FaceAR_SDK_IOS_OpenFace_RunFullUITests
├── FaceAR_SDK_IOS_OpenFace_RunFullUITests.m
└── Info.plist
├── LICENSE
├── README.md
└── imgs
├── KeeganRen1.png
├── KeeganRen2.png
├── KeeganRen3.png
├── KeeganRen4.png
├── KeeganRen5.png
├── KeeganRen6.png
├── KeeganRen7.png
├── appearance.png
├── au_sample.png
├── gaze_ex.png
└── multi_face_img.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | # CocoaPods
31 | #
32 | # We recommend against adding the Pods directory to your .gitignore. However
33 | # you should judge for yourself, the pros and cons are mentioned at:
34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
35 | #
36 | # Pods/
37 |
38 | # Carthage
39 | #
40 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
41 | # Carthage/Checkouts
42 |
43 | Carthage/Build
44 |
45 | # fastlane
46 | #
47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48 | # screenshots whenever they are needed.
49 | # For more information about the recommended setup visit:
50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
51 |
52 | fastlane/report.xml
53 | fastlane/screenshots
54 |
55 | #Code Injection
56 | #
57 | # After new code Injection tools there's a generated folder /iOSInjectionProject
58 | # https://github.com/johnno1962/injectionforxcode
59 |
60 | iOSInjectionProject/
61 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // FaceAR_SDK_IOS_OpenFace_RunFull
4 | //
5 | // Created by Keegan Ren on 7/5/16.
6 | // Copyright © 2016 Keegan Ren. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (strong, nonatomic) UIWindow *window;
15 |
16 | @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
17 | @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
18 | @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
19 |
20 | - (void)saveContext;
21 | - (NSURL *)applicationDocumentsDirectory;
22 |
23 |
24 | @end
25 |
26 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/FaceAR_SDK_IOS_OpenFace_RunFull.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | FaceAR_SDK_IOS_OpenFace_RunFull.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/FaceAR_SDK_IOS_OpenFace_RunFull.xcdatamodeld/FaceAR_SDK_IOS_OpenFace_RunFull.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSCameraUsageDescription
6 | cameraDesciption
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // FaceAR_SDK_IOS_OpenFace_RunFull
4 | //
5 | // Created by Keegan Ren on 7/5/16.
6 | // Copyright © 2016 Keegan Ren. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import
12 |
13 | @interface ViewController : UIViewController
14 |
15 | //- (IBAction)startButtonPressed:(id)sender;
16 | @property (weak, nonatomic) IBOutlet UIButton *start;
17 | @property (weak, nonatomic) IBOutlet UIImageView *imageView;
18 | @property (nonatomic, strong) CvVideoCamera* videoCamera;
19 |
20 | @end
21 |
22 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/ViewController.mm:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // FaceAR_SDK_IOS_OpenFace_RunFull
4 | //
5 | // Created by Keegan Ren on 7/5/16.
6 | // Copyright © 2016 Keegan Ren. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | ///// opencv
12 | #import
13 | ///// C++
14 | #include
15 | ///// user
16 | #include "FaceARDetectIOS.h"
17 | //
18 |
19 |
20 |
21 | @interface ViewController ()
22 |
23 | @end
24 |
25 | @implementation ViewController {
26 | FaceARDetectIOS *facear;
27 | int frame_count;
28 | }
29 |
30 | - (void)viewDidLoad {
31 | [super viewDidLoad];
32 |
33 | // Do any additional setup after loading the view, typically from a nib.
34 | self.videoCamera = [[CvVideoCamera alloc] initWithParentView:self.imageView];
35 | self.videoCamera.delegate = self;
36 | self.videoCamera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionFront;
37 | self.videoCamera.defaultAVCaptureSessionPreset = AVCaptureSessionPreset640x480;
38 | self.videoCamera.defaultAVCaptureVideoOrientation = AVCaptureVideoOrientationPortrait;
39 | self.videoCamera.defaultFPS = 30;
40 | self.videoCamera.grayscaleMode = NO;
41 |
42 | ///////////////////
43 | // facear =[[FaceARDetectIOS alloc] init];
44 |
45 | }
46 |
47 | - (IBAction)startButtonPressed:(id)sender
48 | {
49 | [self.videoCamera start];
50 | }
51 |
52 | - (void)processImage:(cv::Mat &)image
53 | {
54 | cv::Mat targetImage(image.cols,image.rows,CV_8UC3);
55 | cv::cvtColor(image, targetImage, cv::COLOR_BGRA2BGR);
56 | if(targetImage.empty()){
57 | std::cout << "targetImage empty" << std::endl;
58 | }
59 | else
60 | {
61 | float fx, fy, cx, cy;
62 | cx = 1.0*targetImage.cols / 2.0;
63 | cy = 1.0*targetImage.rows / 2.0;
64 |
65 | fx = 500 * (targetImage.cols / 640.0);
66 | fy = 500 * (targetImage.rows / 480.0);
67 |
68 | fx = (fx + fy) / 2.0;
69 | fy = fx;
70 |
71 | [[FaceARDetectIOS alloc] run_FaceAR:targetImage frame__:frame_count fx__:fx fy__:fy cx__:cx cy__:cy];
72 | frame_count = frame_count + 1;
73 | }
74 | cv::cvtColor(targetImage, image, cv::COLOR_BGRA2RGB);
75 | }
76 |
77 |
78 | - (void)didReceiveMemoryWarning {
79 | [super didReceiveMemoryWarning];
80 | // Dispose of any resources that can be recreated.
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/lib/FaceARDetect/FaceARDetectIOS.h:
--------------------------------------------------------------------------------
1 | //
2 | // FaceARDetectIOS.h
3 | // FaceAR_SDK_IOS_OpenFace_RunFull
4 | //
5 | // Created by Keegan Ren on 7/5/16.
6 | // Copyright © 2016 Keegan Ren. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | // OpenCV includes
16 | #include // Video write
17 | #include // Video write
18 | #include
19 | #include
20 |
21 | #include "LandmarkCoreIncludes.h"
22 | #include "GazeEstimation.h"
23 |
24 | @interface FaceARDetectIOS : NSObject
25 |
26 | //bool inits_FaceAR();
27 | //-(instancetype) inits_FaceAR;
28 | //-(id) init;
29 |
30 | // void visualise_tracking(cv::Mat& captured_image, cv::Mat_& depth_image, const LandmarkDetector::CLNF& face_model, const LandmarkDetector::FaceModelParameters& det_parameters, int frame_count, double fx, double fy, double cx, double cy)
31 | //-(BOOL) visualise_tracking:(cv::Mat)captured_image depth_image_:(cv::Mat)depth_image face_model_:(const LandmarkDetector::CLNF)face_model det_parameters_:(const LandmarkDetector::FaceModelParameters)det_parameters frame_count_:(int)frame_count fx_:(double)fx fy_:(double)fy cx_:(double)cx cy_:(double)cy;
32 |
33 | //bool run_FaceAR(cv::Mat &captured_image, int frame_count, float fx, float fy, float cx, float cy);
34 | -(BOOL) run_FaceAR:(cv::Mat)captured_image frame__:(int)frame_count fx__:(double)fx fy__:(double)fy cx__:(double)cx cy__:(double)cy;
35 |
36 | //bool reset_FaceAR();
37 | -(BOOL) reset_FaceAR;
38 |
39 | //bool clear_FaceAR();
40 | -(BOOL) clear_FaceAR;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/lib/local/GazeEstimate/GazeEstimation.h:
--------------------------------------------------------------------------------
1 | #ifndef __GAZEESTIMATION_h_
2 | #define __GAZEESTIMATION_h_
3 |
4 | #include "opencv2/core/core.hpp"
5 | #include "LandmarkCoreIncludes.h"
6 |
7 | namespace GazeEstimate
8 | {
9 |
10 | void EstimateGaze(const LandmarkDetector::CLNF& clnf_model, cv::Point3f& gaze_absolute, float fx, float fy, float cx, float cy, bool left_eye);
11 | void DrawGaze(cv::Mat img, const LandmarkDetector::CLNF& clnf_model, cv::Point3f gazeVecAxisLeft, cv::Point3f gazeVecAxisRight, float fx, float fy, float cx, float cy);
12 |
13 | }
14 | #endif
15 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/lib/local/LandmarkDetector/include/LandmarkCoreIncludes.h:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////
2 | ///////////////////////////////////////////////////////////////////////////////
3 |
4 |
5 | #ifndef __LANDMARK_CORE_INCLUDES_h_
6 | #define __LANDMARK_CORE_INCLUDES_h_
7 |
8 | #include "LandmarkDetectorModel.h"
9 | #include "LandmarkDetectorFunc.h"
10 | #include "LandmarkDetectorParameters.h"
11 | #include "LandmarkDetectorUtils.h"
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/FaceAR_SDK_IOS_OpenFace_RunFull/lib/local/LandmarkDetector/include/stdafx.h:
--------------------------------------------------------------------------------
1 | // Precompiled headers stuff
2 |
3 | #ifndef __STDAFX_h_
4 | #define __STDAFX_h_
5 |
6 | // OpenCV includes
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include // Video write
13 | #include // Video write
14 | #include
15 |
16 | // IplImage stuff
17 | #include
18 | #include
19 |
20 | // C++ stuff
21 | #include
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | #include
28 | #include