Introduction
Welcome to the documentation for PBJVision – a comprehensive computer vision library for iOS.
Getting Started
Installation
- To install PBJVision, you can use CocoaPods by adding the following line to your Podfile:
- Alternatively, you can manually integrate PBJVision into your project by adding all the files in the “PBJVision” folder to your project.
pod 'PBJVision'
Usage
To start using PBJVision, simply follow these steps:
- Create an instance of
PBJVision
in your view controller: - Set the desired camera capture quality:
- Implement the
PBJVisionDelegate
protocol in your view controller: - Start and stop capturing as needed:
// Swift
let vision = PBJVision()
// Objective-C
PBJVision *vision = [PBJVision sharedInstance];
// Swift
vision.cameraDevice = .back
vision.cameraMode = .photo
vision.cameraOrientation = .portrait
vision.focusMode = .continuousAutoFocus
// Objective-C
vision.cameraDevice = AVCaptureDevicePositionBack;
vision.cameraMode = PBJCameraModePhoto;
vision.cameraOrientation = PBJCameraOrientationPortrait;
vision.focusMode = PBJFocusModeContinuousAutoFocus;
// Swift
vision.delegate = self
// Objective-C
vision.delegate = self;
// Swift
vision.startPreview()
vision.startCapture()
// Objective-C
[vision startPreview];
[vision startCapture];
Features
Photo Capture
PBJVision allows capturing high-quality photos with ease:
- Implement the
photoOutput:didCapturePhoto:error:
delegate method to receive captured photos. - To capture a photo, call the
capturePhoto
method.
Video Capture
PBJVision also provides seamless video capturing capabilities:
- Implement the
videoOutput:didCaptureSampleBuffer:
delegate method to receive captured video frames. - You can start capturing a video by calling the
startVideoCapture
method, and stop it usingendVideoCapture
.
Customization
PBJVision offers various customization options for more control over your capture experience:
- Adjust video recording settings like video codec, pixel format, and bit rate using
videoBitRate
,videoCodec
, andvideoCompressionProperties
. - Enable or disable audio recording during video capture with
enableAudioCapture
. - Set the preview view for the camera using
previewView
. - Change the video orientation using
setVideoOrientation:
. - Manually control the focus and exposure using various methods provided by the
PBJVision
class.
Documentation
For detailed information on using PBJVision, refer to the official CocoaDocs documentation.
Examples
Here are a few examples showcasing the usage of PBJVision in different scenarios:
- Example 1 – Capturing photos using PBJVision.
- Example 2 – Recording videos with PBJVision.
- Example 3 – Customizing the camera interface with PBJVision.
Conclusion
Congratulations! You’ve now learned how to integrate and use PBJVision in your iOS project. With its powerful computer vision capabilities, the possibilities are endless.