public class AVDepthData extends NSObject
An object wrapping a map of disparity or depth pixel data, plus metadata.
"Depth Data" is a generic term for a map of pixel data containing depth-related information. AVDepthData wraps a disparity or depth map and provides conversion methods, focus information, and camera calibration data to aid in using the map for rendering or computer vision tasks. CoreVideo supports the following four depth data pixel formats: kCVPixelFormatType_DisparityFloat16 = 'hdis' kCVPixelFormatType_DisparityFloat32 = 'fdis' kCVPixelFormatType_DepthFloat16 = 'hdep' kCVPixelFormatType_DepthFloat32 = 'fdep'
The disparity formats describe normalized shift values when comparing two images. Units are 1/meters: ( pixelShift / (pixelFocalLength * baselineInMeters) ). The depth formats describe the distance to an object in meters.
Disparity / depth maps are generated from camera images containing non-rectilinear data. Camera lenses have small imperfections that cause small distortions in their resultant images compared to a pinhole camera. AVDepthData maps contain non-rectilinear (non-distortion-corrected) data as well. Their values are warped to match the lens distortion characteristics present in their accompanying YUV image. Therefore an AVDepthData map can be used as a proxy for depth when rendering effects to its accompanying image, but not to correlate points in 3D space. In order to use AVDepthData for computer vision tasks, you should use its accompanying camera calibration data to rectify the depth data (see AVCameraCalibrationData).
When capturing depth data from a camera using AVCaptureDepthDataOutput, AVDepthData objects are delivered to your AVCaptureDepthDataOutputDelegate in a streaming fashion. When capturing depth data along with photos using AVCapturePhotoOutput, depth data is delivered to your AVCapturePhotoCaptureDelegate as a property of an AVCapturePhoto (see -[AVCapturePhotoCaptureDelegate captureOutput:didFinishProcessingPhoto:error:]). When working with image files containing depth information, AVDepthData may be instantiated using information obtained from ImageIO. When editing images containing depth information, derivative AVDepthData objects may be instantiated reflecting the edits that have been performed.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
AVDepthData(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static AVDepthData |
alloc() |
static AVDepthData |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
NSArray<? extends NSNumber> |
availableDepthDataTypes()
[@property] availableDepthDataTypes
|
AVCameraCalibrationData |
cameraCalibrationData()
[@property] cameraCalibrationData
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
static java.lang.String |
debugDescription_static() |
long |
depthDataAccuracy()
[@property] depthDataAccuracy
|
AVDepthData |
depthDataByApplyingExifOrientation(int exifOrientation)
depthDataByApplyingExifOrientation:
|
AVDepthData |
depthDataByConvertingToDepthDataType(int depthDataType)
depthDataByConvertingToDepthDataType:
|
AVDepthData |
depthDataByReplacingDepthDataMapWithPixelBufferError(CVBufferRef pixelBuffer,
org.moe.natj.general.ptr.Ptr<NSError> outError)
depthDataByReplacingDepthDataMapWithPixelBuffer:error:
|
static AVDepthData |
depthDataFromDictionaryRepresentationError(NSDictionary<?,?> imageSourceAuxDataInfoDictionary,
org.moe.natj.general.ptr.Ptr<NSError> outError)
depthDataFromDictionaryRepresentation:error:
|
CVBufferRef |
depthDataMap()
[@property] depthDataMap
|
long |
depthDataQuality()
[@property] depthDataQuality
|
int |
depthDataType()
[@property] depthDataType
|
static java.lang.String |
description_static() |
NSDictionary<?,?> |
dictionaryRepresentationForAuxiliaryDataType(org.moe.natj.general.ptr.Ptr<NSString> outAuxDataType)
dictionaryRepresentationForAuxiliaryDataType:
|
static long |
hash_static() |
AVDepthData |
init() |
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
boolean |
isDepthDataFiltered()
[@property] depthDataFiltered
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static AVDepthData |
new_objc() |
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static AVDepthData alloc()
public static AVDepthData allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public NSArray<? extends NSNumber> availableDepthDataTypes()
Specifies which depth data pixel formats may be used with depthDataByConvertingToDepthDataType:.
This property presents the available pixel format types as an array of NSNumbers, each wrapping an OSType (CV pixel format type).
public AVCameraCalibrationData cameraCalibrationData()
The calibration data of the camera with which AVDepthData map's values are aligned.
See AVCameraCalibrationData for more information. This property may return nil if no camera calibration data is available for the depth data.
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public long depthDataAccuracy()
Specifies the accuracy of the units in the depth data map's values.
See AVDepthDataAccuracy documentation for more information.
public AVDepthData depthDataByApplyingExifOrientation(int exifOrientation)
Returns a derivative AVDepthData instance in which the specified Exif orientation has been applied.
When applying simple 90 degree rotation or mirroring edits to media containing depth data, you may use this initializer to create a derivative copy of the depth in which the specified orientation is applied to both the underlying pixel map data and the camera calibration data. This method throws an NSInvalidArgumentException if you pass an unrecognized exifOrientation.
exifOrientation - One of the 8 standard Exif orientation tags expressing how the depth data should be rotated / mirrored.public AVDepthData depthDataByConvertingToDepthDataType(int depthDataType)
Returns a converted, derivative AVDepthData instance in the specified depthDataType.
This method throws an NSInvalidArgumentException if you pass an unrecognized depthDataType. See
depthDataType - The OSType of depthData object to which you'd like to convert. Must be present in availableDepthDataTypes.public AVDepthData depthDataByReplacingDepthDataMapWithPixelBufferError(CVBufferRef pixelBuffer, org.moe.natj.general.ptr.Ptr<NSError> outError)
Returns an AVDepthData instance wrapping the replacement depth data map pixel buffer.
When applying complex edits to media containing depth data, you may create a derivative map with arbitrary transforms applied to it, then use this initializer to create a new AVDepthData. Note that this new depth data object has no camera calibration data, so its cameraCalibrationData property always returns nil.
pixelBuffer - A pixel buffer containing depth data information in one of the 4 supported disparity / depth pixel formats.outError - On return, if the depth data cannot be created, points to an NSError describing the problem.public static AVDepthData depthDataFromDictionaryRepresentationError(NSDictionary<?,?> imageSourceAuxDataInfoDictionary, org.moe.natj.general.ptr.Ptr<NSError> outError)
Returns an AVDepthData instance from depth information in an image file.
When using ImageIO framework's CGImageSource API to read from a HEIF or JPEG file containing depth data, AVDepthData can be instantiated using the result of CGImageSourceCopyAuxiliaryDataInfoAtIndex, which returns a CFDictionary of primitive map information.
imageSourceAuxDataInfoDictionary - A dictionary of primitive depth-related information obtained from CGImageSourceCopyAuxiliaryDataInfoAtIndex.outError - On return, if the depth data cannot be created, points to an NSError describing the problem.public CVBufferRef depthDataMap()
Provides access to the depth data object's internal map.
The depth data map's pixel format can be queried using the depthDataType property.
public long depthDataQuality()
Specifies the overall quality of the depth data map's values.
See AVDepthDataQuality documentation for more information.
public int depthDataType()
Specifies the pixel format type of this depth data object's internal map.
One of kCVPixelFormatType_DisparityFloat16, kCVPixelFormatType_DisparityFloat32, kCVPixelFormatType_DepthFloat16, or kCVPixelFormatType_DepthFloat32.
public static java.lang.String description_static()
public NSDictionary<?,?> dictionaryRepresentationForAuxiliaryDataType(org.moe.natj.general.ptr.Ptr<NSString> outAuxDataType)
Returns a dictionary of primitive map information to be used when writing an image file with depth data.
When using ImageIO framework's CGImageDestination API to write depth data to a HEIF or JPEG file, you may use this method to generate a dictionary of primitive map information consumed by CGImageDestinationAddAuxiliaryDataInfo.
outAuxDataType - On output, either kCGImageAuxiliaryDataTypeDisparity or kCGImageAuxiliaryDataTypeDepth, depending on the depth data's file.public static long hash_static()
public AVDepthData init()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public boolean isDepthDataFiltered()
Specifies whether the depth data pixel buffer map contains filtered (hole-filled) data.
By setting either AVCaptureDepthDataOutput's filteringEnabled property or AVCapturePhotoSettings' depthDataFiltered property to YES, the resulting depth data are filtered to remove invalid pixel values that may be present due to a variety of factors including low light and lens occlusion. If you've requested depth data filtering, all depth data holes are filled. Note that filtering the depth data makes it more usable for applying effects, but alters the data such that it may no longer be suitable for computer vision tasks. Unfiltered depth maps present missing data as NaN.
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static AVDepthData new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()