Post

Replies

Boosts

Views

Activity

How to improve the captured image's resolution?
To create signatures for human faces and compare the similarities, I'm using ARKit's captureImage from ARFrame which is derived from the front facing camera with ARFaceTrackingConfiguration. However, compared to using the Vision and AVFoundation frameworks, the quality of the signature analysis is significantly impacted by the captureImage's low resolution. The resolution of the capturedImage in ARKit is just 640x480, according to capturedDepthData even though the video format is set to the highest resolution. let configuration = ARFaceTrackingConfiguration() if let videoFormat = ARFaceTrackingConfiguration.supportedVideoFormats.sorted(by: { ($0.imageResolution.width * $0.imageResolution.height) < ($1.imageResolution.width * $1.imageResolution.height) }).last { configuration.videoFormat = videoFormat } I tried using captureHighResolutionFrame and as well as change the video format: if let videoFormat = ARFaceTrackingConfiguration.recommendedVideoFormatForHighResolutionFrameCapturing { configuration.videoFormat = videoFormat } However, according to the documentation: The system delivers a high-resolution frame out-of-band, which means that it doesn't affect the other frames that the session receives at a regular interval The asynchronous nature of taking the high resolution images seems to result alternating between the standard captured image and the high resolution images rather than replacing the regular captured images. This is a concern because, depending on the size variations, displayTransform and CGAffineTransform must be used in different ways to scale the images. Not only that I need to able to use the frames continuously at either 30 fps or 60 fps, as they're produced rather than taking pictures occasionally, which the captureHighResolutionFrame method seems to be designed for considering the shutter sound. In order to use the captured image, I'm currently transforming it in the following way let image: CIImage = CIImage(cvImageBuffer: imageBuffer) let imageSize: CGSize = CGSize(width: CVPixelBufferGetWidth(imageBuffer), height: CVPixelBufferGetHeight(imageBuffer)) let normalizeTransform: CGAffineTransform = CGAffineTransform(scaleX: 1.0 / imageSize.width, y: 1.0 / imageSize.height) let flipTransform: CGAffineTransform = metadata.orientation.isPortrait ? CGAffineTransform(scaleX: -1, y: -1).translatedBy(x: -1, y: -1) : .identity guard let viewPort: CGRect = face.viewPort else { return nil } let viewPortSize: CGSize = viewPort.size guard let displayTransform: CGAffineTransform = face.arFrame?.displayTransform(for: metadata.orientation, viewportSize: CGSize(width: viewPortSize.width, height: viewPortSize.height)) else {   return nil } let scaleX: CGFloat = viewPortSize.width let scaleY: CGFloat = viewPortSize.height let viewPortTransform: CGAffineTransform = CGAffineTransform(scaleX: scaleX, y: scaleY) let scaledImage: CIImage = image   .transformed(by: normalizeTransform     .concatenating(flipTransform)     .concatenating(displayTransform)     .concatenating(viewPortTransform)   )   .cropped(to: viewPort)
2
0
1.8k
Feb ’23
dyld: Library not loaded
I'm getting what seems to be a dynamic linker error, but can't seem to resolve it. dyld[541]: Library not loaded: @rpath/TCore.framework/TCore  Referenced from: /private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/FaceSDK.framework/FaceSDK  Reason: tried: '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/FaceSDK.framework/Frameworks/TCore.framework/TCore' (no such file), '/usr/lib/swift/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/usr/lib/swift/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/System/Library/Frameworks/TCore.framework/TCore' (no such file) Library not loaded: @rpath/TCore.framework/TCore  Referenced from: /private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/FaceSDK.framework/FaceSDK  Reason: tried: '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/FaceSDK.framework/Frameworks/TCore.framework/TCore' (no such file), '/usr/lib/swift/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/NavigationApp.app/Frameworks/TCore.framework/TCore' (no such file), '/private/var/containers/Bundle/Application/EEBCD2F1-3A25-4BCE-A151-04EC09374288/Navigatio So far I've tried embedding it and linking it in both "General" and "Build Phase" of the Settings. I've tried setting Dynamic Library Install Name Base to @rpath as well as setting Always Embed Swift Standard Libraries to YES, but none seem to work.
6
0
4.6k
May ’22
CloudKit's public container can be accessed on wifi, but not on the cellular network
I'm attempting to write to the public container of CloudKit, but I keep getting the error message: CKError 0x281ff9ec0: "Network Unavailable" (3/NSURLErrorDomain:-1009); "The Internet connection appears to be offline." only when I'm accessing the container through the cellular network. When I try on a wifi network, however, it works perfectly fine and can confirm the presence of the uploaded data on the dashboard. There is absolutely nothing wrong with the cellular connectivity of my device. let publicCloudDatabase = CKContainer.default().publicCloudDatabase let operation = CKModifyRecordsOperation(recordsToSave: [exampleRecord], recordIDsToDelete: nil) let operationConfiguration = CKOperation.Configuration() operationConfiguration.allowsCellularAccess = true operationConfiguration.qualityOfService = .userInitiated operation.configuration = operationConfiguration operation.perRecordProgressBlock = {(record, progress) in &#9;&#9;print(progress) } operation.perRecordCompletionBlock = {(record, error) in &#9;&#9;print("Upload complete") } publicCloudDatabase.add(operation) publicCloudDatabase.save(exampleRecord) { [unowned self] record, error in &#9;&#9;if let error = error { &#9;&#9;&#9;&#9;print("public cloud database error: \(error)") &#9;&#9;} else { &#9;&#9;&#9;&#9;print("Sucessfully uploaded to Public Cloud DB") &#9;&#9;} } I've tried the different quality of service, like userInteractive, but still doesn't work. I initialize the container in AppDelegate.swift with the standard code: lazy var persistentCloudKitContainer: NSPersistentCloudKitContainer = {   let container = NSPersistentCloudKitContainer(name: "Example")       guard let description = container.persistentStoreDescriptions.first else {     fatalError("Could not retrieve a pesistent store description")   }       let options = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.noName.Example")   description.cloudKitContainerOptions = options   do {     try container.initializeCloudKitSchema()   } catch {     print("Initialize error: \(error)")   }       container.loadPersistentStores(completionHandler: { (storeDescription, error) in     if let error = error as NSError? {       fatalError("Unresolved error \(error), \(error.userInfo)")     }   })   return container }() The Security Role on the dashboard shows that the creator can both read and write. Xcode: Version 12.0 beta 6 iOS: 14.0
2
0
1.3k
Feb ’21