Latest 0.1.2
Homepage https://github.com/JasonHan1990/JCBodymarkerCamera
License MIT
Platforms ios 10.2
Dependencies Masonry
Frameworks UIKit, AVFoundation, CoreMotion
Authors

Version
License
Platform

Description

JCBodymarkerCamera is a camera for body measurement. It has both front body marker and side body marker. It also has an indicator to show the vertical angle of your device.

JCBodymarkerCamera only works with portrait position. It doesn’t contain the algrithm for body measurement.

JCBodymarkerCamera is built for iOS 10.2 or later.

Example

example

There are two enums to setup a camera view controller.

// define marker
typedef NS_ENUM(NSInteger, BodyMarkerOption) {
BodyMarkerOptionUnspecified,
BodyMarkerOptionFront,
BodyMarkerOptionSide
};

// define camera
typedef NS_ENUM(NSInteger, CameraOption) {
CameraOptionUnspecified = 0,
CameraOptionRearCamera = 1,
CameraOptionFrontFacingCamera = 2,
};

To create a camera view controller, you can simply do this:
Import JCCameraViewController to your source file.

#import "JCCameraViewController.h"

Open the camera with front body marker.

example-1

JCCameraViewController *cameraViewController = [[JCCameraViewController alloc] initWithBodyMarkerOption:BodyMarkerOptionFront];
[self presentViewController:cameraViewController animated:YES completion:nil];

Open the camera with side body marker.

example-2

JCCameraViewController *cameraViewController = [[JCCameraViewController alloc] initWithBodyMarkerOption:BodyMarkerOptionSide];
[self presentViewController:cameraViewController animated:YES completion:nil];

Open the camera with only front facing camera.

example-3

JCCameraViewController *cameraViewController = [[JCCameraViewController alloc] init];
cameraViewController.cameraOption = CameraOptionFrontFacingCamera;
[self presentViewController:cameraViewController animated:YES completion:nil];

Open the camera with only rear camera.

example-4

JCCameraViewController *cameraViewController = [[JCCameraViewController alloc] init];
cameraViewController.cameraOption = CameraOptionRearCamera;
[self presentViewController:cameraViewController animated:YES completion:nil];

Get process your image data. Create completion blocks when you init a camera view controller.


cameraViewController.successedCompletion = ^(NSData *imageData) {
    // it is on the main thread
    // process your image data
};

cameraViewController.failedCompletion = ^(NSError *error) {
    // pop error message
};

Don’t forget adding camera usage

NSCameraUsageDescription

Dependency

JCBodymarkerCamera is using Masonry for autolayout.

Installation

JCBodymarkerCamera is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'JCBodymarkerCamera'

Author

Juncheng Han, [email protected]

My Blog:
https://junchenghan.com/

License

JCBodymarkerCamera is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "JCBodymarkerCamera",
    "version": "0.1.2",
    "summary": "JCBodymarkerCamera is a special camera for body measurement.",
    "description": "JCBodymarkerCamera is a special camera for body measurement. It is built with Apple's AVFoundation framework. The camera main view has a bodymarker for you to pose your body and it has a camera vertical level indicator for you to correct your device vertical angle.",
    "homepage": "https://github.com/JasonHan1990/JCBodymarkerCamera",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "JasonHan1990": "[email protected]"
    },
    "source": {
        "git": "https://github.com/JasonHan1990/JCBodymarkerCamera.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "10.2"
    },
    "source_files": "JCBodymarkerCamera/Classes/**/*",
    "resource_bundles": {
        "JCBodymarkerCamera": [
            "JCBodymarkerCamera/Assets/Images.xcassets"
        ]
    },
    "frameworks": [
        "UIKit",
        "AVFoundation",
        "CoreMotion"
    ],
    "dependencies": {
        "Masonry": [
            "~> 1.1.0"
        ]
    }
}

Pin It on Pinterest

Share This