Earn 9,000 ($90.00)
Adapt a C++ implementation for iOS
Bounty Description
Face Alignment Implementation for iOS Integration
We have a C++ implementation that crops and aligns a face from an image based on 5 facial landmarks.
Current Implementation
The code takes the following inputs:
Target image filepath
Five facial landmarks (coordinates of eyes, nose, mouth corners)
Output crop size (default 112×112 pixels)
Filepath to write the cropped image to
Sample Input:
./face_alignment input.jpg output.jpg 112 76.77 150.33 141.15 130.50 111.25 180.37 108.10 217.14 159.93 199.44
This processes input.jpg using the 5 landmarks (each with x,y coordinates) and outputs a 112×112 aligned face to output.jpg.
Dependencies
The only external dependency it uses is OpenCV.
Requirements
Adapt this C++ implementation for iOS:
Create an Objective-C++ wrapper that can be called from Swift
Package as a framework or Swift Package
Include the necessary OpenCV iOS components
Modify the implementation to:
Accept UIImage or CVPixelBuffer as input rather than filesystem paths
Return processed image as UIImage
Handle errors gracefully with Swift-friendly error handling
Deliverables:
Ideally an xcframework that’s placed within an SPM, so the app can directly add SPM. let the SPM/framework handle its own dependencies (opencv)
Sample iOS application demonstrating usage
Integration documentation with usage examples
Performance benchmarks on at least two different iOS devices
The final implementation should:
Be thread-safe
Run on a background thread or GCD queue
Support iOS 12.0 and above
Follow iOS-specific best practices for native code
Support both simulator and device architectures