├── .gitignore
├── CameraFramework
├── Info.plist
└── Sources
│ ├── AVCaptureDeviceBuilder.swift
│ ├── AVCaptureVideoDataOutputBuilder.swift
│ ├── CameraFramework.h
│ ├── VideoAccess.swift
│ ├── VideoDataCaptureBuilder.swift
│ └── VideoImageCapture.swift
├── CameraFrameworkTests
├── CameraFrameworkTests.swift
└── Info.plist
├── Cartfile.resolved
├── ImageProcessingSample.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcshareddata
│ └── xcschemes
│ └── ImageProcessingSample.xcscheme
├── ImageProcessingSample
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
├── Info.plist
├── Sources
│ ├── AppDelegate.swift
│ ├── CIImageDrawable.swift
│ ├── GLVideoPreview.swift
│ ├── MetalVideoPreview.swift
│ ├── Presenter.swift
│ ├── Utilities
│ │ ├── CIImage+Resize.swift
│ │ └── UIImage+Resize.swift
│ └── ViewController.swift
└── Storyboards
│ └── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── ImageProcessingSampleTests
├── ImageProcessingSampleTests.swift
└── Info.plist
├── ImageProcessingSampleUITests
├── ImageProcessingSampleUITests.swift
└── Info.plist
├── LICENSE
├── OpneCVImageProcessingFramework
├── Info.plist
└── Sources
│ ├── Driver
│ ├── CircleDetectionResult.h
│ ├── CircleDetectionResult.m
│ ├── OpenCVDriver.h
│ └── OpenCVDriver.mm
│ ├── OpenCVImageProcessor.swift
│ └── OpneCVImageProcessingFramework.h
├── OpneCVImageProcessingFrameworkTests
├── Info.plist
└── OpneCVImageProcessingFrameworkTests.swift
├── README.md
├── Scripts
└── Bootstrap.sh
└── cartfile
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xccheckout
23 | *.xcscmblueprint
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 | *.dSYM.zip
29 | *.dSYM
30 |
31 | ## Playgrounds
32 | timeline.xctimeline
33 | playground.xcworkspace
34 |
35 | # Swift Package Manager
36 | #
37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
38 | # Packages/
39 | # Package.pins
40 | # Package.resolved
41 | .build/
42 |
43 | # CocoaPods
44 | #
45 | # We recommend against adding the Pods directory to your .gitignore. However
46 | # you should judge for yourself, the pros and cons are mentioned at:
47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
48 | #
49 |
50 | Pods/
51 |
52 | # Carthage
53 | #
54 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
55 |
56 | Carthage/Checkouts
57 | Carthage/Build
58 |
59 | # fastlane
60 | #
61 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
62 | # screenshots whenever they are needed.
63 | # For more information about the recommended setup visit:
64 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
65 |
66 | fastlane/report.xml
67 | fastlane/Preview.html
68 | fastlane/screenshots/**/*.png
69 | fastlane/test_output
70 |
71 | ## OpenCV
72 |
73 | OpenCV/
74 |
--------------------------------------------------------------------------------
/CameraFramework/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CameraFramework/Sources/AVCaptureDeviceBuilder.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AVCaptureDeviceBuilder.swift
3 | // CameraFramework
4 | //
5 | // Created by kotetu on 2019/08/10.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import AVFoundation
10 |
11 | public protocol AVCaptureDeviceBuilder {
12 | func build() -> AVCaptureDevice?
13 | }
14 |
15 | public final class DefaultBackVideoDeviceBuilder: AVCaptureDeviceBuilder {
16 | public init() {}
17 |
18 | public func build() -> AVCaptureDevice? {
19 | return AVCaptureDevice.default(.builtInDualCamera, for: .video, position: .back)
20 | }
21 | }
22 |
23 | public final class BackTrueDepthVideoDeviceBuilder: AVCaptureDeviceBuilder {
24 | public init() {}
25 |
26 | public func build() -> AVCaptureDevice? {
27 | return AVCaptureDevice.default(.builtInTrueDepthCamera, for: .video, position: .back)
28 | }
29 | }
30 |
31 | public final class BestBackVideoDeviceBuilder: AVCaptureDeviceBuilder {
32 | public init() {}
33 |
34 | public func build() -> AVCaptureDevice? {
35 | let deviceTypes: [AVCaptureDevice.DeviceType] = [.builtInTrueDepthCamera, .builtInDualCamera, .builtInWideAngleCamera]
36 | let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: deviceTypes,
37 | mediaType: .video,
38 | position: .back)
39 | return discoverySession.devices.first
40 | }
41 | }
42 |
43 | public final class BestFrontVideoDeviceBuilder: AVCaptureDeviceBuilder {
44 | public init() {}
45 |
46 | public func build() -> AVCaptureDevice? {
47 | let deviceTypes: [AVCaptureDevice.DeviceType] = [.builtInWideAngleCamera]
48 | let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: deviceTypes,
49 | mediaType: .video,
50 | position: .front)
51 | return discoverySession.devices.first
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/CameraFramework/Sources/AVCaptureVideoDataOutputBuilder.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AVCaptureVideoDataOutputBuilder.swift
3 | // CameraFramework
4 | //
5 | // Created by kotetu on 2019/08/10.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import AVFoundation
10 |
11 | public protocol AVCaptureVideoDataOutputBuilder {
12 | func build() -> AVCaptureVideoDataOutput
13 | }
14 |
15 | public final class DefaultBGRAVideoDataOutputBuilder: AVCaptureVideoDataOutputBuilder {
16 | public init() {}
17 |
18 | public func build() -> AVCaptureVideoDataOutput {
19 | let videoDataOutput = AVCaptureVideoDataOutput()
20 | // UIImageへの変換を想定しBGRAで取るようにする
21 | videoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_32BGRA]
22 | // キューをブロック中にキャプチャしたフレームは破棄
23 | videoDataOutput.alwaysDiscardsLateVideoFrames = true
24 | return videoDataOutput
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CameraFramework/Sources/CameraFramework.h:
--------------------------------------------------------------------------------
1 | //
2 | // CameraFramework.h
3 | // CameraFramework
4 | //
5 | // Created by kotetu on 2019/07/30.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for CameraFramework.
12 | FOUNDATION_EXPORT double CameraFrameworkVersionNumber;
13 |
14 | //! Project version string for CameraFramework.
15 | FOUNDATION_EXPORT const unsigned char CameraFrameworkVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CameraFramework/Sources/VideoAccess.swift:
--------------------------------------------------------------------------------
1 | //
2 | // VideoAccess.swift
3 | // CameraFramework
4 | //
5 | // Created by kotetu on 2019/08/07.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import AVFoundation
10 | import RxSwift
11 |
12 | public final class VideoAccess {
13 | public enum VideoAccessError: Error {
14 | case denied
15 | case general
16 | }
17 |
18 | public init() {}
19 |
20 | public func requestVideoAccess() -> Completable {
21 | return Completable.create { completable in
22 | let status = AVCaptureDevice.authorizationStatus(for: .video)
23 | switch status {
24 | case .authorized:
25 | completable(.completed)
26 | case .notDetermined:
27 | AVCaptureDevice.requestAccess(for: .video, completionHandler: { (authorized) in
28 | if authorized {
29 | completable(.completed)
30 | } else {
31 | completable(.error(VideoAccessError.denied))
32 | }
33 | })
34 | case .denied, .restricted:
35 | completable(.error(VideoAccessError.denied))
36 | @unknown default:
37 | completable(.error(VideoAccessError.general))
38 | }
39 | return Disposables.create {}
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/CameraFramework/Sources/VideoDataCaptureBuilder.swift:
--------------------------------------------------------------------------------
1 | //
2 | // VideoDataCaptureBuilder.swift
3 | // CameraFramework
4 | //
5 | // Created by kotetu on 2019/08/10.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import AVFoundation
10 |
11 | public protocol VideoDataCaptureBuilder {
12 | func build() -> VideoImageCapture?
13 | }
14 |
15 | public final class BasicVideoDataCaptureBuilder: VideoDataCaptureBuilder {
16 | private let deviceBuilder: AVCaptureDeviceBuilder
17 | private let videoDataOutputBuilder: AVCaptureVideoDataOutputBuilder
18 |
19 | public init(deviceBuilder: AVCaptureDeviceBuilder = BestBackVideoDeviceBuilder(),
20 | videoDataOutputBuilder: AVCaptureVideoDataOutputBuilder = DefaultBGRAVideoDataOutputBuilder()) {
21 | self.deviceBuilder = deviceBuilder
22 | self.videoDataOutputBuilder = videoDataOutputBuilder
23 | }
24 |
25 | public func build() -> VideoImageCapture? {
26 | let captureSession = AVCaptureSession()
27 |
28 | //
29 | // AVCaptureDevice
30 | //
31 | guard let device = deviceBuilder.build() else {
32 | return nil
33 | }
34 |
35 | do {
36 | try device.lockForConfiguration()
37 | } catch {
38 | return nil
39 | }
40 |
41 | // 撮影対象までの距離が近い場合はautoFocusRangeRestrictionの設定を行うことで最適化できる場合がある
42 | if device.isAutoFocusRangeRestrictionSupported {
43 | device.autoFocusRangeRestriction = .near
44 | }
45 |
46 | device.unlockForConfiguration()
47 |
48 | //
49 | // AVCaptureDeviceInput
50 | //
51 | guard
52 | let deviceInput = try? AVCaptureDeviceInput(device: device),
53 | captureSession.canAddInput(deviceInput) else {
54 | return nil
55 | }
56 |
57 | captureSession.addInput(deviceInput)
58 |
59 | //
60 | // AVCaptureVideoDataOutput
61 | //
62 | let videoDataOutput = videoDataOutputBuilder.build()
63 | guard captureSession.canAddOutput(videoDataOutput) else { return nil }
64 | captureSession.addOutput(videoDataOutput)
65 |
66 | //
67 | // AVCaptureConnection
68 | //
69 | if let connection = videoDataOutput.connection(with: .video) {
70 | // フロントカメラの場合に左右反転させる
71 | switch device.position {
72 | case .front:
73 | connection.isVideoMirrored = true
74 | case .back:
75 | connection.videoOrientation = .portrait
76 | case .unspecified:
77 | break
78 | @unknown default:
79 | break
80 | }
81 |
82 | // 手ブレ補正 (設定するとGLKView, MTKViewを使ったCIImageの表示が遅くなる)
83 | if connection.isVideoStabilizationSupported {
84 | connection.preferredVideoStabilizationMode = .auto
85 | }
86 | }
87 |
88 | //
89 | // AVCaptureSession
90 | //
91 | captureSession.beginConfiguration()
92 |
93 | // ビデオ解像度(できる限り高解像度を設定する)
94 | if captureSession.canSetSessionPreset(.hd4K3840x2160) {
95 | captureSession.sessionPreset = .hd4K3840x2160
96 | } else if captureSession.canSetSessionPreset(.hd1920x1080) {
97 | captureSession.sessionPreset = .hd1920x1080
98 | } else {
99 | captureSession.sessionPreset = .high
100 | }
101 |
102 | captureSession.commitConfiguration()
103 |
104 | let videoDataCapture = VideoImageCapture(captureSession: captureSession,
105 | videoDataOutput: videoDataOutput)
106 |
107 | return videoDataCapture
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/CameraFramework/Sources/VideoImageCapture.swift:
--------------------------------------------------------------------------------
1 | //
2 | // VideoImageCapture.swift
3 | // CameraFramework
4 | //
5 | // Created by kotetu on 2019/08/06.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import AVFoundation
10 |
11 | public protocol VideoImageCaptureDelegate: AnyObject {
12 | func didOutput(ciImage: CIImage)
13 | }
14 |
15 | public final class VideoImageCapture: NSObject {
16 | private let captureSession: AVCaptureSession
17 | private let videoDataOutput: AVCaptureVideoDataOutput
18 | private let bufferQueue = DispatchQueue(label: "co.kotetu.buffer.queue")
19 |
20 | private weak var videoImageCaptureDelegate: VideoImageCaptureDelegate?
21 |
22 | init(captureSession: AVCaptureSession,
23 | videoDataOutput: AVCaptureVideoDataOutput) {
24 | self.captureSession = captureSession
25 | self.videoDataOutput = videoDataOutput
26 | super.init()
27 |
28 | self.videoDataOutput.setSampleBufferDelegate(self, queue: bufferQueue)
29 | }
30 |
31 | public func setPreviewLayer(_ layer: CALayer) {
32 | let videoPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession)
33 | // アスペクト比に合わせて左右を切り取る(上下は切り取らない)
34 | videoPreviewLayer.videoGravity = .resizeAspectFill
35 | videoPreviewLayer.frame = layer.bounds
36 | layer.insertSublayer(videoPreviewLayer, at: 0)
37 | }
38 |
39 | public func setVideoImageCaptureDelegate(_ delegate: VideoImageCaptureDelegate) {
40 | videoImageCaptureDelegate = delegate
41 | }
42 |
43 | public func start() {
44 | guard !captureSession.isRunning else { return }
45 | captureSession.startRunning()
46 | }
47 |
48 | public func stop() {
49 | guard captureSession.isRunning else { return }
50 | captureSession.stopRunning()
51 | }
52 | }
53 |
54 | extension VideoImageCapture: AVCaptureVideoDataOutputSampleBufferDelegate {
55 | public func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
56 | guard let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { return }
57 | let ciImage = CIImage(cvImageBuffer: imageBuffer)
58 | videoImageCaptureDelegate?.didOutput(ciImage: ciImage)
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/CameraFrameworkTests/CameraFrameworkTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CameraFrameworkTests.swift
3 | // CameraFrameworkTests
4 | //
5 | // Created by kotetu on 2019/07/30.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import CameraFramework
11 |
12 | class CameraFrameworkTests: XCTestCase {
13 |
14 | override func setUp() {
15 | // Put setup code here. This method is called before the invocation of each test method in the class.
16 | }
17 |
18 | override func tearDown() {
19 | // Put teardown code here. This method is called after the invocation of each test method in the class.
20 | }
21 |
22 | func testExample() {
23 | // This is an example of a functional test case.
24 | // Use XCTAssert and related functions to verify your tests produce the correct results.
25 | }
26 |
27 | func testPerformanceExample() {
28 | // This is an example of a performance test case.
29 | self.measure {
30 | // Put the code you want to measure the time of here.
31 | }
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/CameraFrameworkTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Cartfile.resolved:
--------------------------------------------------------------------------------
1 | github "ReactiveX/RxSwift" "5.0.1"
2 |
--------------------------------------------------------------------------------
/ImageProcessingSample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 4A78952922F930900096FBCD /* VideoImageCapture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A78952822F930900096FBCD /* VideoImageCapture.swift */; };
11 | 4A78952E22F936EA0096FBCD /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A78952D22F936EA0096FBCD /* RxSwift.framework */; };
12 | 4A78953022F936FA0096FBCD /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A78952F22F936FA0096FBCD /* RxCocoa.framework */; };
13 | 4A89DD5E2316F308001BD672 /* GLVideoPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A89DD5D2316F308001BD672 /* GLVideoPreview.swift */; };
14 | 4A89DD602316F365001BD672 /* MetalVideoPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A89DD5F2316F365001BD672 /* MetalVideoPreview.swift */; };
15 | 4A9F2BA1231A797E002E153B /* CIImageDrawable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A9F2BA0231A797E002E153B /* CIImageDrawable.swift */; };
16 | 4AC36CE2231A8F1B0006B590 /* UIImage+Resize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AC36CE1231A8F1B0006B590 /* UIImage+Resize.swift */; };
17 | 9C5E137F22EFA5C9008EAEFF /* CameraFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C5E137622EFA5C9008EAEFF /* CameraFramework.framework */; };
18 | 9C5E138622EFA5C9008EAEFF /* CameraFrameworkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C5E138522EFA5C9008EAEFF /* CameraFrameworkTests.swift */; };
19 | 9C5E138822EFA5C9008EAEFF /* CameraFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C5E137822EFA5C9008EAEFF /* CameraFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
20 | 9C5E138B22EFA5C9008EAEFF /* CameraFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C5E137622EFA5C9008EAEFF /* CameraFramework.framework */; };
21 | 9C5E138C22EFA5C9008EAEFF /* CameraFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9C5E137622EFA5C9008EAEFF /* CameraFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
22 | 9C89180822EFA33400806DE5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C89180722EFA33400806DE5 /* AppDelegate.swift */; };
23 | 9C89180A22EFA33400806DE5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C89180922EFA33400806DE5 /* ViewController.swift */; };
24 | 9C89180D22EFA33400806DE5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C89180B22EFA33400806DE5 /* Main.storyboard */; };
25 | 9C89180F22EFA33500806DE5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C89180E22EFA33500806DE5 /* Assets.xcassets */; };
26 | 9C89181222EFA33500806DE5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C89181022EFA33500806DE5 /* LaunchScreen.storyboard */; };
27 | 9C89181D22EFA33500806DE5 /* ImageProcessingSampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C89181C22EFA33500806DE5 /* ImageProcessingSampleTests.swift */; };
28 | 9C89182822EFA33500806DE5 /* ImageProcessingSampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C89182722EFA33500806DE5 /* ImageProcessingSampleUITests.swift */; };
29 | 9C9E28A822F9E6FC007D4DE0 /* VideoAccess.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C9E28A722F9E6FC007D4DE0 /* VideoAccess.swift */; };
30 | 9C9E28A922F9E9AE007D4DE0 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A78952D22F936EA0096FBCD /* RxSwift.framework */; };
31 | 9C9E28AB22F9EAA4007D4DE0 /* RxRelay.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C9E28AA22F9EAA4007D4DE0 /* RxRelay.framework */; };
32 | 9C9E28AD22FEA70F007D4DE0 /* AVCaptureDeviceBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C9E28AC22FEA70F007D4DE0 /* AVCaptureDeviceBuilder.swift */; };
33 | 9C9E28AF22FEAC37007D4DE0 /* AVCaptureVideoDataOutputBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C9E28AE22FEAC37007D4DE0 /* AVCaptureVideoDataOutputBuilder.swift */; };
34 | 9C9E28B222FEB267007D4DE0 /* VideoDataCaptureBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C9E28B122FEB267007D4DE0 /* VideoDataCaptureBuilder.swift */; };
35 | 9C9E28C122FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C9E28B822FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework */; };
36 | 9C9E28C822FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C9E28C722FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests.swift */; };
37 | 9C9E28CA22FF379F007D4DE0 /* OpneCVImageProcessingFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C9E28BA22FF379F007D4DE0 /* OpneCVImageProcessingFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
38 | 9C9E28CD22FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C9E28B822FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework */; };
39 | 9C9E28CE22FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9C9E28B822FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
40 | 9CAFC13623011D8D0010D855 /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9CAFC13523011D8D0010D855 /* opencv2.framework */; };
41 | 9CAFC13D230129E00010D855 /* OpenCVDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CAFC13B230129E00010D855 /* OpenCVDriver.h */; settings = {ATTRIBUTES = (Public, ); }; };
42 | 9CAFC13E230129E00010D855 /* OpenCVDriver.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CAFC13C230129E00010D855 /* OpenCVDriver.mm */; };
43 | 9CAFC14023012E9C0010D855 /* OpenCVImageProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CAFC13F23012E9C0010D855 /* OpenCVImageProcessor.swift */; };
44 | 9CAFC144230157260010D855 /* CircleDetectionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CAFC142230157260010D855 /* CircleDetectionResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
45 | 9CAFC145230157260010D855 /* CircleDetectionResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CAFC143230157260010D855 /* CircleDetectionResult.m */; };
46 | 9CAFC147230163F00010D855 /* Presenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CAFC146230163F00010D855 /* Presenter.swift */; };
47 | 9CAFC14B2302F8A50010D855 /* CIImage+Resize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CAFC14A2302F8A50010D855 /* CIImage+Resize.swift */; };
48 | /* End PBXBuildFile section */
49 |
50 | /* Begin PBXContainerItemProxy section */
51 | 9C5E138022EFA5C9008EAEFF /* PBXContainerItemProxy */ = {
52 | isa = PBXContainerItemProxy;
53 | containerPortal = 9C8917FC22EFA33400806DE5 /* Project object */;
54 | proxyType = 1;
55 | remoteGlobalIDString = 9C5E137522EFA5C9008EAEFF;
56 | remoteInfo = CameraFramework;
57 | };
58 | 9C5E138222EFA5C9008EAEFF /* PBXContainerItemProxy */ = {
59 | isa = PBXContainerItemProxy;
60 | containerPortal = 9C8917FC22EFA33400806DE5 /* Project object */;
61 | proxyType = 1;
62 | remoteGlobalIDString = 9C89180322EFA33400806DE5;
63 | remoteInfo = ImageProcessingSample;
64 | };
65 | 9C5E138922EFA5C9008EAEFF /* PBXContainerItemProxy */ = {
66 | isa = PBXContainerItemProxy;
67 | containerPortal = 9C8917FC22EFA33400806DE5 /* Project object */;
68 | proxyType = 1;
69 | remoteGlobalIDString = 9C5E137522EFA5C9008EAEFF;
70 | remoteInfo = CameraFramework;
71 | };
72 | 9C89181922EFA33500806DE5 /* PBXContainerItemProxy */ = {
73 | isa = PBXContainerItemProxy;
74 | containerPortal = 9C8917FC22EFA33400806DE5 /* Project object */;
75 | proxyType = 1;
76 | remoteGlobalIDString = 9C89180322EFA33400806DE5;
77 | remoteInfo = ImageProcessingSample;
78 | };
79 | 9C89182422EFA33500806DE5 /* PBXContainerItemProxy */ = {
80 | isa = PBXContainerItemProxy;
81 | containerPortal = 9C8917FC22EFA33400806DE5 /* Project object */;
82 | proxyType = 1;
83 | remoteGlobalIDString = 9C89180322EFA33400806DE5;
84 | remoteInfo = ImageProcessingSample;
85 | };
86 | 9C9E28C222FF379F007D4DE0 /* PBXContainerItemProxy */ = {
87 | isa = PBXContainerItemProxy;
88 | containerPortal = 9C8917FC22EFA33400806DE5 /* Project object */;
89 | proxyType = 1;
90 | remoteGlobalIDString = 9C9E28B722FF379F007D4DE0;
91 | remoteInfo = OpneCVImageProcessingFramework;
92 | };
93 | 9C9E28C422FF379F007D4DE0 /* PBXContainerItemProxy */ = {
94 | isa = PBXContainerItemProxy;
95 | containerPortal = 9C8917FC22EFA33400806DE5 /* Project object */;
96 | proxyType = 1;
97 | remoteGlobalIDString = 9C89180322EFA33400806DE5;
98 | remoteInfo = ImageProcessingSample;
99 | };
100 | 9C9E28CB22FF379F007D4DE0 /* PBXContainerItemProxy */ = {
101 | isa = PBXContainerItemProxy;
102 | containerPortal = 9C8917FC22EFA33400806DE5 /* Project object */;
103 | proxyType = 1;
104 | remoteGlobalIDString = 9C9E28B722FF379F007D4DE0;
105 | remoteInfo = OpneCVImageProcessingFramework;
106 | };
107 | /* End PBXContainerItemProxy section */
108 |
109 | /* Begin PBXCopyFilesBuildPhase section */
110 | 9C5E139222EFA5C9008EAEFF /* Embed Frameworks */ = {
111 | isa = PBXCopyFilesBuildPhase;
112 | buildActionMask = 2147483647;
113 | dstPath = "";
114 | dstSubfolderSpec = 10;
115 | files = (
116 | 9C5E138C22EFA5C9008EAEFF /* CameraFramework.framework in Embed Frameworks */,
117 | 9C9E28CE22FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework in Embed Frameworks */,
118 | );
119 | name = "Embed Frameworks";
120 | runOnlyForDeploymentPostprocessing = 0;
121 | };
122 | /* End PBXCopyFilesBuildPhase section */
123 |
124 | /* Begin PBXFileReference section */
125 | 4A78952822F930900096FBCD /* VideoImageCapture.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoImageCapture.swift; sourceTree = ""; };
126 | 4A78952D22F936EA0096FBCD /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/iOS/RxSwift.framework; sourceTree = ""; };
127 | 4A78952F22F936FA0096FBCD /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/iOS/RxCocoa.framework; sourceTree = ""; };
128 | 4A78953122F937090096FBCD /* RxTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxTest.framework; path = Carthage/Build/iOS/RxTest.framework; sourceTree = ""; };
129 | 4A89DD5D2316F308001BD672 /* GLVideoPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GLVideoPreview.swift; sourceTree = ""; };
130 | 4A89DD5F2316F365001BD672 /* MetalVideoPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetalVideoPreview.swift; sourceTree = ""; };
131 | 4A9F2BA0231A797E002E153B /* CIImageDrawable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CIImageDrawable.swift; sourceTree = ""; };
132 | 4AC36CE1231A8F1B0006B590 /* UIImage+Resize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Resize.swift"; sourceTree = ""; };
133 | 9C5E137622EFA5C9008EAEFF /* CameraFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CameraFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
134 | 9C5E137822EFA5C9008EAEFF /* CameraFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CameraFramework.h; sourceTree = ""; };
135 | 9C5E137922EFA5C9008EAEFF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
136 | 9C5E137E22EFA5C9008EAEFF /* CameraFrameworkTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CameraFrameworkTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
137 | 9C5E138522EFA5C9008EAEFF /* CameraFrameworkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraFrameworkTests.swift; sourceTree = ""; };
138 | 9C5E138722EFA5C9008EAEFF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
139 | 9C89180422EFA33400806DE5 /* ImageProcessingSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageProcessingSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
140 | 9C89180722EFA33400806DE5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
141 | 9C89180922EFA33400806DE5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
142 | 9C89180C22EFA33400806DE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
143 | 9C89180E22EFA33500806DE5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
144 | 9C89181122EFA33500806DE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
145 | 9C89181322EFA33500806DE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
146 | 9C89181822EFA33500806DE5 /* ImageProcessingSampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageProcessingSampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
147 | 9C89181C22EFA33500806DE5 /* ImageProcessingSampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageProcessingSampleTests.swift; sourceTree = ""; };
148 | 9C89181E22EFA33500806DE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
149 | 9C89182322EFA33500806DE5 /* ImageProcessingSampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageProcessingSampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
150 | 9C89182722EFA33500806DE5 /* ImageProcessingSampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageProcessingSampleUITests.swift; sourceTree = ""; };
151 | 9C89182922EFA33500806DE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
152 | 9C9E28A722F9E6FC007D4DE0 /* VideoAccess.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoAccess.swift; sourceTree = ""; };
153 | 9C9E28AA22F9EAA4007D4DE0 /* RxRelay.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxRelay.framework; path = Carthage/Build/iOS/RxRelay.framework; sourceTree = ""; };
154 | 9C9E28AC22FEA70F007D4DE0 /* AVCaptureDeviceBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AVCaptureDeviceBuilder.swift; sourceTree = ""; };
155 | 9C9E28AE22FEAC37007D4DE0 /* AVCaptureVideoDataOutputBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AVCaptureVideoDataOutputBuilder.swift; sourceTree = ""; };
156 | 9C9E28B122FEB267007D4DE0 /* VideoDataCaptureBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoDataCaptureBuilder.swift; sourceTree = ""; };
157 | 9C9E28B822FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpneCVImageProcessingFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
158 | 9C9E28BA22FF379F007D4DE0 /* OpneCVImageProcessingFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpneCVImageProcessingFramework.h; sourceTree = ""; };
159 | 9C9E28BB22FF379F007D4DE0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
160 | 9C9E28C022FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OpneCVImageProcessingFrameworkTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
161 | 9C9E28C722FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpneCVImageProcessingFrameworkTests.swift; sourceTree = ""; };
162 | 9C9E28C922FF379F007D4DE0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
163 | 9CAFC13523011D8D0010D855 /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = opencv2.framework; path = OpenCV/opencv2.framework; sourceTree = ""; };
164 | 9CAFC13B230129E00010D855 /* OpenCVDriver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenCVDriver.h; sourceTree = ""; };
165 | 9CAFC13C230129E00010D855 /* OpenCVDriver.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = OpenCVDriver.mm; sourceTree = ""; };
166 | 9CAFC13F23012E9C0010D855 /* OpenCVImageProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenCVImageProcessor.swift; sourceTree = ""; };
167 | 9CAFC142230157260010D855 /* CircleDetectionResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CircleDetectionResult.h; sourceTree = ""; };
168 | 9CAFC143230157260010D855 /* CircleDetectionResult.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CircleDetectionResult.m; sourceTree = ""; };
169 | 9CAFC146230163F00010D855 /* Presenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Presenter.swift; sourceTree = ""; };
170 | 9CAFC14A2302F8A50010D855 /* CIImage+Resize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CIImage+Resize.swift"; sourceTree = ""; };
171 | /* End PBXFileReference section */
172 |
173 | /* Begin PBXFrameworksBuildPhase section */
174 | 9C5E137322EFA5C9008EAEFF /* Frameworks */ = {
175 | isa = PBXFrameworksBuildPhase;
176 | buildActionMask = 2147483647;
177 | files = (
178 | 9C9E28A922F9E9AE007D4DE0 /* RxSwift.framework in Frameworks */,
179 | );
180 | runOnlyForDeploymentPostprocessing = 0;
181 | };
182 | 9C5E137B22EFA5C9008EAEFF /* Frameworks */ = {
183 | isa = PBXFrameworksBuildPhase;
184 | buildActionMask = 2147483647;
185 | files = (
186 | 9C5E137F22EFA5C9008EAEFF /* CameraFramework.framework in Frameworks */,
187 | );
188 | runOnlyForDeploymentPostprocessing = 0;
189 | };
190 | 9C89180122EFA33400806DE5 /* Frameworks */ = {
191 | isa = PBXFrameworksBuildPhase;
192 | buildActionMask = 2147483647;
193 | files = (
194 | 9C9E28AB22F9EAA4007D4DE0 /* RxRelay.framework in Frameworks */,
195 | 4A78953022F936FA0096FBCD /* RxCocoa.framework in Frameworks */,
196 | 4A78952E22F936EA0096FBCD /* RxSwift.framework in Frameworks */,
197 | 9C9E28CD22FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework in Frameworks */,
198 | 9C5E138B22EFA5C9008EAEFF /* CameraFramework.framework in Frameworks */,
199 | );
200 | runOnlyForDeploymentPostprocessing = 0;
201 | };
202 | 9C89181522EFA33500806DE5 /* Frameworks */ = {
203 | isa = PBXFrameworksBuildPhase;
204 | buildActionMask = 2147483647;
205 | files = (
206 | );
207 | runOnlyForDeploymentPostprocessing = 0;
208 | };
209 | 9C89182022EFA33500806DE5 /* Frameworks */ = {
210 | isa = PBXFrameworksBuildPhase;
211 | buildActionMask = 2147483647;
212 | files = (
213 | );
214 | runOnlyForDeploymentPostprocessing = 0;
215 | };
216 | 9C9E28B522FF379F007D4DE0 /* Frameworks */ = {
217 | isa = PBXFrameworksBuildPhase;
218 | buildActionMask = 2147483647;
219 | files = (
220 | 9CAFC13623011D8D0010D855 /* opencv2.framework in Frameworks */,
221 | );
222 | runOnlyForDeploymentPostprocessing = 0;
223 | };
224 | 9C9E28BD22FF379F007D4DE0 /* Frameworks */ = {
225 | isa = PBXFrameworksBuildPhase;
226 | buildActionMask = 2147483647;
227 | files = (
228 | 9C9E28C122FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework in Frameworks */,
229 | );
230 | runOnlyForDeploymentPostprocessing = 0;
231 | };
232 | /* End PBXFrameworksBuildPhase section */
233 |
234 | /* Begin PBXGroup section */
235 | 4A78952722F9307A0096FBCD /* Sources */ = {
236 | isa = PBXGroup;
237 | children = (
238 | 9C5E137822EFA5C9008EAEFF /* CameraFramework.h */,
239 | 9C9E28AC22FEA70F007D4DE0 /* AVCaptureDeviceBuilder.swift */,
240 | 9C9E28AE22FEAC37007D4DE0 /* AVCaptureVideoDataOutputBuilder.swift */,
241 | 9C9E28A722F9E6FC007D4DE0 /* VideoAccess.swift */,
242 | 9C9E28B122FEB267007D4DE0 /* VideoDataCaptureBuilder.swift */,
243 | 4A78952822F930900096FBCD /* VideoImageCapture.swift */,
244 | );
245 | path = Sources;
246 | sourceTree = "";
247 | };
248 | 4A78952C22F936EA0096FBCD /* Frameworks */ = {
249 | isa = PBXGroup;
250 | children = (
251 | 9CAFC13523011D8D0010D855 /* opencv2.framework */,
252 | 9C9E28AA22F9EAA4007D4DE0 /* RxRelay.framework */,
253 | 4A78953122F937090096FBCD /* RxTest.framework */,
254 | 4A78952F22F936FA0096FBCD /* RxCocoa.framework */,
255 | 4A78952D22F936EA0096FBCD /* RxSwift.framework */,
256 | );
257 | name = Frameworks;
258 | sourceTree = "";
259 | };
260 | 4A7F94BD22FCED6300612877 /* Sources */ = {
261 | isa = PBXGroup;
262 | children = (
263 | 9C89180722EFA33400806DE5 /* AppDelegate.swift */,
264 | 4A9F2BA0231A797E002E153B /* CIImageDrawable.swift */,
265 | 4A89DD5D2316F308001BD672 /* GLVideoPreview.swift */,
266 | 4A89DD5F2316F365001BD672 /* MetalVideoPreview.swift */,
267 | 9CAFC146230163F00010D855 /* Presenter.swift */,
268 | 9C89180922EFA33400806DE5 /* ViewController.swift */,
269 | 4AC36CE3231ABDC50006B590 /* Utilities */,
270 | );
271 | path = Sources;
272 | sourceTree = "";
273 | };
274 | 4A7F94BE22FCED7800612877 /* Storyboards */ = {
275 | isa = PBXGroup;
276 | children = (
277 | 9C89180B22EFA33400806DE5 /* Main.storyboard */,
278 | 9C89181022EFA33500806DE5 /* LaunchScreen.storyboard */,
279 | );
280 | path = Storyboards;
281 | sourceTree = "";
282 | };
283 | 4AC36CE3231ABDC50006B590 /* Utilities */ = {
284 | isa = PBXGroup;
285 | children = (
286 | 9CAFC14A2302F8A50010D855 /* CIImage+Resize.swift */,
287 | 4AC36CE1231A8F1B0006B590 /* UIImage+Resize.swift */,
288 | );
289 | path = Utilities;
290 | sourceTree = "";
291 | };
292 | 9C5E137722EFA5C9008EAEFF /* CameraFramework */ = {
293 | isa = PBXGroup;
294 | children = (
295 | 4A78952722F9307A0096FBCD /* Sources */,
296 | 9C5E137922EFA5C9008EAEFF /* Info.plist */,
297 | );
298 | path = CameraFramework;
299 | sourceTree = "";
300 | };
301 | 9C5E138422EFA5C9008EAEFF /* CameraFrameworkTests */ = {
302 | isa = PBXGroup;
303 | children = (
304 | 9C5E138522EFA5C9008EAEFF /* CameraFrameworkTests.swift */,
305 | 9C5E138722EFA5C9008EAEFF /* Info.plist */,
306 | );
307 | path = CameraFrameworkTests;
308 | sourceTree = "";
309 | };
310 | 9C8917FB22EFA33400806DE5 = {
311 | isa = PBXGroup;
312 | children = (
313 | 9C89180622EFA33400806DE5 /* ImageProcessingSample */,
314 | 9C89181B22EFA33500806DE5 /* ImageProcessingSampleTests */,
315 | 9C89182622EFA33500806DE5 /* ImageProcessingSampleUITests */,
316 | 9C5E137722EFA5C9008EAEFF /* CameraFramework */,
317 | 9C5E138422EFA5C9008EAEFF /* CameraFrameworkTests */,
318 | 9C9E28B922FF379F007D4DE0 /* OpneCVImageProcessingFramework */,
319 | 9C9E28C622FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests */,
320 | 9C89180522EFA33400806DE5 /* Products */,
321 | 4A78952C22F936EA0096FBCD /* Frameworks */,
322 | );
323 | sourceTree = "";
324 | };
325 | 9C89180522EFA33400806DE5 /* Products */ = {
326 | isa = PBXGroup;
327 | children = (
328 | 9C89180422EFA33400806DE5 /* ImageProcessingSample.app */,
329 | 9C89181822EFA33500806DE5 /* ImageProcessingSampleTests.xctest */,
330 | 9C89182322EFA33500806DE5 /* ImageProcessingSampleUITests.xctest */,
331 | 9C5E137622EFA5C9008EAEFF /* CameraFramework.framework */,
332 | 9C5E137E22EFA5C9008EAEFF /* CameraFrameworkTests.xctest */,
333 | 9C9E28B822FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework */,
334 | 9C9E28C022FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests.xctest */,
335 | );
336 | name = Products;
337 | sourceTree = "";
338 | };
339 | 9C89180622EFA33400806DE5 /* ImageProcessingSample */ = {
340 | isa = PBXGroup;
341 | children = (
342 | 4A7F94BD22FCED6300612877 /* Sources */,
343 | 4A7F94BE22FCED7800612877 /* Storyboards */,
344 | 9C89180E22EFA33500806DE5 /* Assets.xcassets */,
345 | 9C89181322EFA33500806DE5 /* Info.plist */,
346 | );
347 | path = ImageProcessingSample;
348 | sourceTree = "";
349 | };
350 | 9C89181B22EFA33500806DE5 /* ImageProcessingSampleTests */ = {
351 | isa = PBXGroup;
352 | children = (
353 | 9C89181C22EFA33500806DE5 /* ImageProcessingSampleTests.swift */,
354 | 9C89181E22EFA33500806DE5 /* Info.plist */,
355 | );
356 | path = ImageProcessingSampleTests;
357 | sourceTree = "";
358 | };
359 | 9C89182622EFA33500806DE5 /* ImageProcessingSampleUITests */ = {
360 | isa = PBXGroup;
361 | children = (
362 | 9C89182722EFA33500806DE5 /* ImageProcessingSampleUITests.swift */,
363 | 9C89182922EFA33500806DE5 /* Info.plist */,
364 | );
365 | path = ImageProcessingSampleUITests;
366 | sourceTree = "";
367 | };
368 | 9C9E28B922FF379F007D4DE0 /* OpneCVImageProcessingFramework */ = {
369 | isa = PBXGroup;
370 | children = (
371 | 9C9E28D522FF37AB007D4DE0 /* Sources */,
372 | 9C9E28BB22FF379F007D4DE0 /* Info.plist */,
373 | );
374 | path = OpneCVImageProcessingFramework;
375 | sourceTree = "";
376 | };
377 | 9C9E28C622FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests */ = {
378 | isa = PBXGroup;
379 | children = (
380 | 9C9E28C722FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests.swift */,
381 | 9C9E28C922FF379F007D4DE0 /* Info.plist */,
382 | );
383 | path = OpneCVImageProcessingFrameworkTests;
384 | sourceTree = "";
385 | };
386 | 9C9E28D522FF37AB007D4DE0 /* Sources */ = {
387 | isa = PBXGroup;
388 | children = (
389 | 9C9E28BA22FF379F007D4DE0 /* OpneCVImageProcessingFramework.h */,
390 | 9CAFC13F23012E9C0010D855 /* OpenCVImageProcessor.swift */,
391 | 9CAFC14123014F460010D855 /* Driver */,
392 | );
393 | path = Sources;
394 | sourceTree = "";
395 | };
396 | 9CAFC14123014F460010D855 /* Driver */ = {
397 | isa = PBXGroup;
398 | children = (
399 | 9CAFC13B230129E00010D855 /* OpenCVDriver.h */,
400 | 9CAFC13C230129E00010D855 /* OpenCVDriver.mm */,
401 | 9CAFC142230157260010D855 /* CircleDetectionResult.h */,
402 | 9CAFC143230157260010D855 /* CircleDetectionResult.m */,
403 | );
404 | path = Driver;
405 | sourceTree = "";
406 | };
407 | /* End PBXGroup section */
408 |
409 | /* Begin PBXHeadersBuildPhase section */
410 | 9C5E137122EFA5C9008EAEFF /* Headers */ = {
411 | isa = PBXHeadersBuildPhase;
412 | buildActionMask = 2147483647;
413 | files = (
414 | 9C5E138822EFA5C9008EAEFF /* CameraFramework.h in Headers */,
415 | );
416 | runOnlyForDeploymentPostprocessing = 0;
417 | };
418 | 9C9E28B322FF379F007D4DE0 /* Headers */ = {
419 | isa = PBXHeadersBuildPhase;
420 | buildActionMask = 2147483647;
421 | files = (
422 | 9C9E28CA22FF379F007D4DE0 /* OpneCVImageProcessingFramework.h in Headers */,
423 | 9CAFC13D230129E00010D855 /* OpenCVDriver.h in Headers */,
424 | 9CAFC144230157260010D855 /* CircleDetectionResult.h in Headers */,
425 | );
426 | runOnlyForDeploymentPostprocessing = 0;
427 | };
428 | /* End PBXHeadersBuildPhase section */
429 |
430 | /* Begin PBXNativeTarget section */
431 | 9C5E137522EFA5C9008EAEFF /* CameraFramework */ = {
432 | isa = PBXNativeTarget;
433 | buildConfigurationList = 9C5E139122EFA5C9008EAEFF /* Build configuration list for PBXNativeTarget "CameraFramework" */;
434 | buildPhases = (
435 | 9C5E137122EFA5C9008EAEFF /* Headers */,
436 | 9C5E137222EFA5C9008EAEFF /* Sources */,
437 | 9C5E137322EFA5C9008EAEFF /* Frameworks */,
438 | 9C5E137422EFA5C9008EAEFF /* Resources */,
439 | 4A78952A22F936770096FBCD /* ShellScript */,
440 | );
441 | buildRules = (
442 | );
443 | dependencies = (
444 | );
445 | name = CameraFramework;
446 | productName = CameraFramework;
447 | productReference = 9C5E137622EFA5C9008EAEFF /* CameraFramework.framework */;
448 | productType = "com.apple.product-type.framework";
449 | };
450 | 9C5E137D22EFA5C9008EAEFF /* CameraFrameworkTests */ = {
451 | isa = PBXNativeTarget;
452 | buildConfigurationList = 9C5E139322EFA5C9008EAEFF /* Build configuration list for PBXNativeTarget "CameraFrameworkTests" */;
453 | buildPhases = (
454 | 9C5E137A22EFA5C9008EAEFF /* Sources */,
455 | 9C5E137B22EFA5C9008EAEFF /* Frameworks */,
456 | 9C5E137C22EFA5C9008EAEFF /* Resources */,
457 | );
458 | buildRules = (
459 | );
460 | dependencies = (
461 | 9C5E138122EFA5C9008EAEFF /* PBXTargetDependency */,
462 | 9C5E138322EFA5C9008EAEFF /* PBXTargetDependency */,
463 | );
464 | name = CameraFrameworkTests;
465 | productName = CameraFrameworkTests;
466 | productReference = 9C5E137E22EFA5C9008EAEFF /* CameraFrameworkTests.xctest */;
467 | productType = "com.apple.product-type.bundle.unit-test";
468 | };
469 | 9C89180322EFA33400806DE5 /* ImageProcessingSample */ = {
470 | isa = PBXNativeTarget;
471 | buildConfigurationList = 9C89182C22EFA33500806DE5 /* Build configuration list for PBXNativeTarget "ImageProcessingSample" */;
472 | buildPhases = (
473 | 9C89180022EFA33400806DE5 /* Sources */,
474 | 9C89180122EFA33400806DE5 /* Frameworks */,
475 | 9C89180222EFA33400806DE5 /* Resources */,
476 | 9C5E139222EFA5C9008EAEFF /* Embed Frameworks */,
477 | 4A78952B22F936920096FBCD /* ShellScript */,
478 | );
479 | buildRules = (
480 | );
481 | dependencies = (
482 | 9C5E138A22EFA5C9008EAEFF /* PBXTargetDependency */,
483 | 9C9E28CC22FF379F007D4DE0 /* PBXTargetDependency */,
484 | );
485 | name = ImageProcessingSample;
486 | productName = ImageProcessingSample;
487 | productReference = 9C89180422EFA33400806DE5 /* ImageProcessingSample.app */;
488 | productType = "com.apple.product-type.application";
489 | };
490 | 9C89181722EFA33500806DE5 /* ImageProcessingSampleTests */ = {
491 | isa = PBXNativeTarget;
492 | buildConfigurationList = 9C89182F22EFA33500806DE5 /* Build configuration list for PBXNativeTarget "ImageProcessingSampleTests" */;
493 | buildPhases = (
494 | 9C89181422EFA33500806DE5 /* Sources */,
495 | 9C89181522EFA33500806DE5 /* Frameworks */,
496 | 9C89181622EFA33500806DE5 /* Resources */,
497 | );
498 | buildRules = (
499 | );
500 | dependencies = (
501 | 9C89181A22EFA33500806DE5 /* PBXTargetDependency */,
502 | );
503 | name = ImageProcessingSampleTests;
504 | productName = ImageProcessingSampleTests;
505 | productReference = 9C89181822EFA33500806DE5 /* ImageProcessingSampleTests.xctest */;
506 | productType = "com.apple.product-type.bundle.unit-test";
507 | };
508 | 9C89182222EFA33500806DE5 /* ImageProcessingSampleUITests */ = {
509 | isa = PBXNativeTarget;
510 | buildConfigurationList = 9C89183222EFA33500806DE5 /* Build configuration list for PBXNativeTarget "ImageProcessingSampleUITests" */;
511 | buildPhases = (
512 | 9C89181F22EFA33500806DE5 /* Sources */,
513 | 9C89182022EFA33500806DE5 /* Frameworks */,
514 | 9C89182122EFA33500806DE5 /* Resources */,
515 | );
516 | buildRules = (
517 | );
518 | dependencies = (
519 | 9C89182522EFA33500806DE5 /* PBXTargetDependency */,
520 | );
521 | name = ImageProcessingSampleUITests;
522 | productName = ImageProcessingSampleUITests;
523 | productReference = 9C89182322EFA33500806DE5 /* ImageProcessingSampleUITests.xctest */;
524 | productType = "com.apple.product-type.bundle.ui-testing";
525 | };
526 | 9C9E28B722FF379F007D4DE0 /* OpneCVImageProcessingFramework */ = {
527 | isa = PBXNativeTarget;
528 | buildConfigurationList = 9C9E28CF22FF379F007D4DE0 /* Build configuration list for PBXNativeTarget "OpneCVImageProcessingFramework" */;
529 | buildPhases = (
530 | 9C9E28B322FF379F007D4DE0 /* Headers */,
531 | 9C9E28B422FF379F007D4DE0 /* Sources */,
532 | 9C9E28B522FF379F007D4DE0 /* Frameworks */,
533 | 9C9E28B622FF379F007D4DE0 /* Resources */,
534 | );
535 | buildRules = (
536 | );
537 | dependencies = (
538 | );
539 | name = OpneCVImageProcessingFramework;
540 | productName = OpneCVImageProcessingFramework;
541 | productReference = 9C9E28B822FF379F007D4DE0 /* OpneCVImageProcessingFramework.framework */;
542 | productType = "com.apple.product-type.framework";
543 | };
544 | 9C9E28BF22FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests */ = {
545 | isa = PBXNativeTarget;
546 | buildConfigurationList = 9C9E28D222FF379F007D4DE0 /* Build configuration list for PBXNativeTarget "OpneCVImageProcessingFrameworkTests" */;
547 | buildPhases = (
548 | 9C9E28BC22FF379F007D4DE0 /* Sources */,
549 | 9C9E28BD22FF379F007D4DE0 /* Frameworks */,
550 | 9C9E28BE22FF379F007D4DE0 /* Resources */,
551 | );
552 | buildRules = (
553 | );
554 | dependencies = (
555 | 9C9E28C322FF379F007D4DE0 /* PBXTargetDependency */,
556 | 9C9E28C522FF379F007D4DE0 /* PBXTargetDependency */,
557 | );
558 | name = OpneCVImageProcessingFrameworkTests;
559 | productName = OpneCVImageProcessingFrameworkTests;
560 | productReference = 9C9E28C022FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests.xctest */;
561 | productType = "com.apple.product-type.bundle.unit-test";
562 | };
563 | /* End PBXNativeTarget section */
564 |
565 | /* Begin PBXProject section */
566 | 9C8917FC22EFA33400806DE5 /* Project object */ = {
567 | isa = PBXProject;
568 | attributes = {
569 | LastSwiftUpdateCheck = 1030;
570 | LastUpgradeCheck = 1020;
571 | ORGANIZATIONNAME = kotetu;
572 | TargetAttributes = {
573 | 9C5E137522EFA5C9008EAEFF = {
574 | CreatedOnToolsVersion = 10.2.1;
575 | LastSwiftMigration = 1020;
576 | };
577 | 9C5E137D22EFA5C9008EAEFF = {
578 | CreatedOnToolsVersion = 10.2.1;
579 | TestTargetID = 9C89180322EFA33400806DE5;
580 | };
581 | 9C89180322EFA33400806DE5 = {
582 | CreatedOnToolsVersion = 10.2.1;
583 | };
584 | 9C89181722EFA33500806DE5 = {
585 | CreatedOnToolsVersion = 10.2.1;
586 | TestTargetID = 9C89180322EFA33400806DE5;
587 | };
588 | 9C89182222EFA33500806DE5 = {
589 | CreatedOnToolsVersion = 10.2.1;
590 | TestTargetID = 9C89180322EFA33400806DE5;
591 | };
592 | 9C9E28B722FF379F007D4DE0 = {
593 | CreatedOnToolsVersion = 10.3;
594 | LastSwiftMigration = 1030;
595 | };
596 | 9C9E28BF22FF379F007D4DE0 = {
597 | CreatedOnToolsVersion = 10.3;
598 | TestTargetID = 9C89180322EFA33400806DE5;
599 | };
600 | };
601 | };
602 | buildConfigurationList = 9C8917FF22EFA33400806DE5 /* Build configuration list for PBXProject "ImageProcessingSample" */;
603 | compatibilityVersion = "Xcode 9.3";
604 | developmentRegion = en;
605 | hasScannedForEncodings = 0;
606 | knownRegions = (
607 | en,
608 | Base,
609 | );
610 | mainGroup = 9C8917FB22EFA33400806DE5;
611 | productRefGroup = 9C89180522EFA33400806DE5 /* Products */;
612 | projectDirPath = "";
613 | projectRoot = "";
614 | targets = (
615 | 9C89180322EFA33400806DE5 /* ImageProcessingSample */,
616 | 9C89181722EFA33500806DE5 /* ImageProcessingSampleTests */,
617 | 9C89182222EFA33500806DE5 /* ImageProcessingSampleUITests */,
618 | 9C5E137522EFA5C9008EAEFF /* CameraFramework */,
619 | 9C5E137D22EFA5C9008EAEFF /* CameraFrameworkTests */,
620 | 9C9E28B722FF379F007D4DE0 /* OpneCVImageProcessingFramework */,
621 | 9C9E28BF22FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests */,
622 | );
623 | };
624 | /* End PBXProject section */
625 |
626 | /* Begin PBXResourcesBuildPhase section */
627 | 9C5E137422EFA5C9008EAEFF /* Resources */ = {
628 | isa = PBXResourcesBuildPhase;
629 | buildActionMask = 2147483647;
630 | files = (
631 | );
632 | runOnlyForDeploymentPostprocessing = 0;
633 | };
634 | 9C5E137C22EFA5C9008EAEFF /* Resources */ = {
635 | isa = PBXResourcesBuildPhase;
636 | buildActionMask = 2147483647;
637 | files = (
638 | );
639 | runOnlyForDeploymentPostprocessing = 0;
640 | };
641 | 9C89180222EFA33400806DE5 /* Resources */ = {
642 | isa = PBXResourcesBuildPhase;
643 | buildActionMask = 2147483647;
644 | files = (
645 | 9C89181222EFA33500806DE5 /* LaunchScreen.storyboard in Resources */,
646 | 9C89180F22EFA33500806DE5 /* Assets.xcassets in Resources */,
647 | 9C89180D22EFA33400806DE5 /* Main.storyboard in Resources */,
648 | );
649 | runOnlyForDeploymentPostprocessing = 0;
650 | };
651 | 9C89181622EFA33500806DE5 /* Resources */ = {
652 | isa = PBXResourcesBuildPhase;
653 | buildActionMask = 2147483647;
654 | files = (
655 | );
656 | runOnlyForDeploymentPostprocessing = 0;
657 | };
658 | 9C89182122EFA33500806DE5 /* Resources */ = {
659 | isa = PBXResourcesBuildPhase;
660 | buildActionMask = 2147483647;
661 | files = (
662 | );
663 | runOnlyForDeploymentPostprocessing = 0;
664 | };
665 | 9C9E28B622FF379F007D4DE0 /* Resources */ = {
666 | isa = PBXResourcesBuildPhase;
667 | buildActionMask = 2147483647;
668 | files = (
669 | );
670 | runOnlyForDeploymentPostprocessing = 0;
671 | };
672 | 9C9E28BE22FF379F007D4DE0 /* Resources */ = {
673 | isa = PBXResourcesBuildPhase;
674 | buildActionMask = 2147483647;
675 | files = (
676 | );
677 | runOnlyForDeploymentPostprocessing = 0;
678 | };
679 | /* End PBXResourcesBuildPhase section */
680 |
681 | /* Begin PBXShellScriptBuildPhase section */
682 | 4A78952A22F936770096FBCD /* ShellScript */ = {
683 | isa = PBXShellScriptBuildPhase;
684 | buildActionMask = 2147483647;
685 | files = (
686 | );
687 | inputFileListPaths = (
688 | );
689 | inputPaths = (
690 | "$(SRCROOT)/Carthage/Build/iOS/RxSwift.framework",
691 | );
692 | outputFileListPaths = (
693 | );
694 | outputPaths = (
695 | );
696 | runOnlyForDeploymentPostprocessing = 0;
697 | shellPath = /bin/sh;
698 | shellScript = "/usr/local/bin/carthage copy-frameworks\n";
699 | };
700 | 4A78952B22F936920096FBCD /* ShellScript */ = {
701 | isa = PBXShellScriptBuildPhase;
702 | buildActionMask = 2147483647;
703 | files = (
704 | );
705 | inputFileListPaths = (
706 | );
707 | inputPaths = (
708 | "$(SRCROOT)/Carthage/Build/iOS/RxSwift.framework",
709 | "$(SRCROOT)/Carthage/Build/iOS/RxCocoa.framework",
710 | "$(SRCROOT)/Carthage/Build/iOS/RxRelay.framework",
711 | );
712 | outputFileListPaths = (
713 | );
714 | outputPaths = (
715 | );
716 | runOnlyForDeploymentPostprocessing = 0;
717 | shellPath = /bin/sh;
718 | shellScript = "/usr/local/bin/carthage copy-frameworks\n";
719 | };
720 | /* End PBXShellScriptBuildPhase section */
721 |
722 | /* Begin PBXSourcesBuildPhase section */
723 | 9C5E137222EFA5C9008EAEFF /* Sources */ = {
724 | isa = PBXSourcesBuildPhase;
725 | buildActionMask = 2147483647;
726 | files = (
727 | 9C9E28AF22FEAC37007D4DE0 /* AVCaptureVideoDataOutputBuilder.swift in Sources */,
728 | 4A78952922F930900096FBCD /* VideoImageCapture.swift in Sources */,
729 | 9C9E28AD22FEA70F007D4DE0 /* AVCaptureDeviceBuilder.swift in Sources */,
730 | 9C9E28A822F9E6FC007D4DE0 /* VideoAccess.swift in Sources */,
731 | 9C9E28B222FEB267007D4DE0 /* VideoDataCaptureBuilder.swift in Sources */,
732 | );
733 | runOnlyForDeploymentPostprocessing = 0;
734 | };
735 | 9C5E137A22EFA5C9008EAEFF /* Sources */ = {
736 | isa = PBXSourcesBuildPhase;
737 | buildActionMask = 2147483647;
738 | files = (
739 | 9C5E138622EFA5C9008EAEFF /* CameraFrameworkTests.swift in Sources */,
740 | );
741 | runOnlyForDeploymentPostprocessing = 0;
742 | };
743 | 9C89180022EFA33400806DE5 /* Sources */ = {
744 | isa = PBXSourcesBuildPhase;
745 | buildActionMask = 2147483647;
746 | files = (
747 | 4A89DD602316F365001BD672 /* MetalVideoPreview.swift in Sources */,
748 | 9CAFC147230163F00010D855 /* Presenter.swift in Sources */,
749 | 9C89180A22EFA33400806DE5 /* ViewController.swift in Sources */,
750 | 4A9F2BA1231A797E002E153B /* CIImageDrawable.swift in Sources */,
751 | 4A89DD5E2316F308001BD672 /* GLVideoPreview.swift in Sources */,
752 | 4AC36CE2231A8F1B0006B590 /* UIImage+Resize.swift in Sources */,
753 | 9CAFC14B2302F8A50010D855 /* CIImage+Resize.swift in Sources */,
754 | 9C89180822EFA33400806DE5 /* AppDelegate.swift in Sources */,
755 | );
756 | runOnlyForDeploymentPostprocessing = 0;
757 | };
758 | 9C89181422EFA33500806DE5 /* Sources */ = {
759 | isa = PBXSourcesBuildPhase;
760 | buildActionMask = 2147483647;
761 | files = (
762 | 9C89181D22EFA33500806DE5 /* ImageProcessingSampleTests.swift in Sources */,
763 | );
764 | runOnlyForDeploymentPostprocessing = 0;
765 | };
766 | 9C89181F22EFA33500806DE5 /* Sources */ = {
767 | isa = PBXSourcesBuildPhase;
768 | buildActionMask = 2147483647;
769 | files = (
770 | 9C89182822EFA33500806DE5 /* ImageProcessingSampleUITests.swift in Sources */,
771 | );
772 | runOnlyForDeploymentPostprocessing = 0;
773 | };
774 | 9C9E28B422FF379F007D4DE0 /* Sources */ = {
775 | isa = PBXSourcesBuildPhase;
776 | buildActionMask = 2147483647;
777 | files = (
778 | 9CAFC14023012E9C0010D855 /* OpenCVImageProcessor.swift in Sources */,
779 | 9CAFC13E230129E00010D855 /* OpenCVDriver.mm in Sources */,
780 | 9CAFC145230157260010D855 /* CircleDetectionResult.m in Sources */,
781 | );
782 | runOnlyForDeploymentPostprocessing = 0;
783 | };
784 | 9C9E28BC22FF379F007D4DE0 /* Sources */ = {
785 | isa = PBXSourcesBuildPhase;
786 | buildActionMask = 2147483647;
787 | files = (
788 | 9C9E28C822FF379F007D4DE0 /* OpneCVImageProcessingFrameworkTests.swift in Sources */,
789 | );
790 | runOnlyForDeploymentPostprocessing = 0;
791 | };
792 | /* End PBXSourcesBuildPhase section */
793 |
794 | /* Begin PBXTargetDependency section */
795 | 9C5E138122EFA5C9008EAEFF /* PBXTargetDependency */ = {
796 | isa = PBXTargetDependency;
797 | target = 9C5E137522EFA5C9008EAEFF /* CameraFramework */;
798 | targetProxy = 9C5E138022EFA5C9008EAEFF /* PBXContainerItemProxy */;
799 | };
800 | 9C5E138322EFA5C9008EAEFF /* PBXTargetDependency */ = {
801 | isa = PBXTargetDependency;
802 | target = 9C89180322EFA33400806DE5 /* ImageProcessingSample */;
803 | targetProxy = 9C5E138222EFA5C9008EAEFF /* PBXContainerItemProxy */;
804 | };
805 | 9C5E138A22EFA5C9008EAEFF /* PBXTargetDependency */ = {
806 | isa = PBXTargetDependency;
807 | target = 9C5E137522EFA5C9008EAEFF /* CameraFramework */;
808 | targetProxy = 9C5E138922EFA5C9008EAEFF /* PBXContainerItemProxy */;
809 | };
810 | 9C89181A22EFA33500806DE5 /* PBXTargetDependency */ = {
811 | isa = PBXTargetDependency;
812 | target = 9C89180322EFA33400806DE5 /* ImageProcessingSample */;
813 | targetProxy = 9C89181922EFA33500806DE5 /* PBXContainerItemProxy */;
814 | };
815 | 9C89182522EFA33500806DE5 /* PBXTargetDependency */ = {
816 | isa = PBXTargetDependency;
817 | target = 9C89180322EFA33400806DE5 /* ImageProcessingSample */;
818 | targetProxy = 9C89182422EFA33500806DE5 /* PBXContainerItemProxy */;
819 | };
820 | 9C9E28C322FF379F007D4DE0 /* PBXTargetDependency */ = {
821 | isa = PBXTargetDependency;
822 | target = 9C9E28B722FF379F007D4DE0 /* OpneCVImageProcessingFramework */;
823 | targetProxy = 9C9E28C222FF379F007D4DE0 /* PBXContainerItemProxy */;
824 | };
825 | 9C9E28C522FF379F007D4DE0 /* PBXTargetDependency */ = {
826 | isa = PBXTargetDependency;
827 | target = 9C89180322EFA33400806DE5 /* ImageProcessingSample */;
828 | targetProxy = 9C9E28C422FF379F007D4DE0 /* PBXContainerItemProxy */;
829 | };
830 | 9C9E28CC22FF379F007D4DE0 /* PBXTargetDependency */ = {
831 | isa = PBXTargetDependency;
832 | target = 9C9E28B722FF379F007D4DE0 /* OpneCVImageProcessingFramework */;
833 | targetProxy = 9C9E28CB22FF379F007D4DE0 /* PBXContainerItemProxy */;
834 | };
835 | /* End PBXTargetDependency section */
836 |
837 | /* Begin PBXVariantGroup section */
838 | 9C89180B22EFA33400806DE5 /* Main.storyboard */ = {
839 | isa = PBXVariantGroup;
840 | children = (
841 | 9C89180C22EFA33400806DE5 /* Base */,
842 | );
843 | name = Main.storyboard;
844 | sourceTree = "";
845 | };
846 | 9C89181022EFA33500806DE5 /* LaunchScreen.storyboard */ = {
847 | isa = PBXVariantGroup;
848 | children = (
849 | 9C89181122EFA33500806DE5 /* Base */,
850 | );
851 | name = LaunchScreen.storyboard;
852 | sourceTree = "";
853 | };
854 | /* End PBXVariantGroup section */
855 |
856 | /* Begin XCBuildConfiguration section */
857 | 9C5E138D22EFA5C9008EAEFF /* Debug */ = {
858 | isa = XCBuildConfiguration;
859 | buildSettings = {
860 | CLANG_ENABLE_MODULES = YES;
861 | CODE_SIGN_IDENTITY = "iPhone Developer";
862 | CODE_SIGN_STYLE = Manual;
863 | CURRENT_PROJECT_VERSION = 1;
864 | DEFINES_MODULE = YES;
865 | DEVELOPMENT_TEAM = TXFV3DH636;
866 | DYLIB_COMPATIBILITY_VERSION = 1;
867 | DYLIB_CURRENT_VERSION = 1;
868 | DYLIB_INSTALL_NAME_BASE = "@rpath";
869 | FRAMEWORK_SEARCH_PATHS = (
870 | "$(inherited)",
871 | "$(PROJECT_DIR)/Carthage/Build/iOS",
872 | );
873 | INFOPLIST_FILE = CameraFramework/Info.plist;
874 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
875 | LD_RUNPATH_SEARCH_PATHS = (
876 | "$(inherited)",
877 | "@executable_path/Frameworks",
878 | "@loader_path/Frameworks",
879 | );
880 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.CameraFramework";
881 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
882 | PROVISIONING_PROFILE_SPECIFIER = "";
883 | SKIP_INSTALL = YES;
884 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
885 | SWIFT_VERSION = 5.0;
886 | TARGETED_DEVICE_FAMILY = "1,2";
887 | VERSIONING_SYSTEM = "apple-generic";
888 | VERSION_INFO_PREFIX = "";
889 | };
890 | name = Debug;
891 | };
892 | 9C5E138E22EFA5C9008EAEFF /* Release */ = {
893 | isa = XCBuildConfiguration;
894 | buildSettings = {
895 | CLANG_ENABLE_MODULES = YES;
896 | CODE_SIGN_IDENTITY = "";
897 | CODE_SIGN_STYLE = Manual;
898 | CURRENT_PROJECT_VERSION = 1;
899 | DEFINES_MODULE = YES;
900 | DEVELOPMENT_TEAM = "";
901 | DYLIB_COMPATIBILITY_VERSION = 1;
902 | DYLIB_CURRENT_VERSION = 1;
903 | DYLIB_INSTALL_NAME_BASE = "@rpath";
904 | FRAMEWORK_SEARCH_PATHS = (
905 | "$(inherited)",
906 | "$(PROJECT_DIR)/Carthage/Build/iOS",
907 | );
908 | INFOPLIST_FILE = CameraFramework/Info.plist;
909 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
910 | LD_RUNPATH_SEARCH_PATHS = (
911 | "$(inherited)",
912 | "@executable_path/Frameworks",
913 | "@loader_path/Frameworks",
914 | );
915 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.CameraFramework";
916 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
917 | PROVISIONING_PROFILE_SPECIFIER = "";
918 | SKIP_INSTALL = YES;
919 | SWIFT_VERSION = 5.0;
920 | TARGETED_DEVICE_FAMILY = "1,2";
921 | VERSIONING_SYSTEM = "apple-generic";
922 | VERSION_INFO_PREFIX = "";
923 | };
924 | name = Release;
925 | };
926 | 9C5E138F22EFA5C9008EAEFF /* Debug */ = {
927 | isa = XCBuildConfiguration;
928 | buildSettings = {
929 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
930 | CODE_SIGN_STYLE = Automatic;
931 | DEVELOPMENT_TEAM = TXFV3DH636;
932 | INFOPLIST_FILE = CameraFrameworkTests/Info.plist;
933 | LD_RUNPATH_SEARCH_PATHS = (
934 | "$(inherited)",
935 | "@executable_path/Frameworks",
936 | "@loader_path/Frameworks",
937 | );
938 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.CameraFrameworkTests";
939 | PRODUCT_NAME = "$(TARGET_NAME)";
940 | SWIFT_VERSION = 5.0;
941 | TARGETED_DEVICE_FAMILY = "1,2";
942 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageProcessingSample.app/ImageProcessingSample";
943 | };
944 | name = Debug;
945 | };
946 | 9C5E139022EFA5C9008EAEFF /* Release */ = {
947 | isa = XCBuildConfiguration;
948 | buildSettings = {
949 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
950 | CODE_SIGN_STYLE = Automatic;
951 | DEVELOPMENT_TEAM = TXFV3DH636;
952 | INFOPLIST_FILE = CameraFrameworkTests/Info.plist;
953 | LD_RUNPATH_SEARCH_PATHS = (
954 | "$(inherited)",
955 | "@executable_path/Frameworks",
956 | "@loader_path/Frameworks",
957 | );
958 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.CameraFrameworkTests";
959 | PRODUCT_NAME = "$(TARGET_NAME)";
960 | SWIFT_VERSION = 5.0;
961 | TARGETED_DEVICE_FAMILY = "1,2";
962 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageProcessingSample.app/ImageProcessingSample";
963 | };
964 | name = Release;
965 | };
966 | 9C89182A22EFA33500806DE5 /* Debug */ = {
967 | isa = XCBuildConfiguration;
968 | buildSettings = {
969 | ALWAYS_SEARCH_USER_PATHS = NO;
970 | CLANG_ANALYZER_NONNULL = YES;
971 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
972 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
973 | CLANG_CXX_LIBRARY = "libc++";
974 | CLANG_ENABLE_MODULES = YES;
975 | CLANG_ENABLE_OBJC_ARC = YES;
976 | CLANG_ENABLE_OBJC_WEAK = YES;
977 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
978 | CLANG_WARN_BOOL_CONVERSION = YES;
979 | CLANG_WARN_COMMA = YES;
980 | CLANG_WARN_CONSTANT_CONVERSION = YES;
981 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
982 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
983 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
984 | CLANG_WARN_EMPTY_BODY = YES;
985 | CLANG_WARN_ENUM_CONVERSION = YES;
986 | CLANG_WARN_INFINITE_RECURSION = YES;
987 | CLANG_WARN_INT_CONVERSION = YES;
988 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
989 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
990 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
991 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
992 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
993 | CLANG_WARN_STRICT_PROTOTYPES = YES;
994 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
995 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
996 | CLANG_WARN_UNREACHABLE_CODE = YES;
997 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
998 | CODE_SIGN_IDENTITY = "iPhone Developer";
999 | COPY_PHASE_STRIP = NO;
1000 | DEBUG_INFORMATION_FORMAT = dwarf;
1001 | ENABLE_STRICT_OBJC_MSGSEND = YES;
1002 | ENABLE_TESTABILITY = YES;
1003 | GCC_C_LANGUAGE_STANDARD = gnu11;
1004 | GCC_DYNAMIC_NO_PIC = NO;
1005 | GCC_NO_COMMON_BLOCKS = YES;
1006 | GCC_OPTIMIZATION_LEVEL = 0;
1007 | GCC_PREPROCESSOR_DEFINITIONS = (
1008 | "DEBUG=1",
1009 | "$(inherited)",
1010 | );
1011 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
1012 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
1013 | GCC_WARN_UNDECLARED_SELECTOR = YES;
1014 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
1015 | GCC_WARN_UNUSED_FUNCTION = YES;
1016 | GCC_WARN_UNUSED_VARIABLE = YES;
1017 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
1018 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
1019 | MTL_FAST_MATH = YES;
1020 | ONLY_ACTIVE_ARCH = YES;
1021 | SDKROOT = iphoneos;
1022 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
1023 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1024 | };
1025 | name = Debug;
1026 | };
1027 | 9C89182B22EFA33500806DE5 /* Release */ = {
1028 | isa = XCBuildConfiguration;
1029 | buildSettings = {
1030 | ALWAYS_SEARCH_USER_PATHS = NO;
1031 | CLANG_ANALYZER_NONNULL = YES;
1032 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
1033 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
1034 | CLANG_CXX_LIBRARY = "libc++";
1035 | CLANG_ENABLE_MODULES = YES;
1036 | CLANG_ENABLE_OBJC_ARC = YES;
1037 | CLANG_ENABLE_OBJC_WEAK = YES;
1038 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
1039 | CLANG_WARN_BOOL_CONVERSION = YES;
1040 | CLANG_WARN_COMMA = YES;
1041 | CLANG_WARN_CONSTANT_CONVERSION = YES;
1042 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
1043 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
1044 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1045 | CLANG_WARN_EMPTY_BODY = YES;
1046 | CLANG_WARN_ENUM_CONVERSION = YES;
1047 | CLANG_WARN_INFINITE_RECURSION = YES;
1048 | CLANG_WARN_INT_CONVERSION = YES;
1049 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
1050 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
1051 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
1052 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1053 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
1054 | CLANG_WARN_STRICT_PROTOTYPES = YES;
1055 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
1056 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1057 | CLANG_WARN_UNREACHABLE_CODE = YES;
1058 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
1059 | CODE_SIGN_IDENTITY = "iPhone Developer";
1060 | COPY_PHASE_STRIP = NO;
1061 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1062 | ENABLE_NS_ASSERTIONS = NO;
1063 | ENABLE_STRICT_OBJC_MSGSEND = YES;
1064 | GCC_C_LANGUAGE_STANDARD = gnu11;
1065 | GCC_NO_COMMON_BLOCKS = YES;
1066 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
1067 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
1068 | GCC_WARN_UNDECLARED_SELECTOR = YES;
1069 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
1070 | GCC_WARN_UNUSED_FUNCTION = YES;
1071 | GCC_WARN_UNUSED_VARIABLE = YES;
1072 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
1073 | MTL_ENABLE_DEBUG_INFO = NO;
1074 | MTL_FAST_MATH = YES;
1075 | SDKROOT = iphoneos;
1076 | SWIFT_COMPILATION_MODE = wholemodule;
1077 | SWIFT_OPTIMIZATION_LEVEL = "-O";
1078 | VALIDATE_PRODUCT = YES;
1079 | };
1080 | name = Release;
1081 | };
1082 | 9C89182D22EFA33500806DE5 /* Debug */ = {
1083 | isa = XCBuildConfiguration;
1084 | buildSettings = {
1085 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1086 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1087 | CODE_SIGN_STYLE = Manual;
1088 | DEVELOPMENT_TEAM = TXFV3DH636;
1089 | FRAMEWORK_SEARCH_PATHS = (
1090 | "$(inherited)",
1091 | "$(PROJECT_DIR)/Carthage/Build/iOS",
1092 | );
1093 | INFOPLIST_FILE = ImageProcessingSample/Info.plist;
1094 | LD_RUNPATH_SEARCH_PATHS = (
1095 | "$(inherited)",
1096 | "@executable_path/Frameworks",
1097 | );
1098 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.ImageProcessingSample";
1099 | PRODUCT_NAME = "$(TARGET_NAME)";
1100 | PROVISIONING_PROFILE_SPECIFIER = "General Sample App";
1101 | SWIFT_VERSION = 5.0;
1102 | TARGETED_DEVICE_FAMILY = "1,2";
1103 | };
1104 | name = Debug;
1105 | };
1106 | 9C89182E22EFA33500806DE5 /* Release */ = {
1107 | isa = XCBuildConfiguration;
1108 | buildSettings = {
1109 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1110 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1111 | CODE_SIGN_STYLE = Manual;
1112 | DEVELOPMENT_TEAM = "";
1113 | FRAMEWORK_SEARCH_PATHS = (
1114 | "$(inherited)",
1115 | "$(PROJECT_DIR)/Carthage/Build/iOS",
1116 | );
1117 | INFOPLIST_FILE = ImageProcessingSample/Info.plist;
1118 | LD_RUNPATH_SEARCH_PATHS = (
1119 | "$(inherited)",
1120 | "@executable_path/Frameworks",
1121 | );
1122 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.ImageProcessingSample";
1123 | PRODUCT_NAME = "$(TARGET_NAME)";
1124 | PROVISIONING_PROFILE_SPECIFIER = "";
1125 | SWIFT_VERSION = 5.0;
1126 | TARGETED_DEVICE_FAMILY = "1,2";
1127 | };
1128 | name = Release;
1129 | };
1130 | 9C89183022EFA33500806DE5 /* Debug */ = {
1131 | isa = XCBuildConfiguration;
1132 | buildSettings = {
1133 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1134 | BUNDLE_LOADER = "$(TEST_HOST)";
1135 | CODE_SIGN_STYLE = Automatic;
1136 | DEVELOPMENT_TEAM = TXFV3DH636;
1137 | INFOPLIST_FILE = ImageProcessingSampleTests/Info.plist;
1138 | LD_RUNPATH_SEARCH_PATHS = (
1139 | "$(inherited)",
1140 | "@executable_path/Frameworks",
1141 | "@loader_path/Frameworks",
1142 | );
1143 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.ImageProcessingSampleTests";
1144 | PRODUCT_NAME = "$(TARGET_NAME)";
1145 | SWIFT_VERSION = 5.0;
1146 | TARGETED_DEVICE_FAMILY = "1,2";
1147 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageProcessingSample.app/ImageProcessingSample";
1148 | };
1149 | name = Debug;
1150 | };
1151 | 9C89183122EFA33500806DE5 /* Release */ = {
1152 | isa = XCBuildConfiguration;
1153 | buildSettings = {
1154 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1155 | BUNDLE_LOADER = "$(TEST_HOST)";
1156 | CODE_SIGN_STYLE = Automatic;
1157 | DEVELOPMENT_TEAM = TXFV3DH636;
1158 | INFOPLIST_FILE = ImageProcessingSampleTests/Info.plist;
1159 | LD_RUNPATH_SEARCH_PATHS = (
1160 | "$(inherited)",
1161 | "@executable_path/Frameworks",
1162 | "@loader_path/Frameworks",
1163 | );
1164 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.ImageProcessingSampleTests";
1165 | PRODUCT_NAME = "$(TARGET_NAME)";
1166 | SWIFT_VERSION = 5.0;
1167 | TARGETED_DEVICE_FAMILY = "1,2";
1168 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageProcessingSample.app/ImageProcessingSample";
1169 | };
1170 | name = Release;
1171 | };
1172 | 9C89183322EFA33500806DE5 /* Debug */ = {
1173 | isa = XCBuildConfiguration;
1174 | buildSettings = {
1175 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1176 | CODE_SIGN_STYLE = Automatic;
1177 | DEVELOPMENT_TEAM = TXFV3DH636;
1178 | INFOPLIST_FILE = ImageProcessingSampleUITests/Info.plist;
1179 | LD_RUNPATH_SEARCH_PATHS = (
1180 | "$(inherited)",
1181 | "@executable_path/Frameworks",
1182 | "@loader_path/Frameworks",
1183 | );
1184 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.ImageProcessingSampleUITests";
1185 | PRODUCT_NAME = "$(TARGET_NAME)";
1186 | SWIFT_VERSION = 5.0;
1187 | TARGETED_DEVICE_FAMILY = "1,2";
1188 | TEST_TARGET_NAME = ImageProcessingSample;
1189 | };
1190 | name = Debug;
1191 | };
1192 | 9C89183422EFA33500806DE5 /* Release */ = {
1193 | isa = XCBuildConfiguration;
1194 | buildSettings = {
1195 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1196 | CODE_SIGN_STYLE = Automatic;
1197 | DEVELOPMENT_TEAM = TXFV3DH636;
1198 | INFOPLIST_FILE = ImageProcessingSampleUITests/Info.plist;
1199 | LD_RUNPATH_SEARCH_PATHS = (
1200 | "$(inherited)",
1201 | "@executable_path/Frameworks",
1202 | "@loader_path/Frameworks",
1203 | );
1204 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.ImageProcessingSampleUITests";
1205 | PRODUCT_NAME = "$(TARGET_NAME)";
1206 | SWIFT_VERSION = 5.0;
1207 | TARGETED_DEVICE_FAMILY = "1,2";
1208 | TEST_TARGET_NAME = ImageProcessingSample;
1209 | };
1210 | name = Release;
1211 | };
1212 | 9C9E28D022FF379F007D4DE0 /* Debug */ = {
1213 | isa = XCBuildConfiguration;
1214 | buildSettings = {
1215 | CLANG_ENABLE_MODULES = YES;
1216 | CODE_SIGN_IDENTITY = "iPhone Developer";
1217 | CODE_SIGN_STYLE = Manual;
1218 | CURRENT_PROJECT_VERSION = 1;
1219 | DEFINES_MODULE = YES;
1220 | DEVELOPMENT_TEAM = TXFV3DH636;
1221 | DYLIB_COMPATIBILITY_VERSION = 1;
1222 | DYLIB_CURRENT_VERSION = 1;
1223 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1224 | FRAMEWORK_SEARCH_PATHS = (
1225 | "$(inherited)",
1226 | "$(PROJECT_DIR)/OpenCV",
1227 | );
1228 | HEADER_SEARCH_PATHS = "";
1229 | INFOPLIST_FILE = OpneCVImageProcessingFramework/Info.plist;
1230 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1231 | LD_RUNPATH_SEARCH_PATHS = (
1232 | "$(inherited)",
1233 | "@executable_path/Frameworks",
1234 | "@loader_path/Frameworks",
1235 | );
1236 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.OpneCVImageProcessingFramework";
1237 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
1238 | PROVISIONING_PROFILE_SPECIFIER = "";
1239 | SKIP_INSTALL = YES;
1240 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1241 | SWIFT_VERSION = 5.0;
1242 | TARGETED_DEVICE_FAMILY = "1,2";
1243 | VERSIONING_SYSTEM = "apple-generic";
1244 | VERSION_INFO_PREFIX = "";
1245 | };
1246 | name = Debug;
1247 | };
1248 | 9C9E28D122FF379F007D4DE0 /* Release */ = {
1249 | isa = XCBuildConfiguration;
1250 | buildSettings = {
1251 | CLANG_ENABLE_MODULES = YES;
1252 | CODE_SIGN_IDENTITY = "";
1253 | CODE_SIGN_STYLE = Manual;
1254 | CURRENT_PROJECT_VERSION = 1;
1255 | DEFINES_MODULE = YES;
1256 | DEVELOPMENT_TEAM = "";
1257 | DYLIB_COMPATIBILITY_VERSION = 1;
1258 | DYLIB_CURRENT_VERSION = 1;
1259 | DYLIB_INSTALL_NAME_BASE = "@rpath";
1260 | FRAMEWORK_SEARCH_PATHS = (
1261 | "$(inherited)",
1262 | "$(PROJECT_DIR)/OpenCV",
1263 | );
1264 | HEADER_SEARCH_PATHS = "";
1265 | INFOPLIST_FILE = OpneCVImageProcessingFramework/Info.plist;
1266 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1267 | LD_RUNPATH_SEARCH_PATHS = (
1268 | "$(inherited)",
1269 | "@executable_path/Frameworks",
1270 | "@loader_path/Frameworks",
1271 | );
1272 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.OpneCVImageProcessingFramework";
1273 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
1274 | PROVISIONING_PROFILE_SPECIFIER = "";
1275 | SKIP_INSTALL = YES;
1276 | SWIFT_VERSION = 5.0;
1277 | TARGETED_DEVICE_FAMILY = "1,2";
1278 | VERSIONING_SYSTEM = "apple-generic";
1279 | VERSION_INFO_PREFIX = "";
1280 | };
1281 | name = Release;
1282 | };
1283 | 9C9E28D322FF379F007D4DE0 /* Debug */ = {
1284 | isa = XCBuildConfiguration;
1285 | buildSettings = {
1286 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1287 | CODE_SIGN_STYLE = Automatic;
1288 | DEVELOPMENT_TEAM = TXFV3DH636;
1289 | INFOPLIST_FILE = OpneCVImageProcessingFrameworkTests/Info.plist;
1290 | LD_RUNPATH_SEARCH_PATHS = (
1291 | "$(inherited)",
1292 | "@executable_path/Frameworks",
1293 | "@loader_path/Frameworks",
1294 | );
1295 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.OpneCVImageProcessingFrameworkTests";
1296 | PRODUCT_NAME = "$(TARGET_NAME)";
1297 | SWIFT_VERSION = 5.0;
1298 | TARGETED_DEVICE_FAMILY = "1,2";
1299 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageProcessingSample.app/ImageProcessingSample";
1300 | };
1301 | name = Debug;
1302 | };
1303 | 9C9E28D422FF379F007D4DE0 /* Release */ = {
1304 | isa = XCBuildConfiguration;
1305 | buildSettings = {
1306 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
1307 | CODE_SIGN_STYLE = Automatic;
1308 | DEVELOPMENT_TEAM = TXFV3DH636;
1309 | INFOPLIST_FILE = OpneCVImageProcessingFrameworkTests/Info.plist;
1310 | LD_RUNPATH_SEARCH_PATHS = (
1311 | "$(inherited)",
1312 | "@executable_path/Frameworks",
1313 | "@loader_path/Frameworks",
1314 | );
1315 | PRODUCT_BUNDLE_IDENTIFIER = "co.kotetu.app.sample.image-processing.OpneCVImageProcessingFrameworkTests";
1316 | PRODUCT_NAME = "$(TARGET_NAME)";
1317 | SWIFT_VERSION = 5.0;
1318 | TARGETED_DEVICE_FAMILY = "1,2";
1319 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageProcessingSample.app/ImageProcessingSample";
1320 | };
1321 | name = Release;
1322 | };
1323 | /* End XCBuildConfiguration section */
1324 |
1325 | /* Begin XCConfigurationList section */
1326 | 9C5E139122EFA5C9008EAEFF /* Build configuration list for PBXNativeTarget "CameraFramework" */ = {
1327 | isa = XCConfigurationList;
1328 | buildConfigurations = (
1329 | 9C5E138D22EFA5C9008EAEFF /* Debug */,
1330 | 9C5E138E22EFA5C9008EAEFF /* Release */,
1331 | );
1332 | defaultConfigurationIsVisible = 0;
1333 | defaultConfigurationName = Release;
1334 | };
1335 | 9C5E139322EFA5C9008EAEFF /* Build configuration list for PBXNativeTarget "CameraFrameworkTests" */ = {
1336 | isa = XCConfigurationList;
1337 | buildConfigurations = (
1338 | 9C5E138F22EFA5C9008EAEFF /* Debug */,
1339 | 9C5E139022EFA5C9008EAEFF /* Release */,
1340 | );
1341 | defaultConfigurationIsVisible = 0;
1342 | defaultConfigurationName = Release;
1343 | };
1344 | 9C8917FF22EFA33400806DE5 /* Build configuration list for PBXProject "ImageProcessingSample" */ = {
1345 | isa = XCConfigurationList;
1346 | buildConfigurations = (
1347 | 9C89182A22EFA33500806DE5 /* Debug */,
1348 | 9C89182B22EFA33500806DE5 /* Release */,
1349 | );
1350 | defaultConfigurationIsVisible = 0;
1351 | defaultConfigurationName = Release;
1352 | };
1353 | 9C89182C22EFA33500806DE5 /* Build configuration list for PBXNativeTarget "ImageProcessingSample" */ = {
1354 | isa = XCConfigurationList;
1355 | buildConfigurations = (
1356 | 9C89182D22EFA33500806DE5 /* Debug */,
1357 | 9C89182E22EFA33500806DE5 /* Release */,
1358 | );
1359 | defaultConfigurationIsVisible = 0;
1360 | defaultConfigurationName = Release;
1361 | };
1362 | 9C89182F22EFA33500806DE5 /* Build configuration list for PBXNativeTarget "ImageProcessingSampleTests" */ = {
1363 | isa = XCConfigurationList;
1364 | buildConfigurations = (
1365 | 9C89183022EFA33500806DE5 /* Debug */,
1366 | 9C89183122EFA33500806DE5 /* Release */,
1367 | );
1368 | defaultConfigurationIsVisible = 0;
1369 | defaultConfigurationName = Release;
1370 | };
1371 | 9C89183222EFA33500806DE5 /* Build configuration list for PBXNativeTarget "ImageProcessingSampleUITests" */ = {
1372 | isa = XCConfigurationList;
1373 | buildConfigurations = (
1374 | 9C89183322EFA33500806DE5 /* Debug */,
1375 | 9C89183422EFA33500806DE5 /* Release */,
1376 | );
1377 | defaultConfigurationIsVisible = 0;
1378 | defaultConfigurationName = Release;
1379 | };
1380 | 9C9E28CF22FF379F007D4DE0 /* Build configuration list for PBXNativeTarget "OpneCVImageProcessingFramework" */ = {
1381 | isa = XCConfigurationList;
1382 | buildConfigurations = (
1383 | 9C9E28D022FF379F007D4DE0 /* Debug */,
1384 | 9C9E28D122FF379F007D4DE0 /* Release */,
1385 | );
1386 | defaultConfigurationIsVisible = 0;
1387 | defaultConfigurationName = Release;
1388 | };
1389 | 9C9E28D222FF379F007D4DE0 /* Build configuration list for PBXNativeTarget "OpneCVImageProcessingFrameworkTests" */ = {
1390 | isa = XCConfigurationList;
1391 | buildConfigurations = (
1392 | 9C9E28D322FF379F007D4DE0 /* Debug */,
1393 | 9C9E28D422FF379F007D4DE0 /* Release */,
1394 | );
1395 | defaultConfigurationIsVisible = 0;
1396 | defaultConfigurationName = Release;
1397 | };
1398 | /* End XCConfigurationList section */
1399 | };
1400 | rootObject = 9C8917FC22EFA33400806DE5 /* Project object */;
1401 | }
1402 |
--------------------------------------------------------------------------------
/ImageProcessingSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ImageProcessingSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ImageProcessingSample.xcodeproj/xcshareddata/xcschemes/ImageProcessingSample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
53 |
59 |
60 |
61 |
63 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
81 |
82 |
83 |
84 |
94 |
96 |
102 |
103 |
104 |
105 |
106 |
107 |
113 |
115 |
121 |
122 |
123 |
124 |
126 |
127 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/ImageProcessingSample/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/ImageProcessingSample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | ImgProcess
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSCameraUsageDescription
26 | カメラ画像を使ったリアルタイム画像処理デモのために使用します。
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Sources/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // ImageProcessingSample
4 | //
5 | // Created by kotetu on 2019/07/30.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Sources/CIImageDrawable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CIImageDrawable.swift
3 | // ImageProcessingSample
4 | //
5 | // Created by kotetu on 2019/08/31.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import CoreImage
10 |
11 | protocol CIImageDrawable {
12 | var isHidden: Bool { get set }
13 |
14 | func draw(image: CIImage)
15 | }
16 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Sources/GLVideoPreview.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GLVideoPreview.swift
3 | // ImageProcessingSample
4 | //
5 | // Created by kotetu on 2019/08/29.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import GLKit
10 |
11 | /// GLKViewを使ったプレビュー表示用クラス
12 | /// (GLKViewはiOS12でdeprecatedになったので、検証目的以外では使用しないでください。)
13 | final class GLVideoPreview: GLKView {
14 | private let ciContext: CIContext?
15 |
16 | required init?(coder aDecoder: NSCoder) {
17 | if let eaglContext = EAGLContext(api: .openGLES3) {
18 | ciContext = CIContext(eaglContext: eaglContext)
19 | super.init(coder: aDecoder)
20 | self.context = eaglContext
21 | } else {
22 | ciContext = nil
23 | super.init(coder: aDecoder)
24 | }
25 |
26 | EAGLContext.setCurrent(self.context)
27 | enableSetNeedsDisplay = false
28 | contentScaleFactor = UIScreen.main.scale
29 | bindDrawable()
30 | }
31 | }
32 |
33 | extension GLVideoPreview: CIImageDrawable {
34 | /// CIImageの描画(別スレッドから呼び出してもクラッシュしない)
35 | func draw(image: CIImage) {
36 | guard let ciContext = ciContext else { return }
37 | let videoDisplayViewBounds
38 | = CGRect(x: 0, y: 0, width: CGFloat(drawableWidth), height: CGFloat(drawableHeight))
39 |
40 | // 描画領域と同じサイズの画像を用意する(はみ出た分は切り取る)
41 | let aspectRatio: CGFloat = CGFloat(drawableWidth) / CGFloat(drawableHeight)
42 | let imageWidthAspectFit = image.extent.height * aspectRatio
43 | let scale: CGFloat = (CGFloat(drawableHeight) / image.extent.height)
44 | let displayImage = image
45 | .cropped(to: CGRect(origin: CGPoint(x: (image.extent.width - imageWidthAspectFit) / 2, y: 0),
46 | size: CGSize(width: imageWidthAspectFit, height: image.extent.height)))
47 | .transformed(by: CGAffineTransform(scaleX: scale, y: scale))
48 |
49 | bindDrawable()
50 | ciContext.draw(displayImage, in: videoDisplayViewBounds, from: displayImage.extent)
51 | context.presentRenderbuffer(Int(GL_RENDERBUFFER))
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Sources/MetalVideoPreview.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MetalVideoPreview.swift
3 | // ImageProcessingSample
4 | //
5 | // Created by kotetu on 2019/08/29.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import MetalKit
10 |
11 | final class MetalVideoPreview: MTKView {
12 | private let ciContext: CIContext?
13 | private let commandQueue: MTLCommandQueue?
14 |
15 | required init(coder: NSCoder) {
16 | if let mtlDevice = MTLCreateSystemDefaultDevice() {
17 | ciContext = CIContext(mtlDevice: mtlDevice)
18 | commandQueue = mtlDevice.makeCommandQueue()
19 | super.init(coder: coder)
20 | self.device = mtlDevice
21 | } else {
22 | ciContext = nil
23 | commandQueue = nil
24 | super.init(coder: coder)
25 | }
26 | }
27 | }
28 |
29 | extension MetalVideoPreview: CIImageDrawable {
30 | /// CIImageの描画(別スレッドから呼び出してもクラッシュしない)
31 | func draw(image: CIImage) {
32 | guard let ciContext = ciContext,
33 | let commandQueue = commandQueue,
34 | let mtlDrawable = currentDrawable,
35 | let commandBuffer = commandQueue.makeCommandBuffer() else { return }
36 |
37 | let colorSpace = CGColorSpaceCreateDeviceRGB()
38 |
39 | // 描画領域と同じサイズの画像を用意する(はみ出た分は切り取る)
40 | let aspectRatio = drawableSize.width / drawableSize.height
41 | let imageWidthAspectFit = image.extent.height * aspectRatio
42 | let scale = (drawableSize.height / image.extent.height)
43 | let displayImage = image
44 | .cropped(to: CGRect(origin: CGPoint(x: (image.extent.width - imageWidthAspectFit) / 2, y: 0),
45 | size: CGSize(width: imageWidthAspectFit, height: image.extent.height)))
46 | .transformed(by: CGAffineTransform(scaleX: scale, y: scale))
47 |
48 | ciContext.render(displayImage,
49 | to: mtlDrawable.texture,
50 | commandBuffer: commandBuffer,
51 | bounds: displayImage.extent,
52 | colorSpace: colorSpace)
53 |
54 | commandBuffer.present(mtlDrawable)
55 | commandBuffer.commit()
56 | commandBuffer.waitUntilCompleted()
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Sources/Presenter.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Presenter.swift
3 | // ImageProcessingSample
4 | //
5 | // Created by kotetu on 2019/08/12.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import CameraFramework
10 | import OpneCVImageProcessingFramework
11 | import RxSwift
12 |
13 | protocol PresenterDelegate: AnyObject {
14 | func showAccessDeniedError()
15 | func showCameraInitializationError()
16 | func initializationDidSuccess()
17 | func draw(circles: [Circle])
18 | func draw(ciImage: CIImage)
19 | }
20 |
21 | final class Presenter {
22 | private let processingImageHeight: CGFloat = 1000
23 | private let minimumDistance: Double = 10
24 |
25 | private let imageProcessor: ImageProcessor
26 | private let videoAccess: VideoAccess
27 |
28 | private let disposeBag = DisposeBag()
29 | private let backgroundScheduler = ConcurrentDispatchQueueScheduler(qos: .background)
30 | private let circleDetectionQueue = DispatchQueue(label: "co.kotetu.circle.detection.queue", qos: .utility)
31 | private var videoCapture: VideoImageCapture?
32 | private var previewSize: CGSize?
33 | private let context = CIContext()
34 | private var isProcessing: Bool = false
35 |
36 | weak var delegate: PresenterDelegate?
37 |
38 | init(imageProcessor: ImageProcessor, videoAccess: VideoAccess) {
39 | self.imageProcessor = imageProcessor
40 | self.videoAccess = videoAccess
41 | }
42 |
43 | func initializePreview() {
44 | requestVideoAccess()
45 | }
46 |
47 | func startPreview(with previewLayer: CALayer?) {
48 | guard let videoCapture = BasicVideoDataCaptureBuilder().build() else {
49 | delegate?.showCameraInitializationError()
50 | return
51 | }
52 | if let previewLayer = previewLayer {
53 | videoCapture.setPreviewLayer(previewLayer)
54 | self.previewSize = previewLayer.bounds.size
55 | }
56 | videoCapture.setVideoImageCaptureDelegate(self)
57 | videoCapture.start()
58 | self.videoCapture = videoCapture
59 | }
60 |
61 | func terminate() {
62 | stopVideoCapture()
63 | }
64 |
65 | private func requestVideoAccess() {
66 | videoAccess
67 | .requestVideoAccess()
68 | .subscribeOn(backgroundScheduler)
69 | .observeOn(MainScheduler.instance)
70 | .subscribe { [weak self] completable in
71 | guard let self = self else { return }
72 | switch completable {
73 | case .completed:
74 | self.delegate?.initializationDidSuccess()
75 | case .error(_):
76 | self.delegate?.showAccessDeniedError()
77 | }
78 | }
79 | .disposed(by: disposeBag)
80 | }
81 |
82 | private func startVideoCapture() {
83 | guard let videoCapture = videoCapture else { return }
84 | videoCapture.start()
85 | }
86 |
87 | private func stopVideoCapture() {
88 | guard let videoCapture = videoCapture else { return }
89 | videoCapture.stop()
90 | }
91 | }
92 |
93 | extension Presenter: VideoImageCaptureDelegate {
94 | func didOutput(ciImage: CIImage) {
95 | delegate?.draw(ciImage: ciImage)
96 | if !isProcessing {
97 | circleDetectionQueue.async { [weak self] in
98 | #if DEBUG
99 | let start = Date()
100 | #endif
101 | // self?.circleDetectionResizeUIImage(by: ciImage)
102 | self?.circleDetectionResizeCIImage(by: ciImage)
103 | #if DEBUG
104 | let interval = Date().timeIntervalSince(start)
105 | NSLog("Processing Time : %.5f (Presenter#didOutput)", interval)
106 | #endif
107 | }
108 | }
109 | }
110 | }
111 |
112 | private extension Presenter {
113 | func circleDetectionResizeUIImage(by ciImage: CIImage) {
114 | isProcessing = true
115 | guard let previewSize = previewSize, let uiImage = convert(from: ciImage) else { return }
116 |
117 | let aspectRatioForPreview = (previewSize.width / previewSize.height)
118 | let processingScale = processingImageHeight / ciImage.extent.height
119 |
120 | // プレビュー表示されない領域幅の片側オフセット値(原寸大画像ベースで算出)
121 | // AVCaptureVideoPreviewLayerでvideoGravityをresizeAspectFillにした場合、縦については全て表示され
122 | // 左右は切り取られるように表示調整されることから、非表示領域内にある原点を考慮しこのような実装となっている
123 | let offsetX: CGFloat = (uiImage.size.width - (uiImage.size.height * aspectRatioForPreview)) / 2
124 | let drawScale: CGFloat = previewSize.height / uiImage.size.height
125 | // offsetXを表示スクリーン換算で算出
126 | let offsetForDrawScaleX = offsetX * drawScale
127 |
128 | let resizedImage = uiImage.resize(to: processingScale)
129 | // let resizedImage = uiImage.resizeForOLD(to: processingScale)!
130 | let drawableCircles = imageProcessor.circleDetection(from: resizedImage, minimumDistance: minimumDistance).compactMap { circle -> Circle in
131 | let center = CGPoint(x: ((circle.center.x / processingScale) * drawScale) - offsetForDrawScaleX,
132 | y: ((circle.center.y / processingScale) * drawScale))
133 | return Circle(center: center, radius: (circle.radius / processingScale) * drawScale)
134 | }
135 |
136 | delegate?.draw(circles: drawableCircles)
137 | isProcessing = false
138 | }
139 |
140 | func circleDetectionResizeCIImage(by ciImage: CIImage) {
141 | isProcessing = true
142 | let processingScale = processingImageHeight / ciImage.extent.height
143 | // guard let previewSize = previewSize, let resizedImage = convert(from: ciImage, affine: processingScale) else { return }
144 | // guard let previewSize = previewSize, let resizedImage = convert(from: ciImage, lanczos: processingScale) else { return }
145 | guard let previewSize = previewSize, let resizedImage = convert(from: ciImage, bicubic: processingScale) else { return }
146 |
147 | let aspectRatioForPreview = (previewSize.width / previewSize.height)
148 |
149 | // プレビュー表示されない領域幅の片側オフセット値(原寸大画像ベースで算出)
150 | // AVCaptureVideoPreviewLayerでvideoGravityをresizeAspectFillにした場合、縦については全て表示され
151 | // 左右は切り取られるように表示調整されることから、非表示領域内にある原点を考慮しこのような実装となっている
152 | let offsetX: CGFloat = (ciImage.extent.width - (ciImage.extent.height * aspectRatioForPreview)) / 2
153 | let drawScale: CGFloat = previewSize.height / ciImage.extent.height
154 |
155 | // offsetXを表示スクリーン換算で算出
156 | let offsetForDrawScaleX = offsetX * drawScale
157 |
158 | let drawableCircles = imageProcessor.circleDetection(from: resizedImage, minimumDistance: minimumDistance).compactMap { circle -> Circle in
159 | let center = CGPoint(x: ((circle.center.x / processingScale) * drawScale) - offsetForDrawScaleX,
160 | y: ((circle.center.y / processingScale) * drawScale))
161 | return Circle(center: center, radius: (circle.radius / processingScale) * drawScale)
162 | }
163 |
164 | delegate?.draw(circles: drawableCircles)
165 | isProcessing = false
166 | }
167 | }
168 |
169 | private extension Presenter {
170 | /// UIImageへのコンバートのみ行う
171 | func convert(from ciImage: CIImage) -> UIImage? {
172 | return autoreleasepool { [weak self] in
173 | // UIImage -> CGImage -> UIImage
174 | guard let self = self,
175 | let cgImage = self.context.createCGImage(ciImage, from: ciImage.extent) else {
176 | return nil
177 | }
178 | return UIImage(cgImage: cgImage)
179 | }
180 | }
181 |
182 | /// UIImageへのコンバートとリサイズを並行して行う(アフィン変換)
183 | func convert(from ciImage: CIImage, affine scale: CGFloat) -> UIImage? {
184 | return autoreleasepool { [weak self] in
185 | // UIImage -> CGImage -> UIImage
186 | guard let self = self,
187 | let outputImage = ciImage.resizeUsingAffine(to: scale),
188 | let cgImage = self.context.createCGImage(outputImage, from: outputImage.extent) else {
189 | return nil
190 | }
191 | return UIImage(cgImage: cgImage)
192 | }
193 | }
194 |
195 | /// UIImageへのコンバートとリサイズを並行して行う(lanczos法)
196 | func convert(from ciImage: CIImage, lanczos scale: CGFloat) -> UIImage? {
197 | return autoreleasepool { [weak self] in
198 | // UIImage -> CGImage -> UIImage
199 | guard let self = self,
200 | let outputImage = ciImage.resizeUsingLanczos(to: scale),
201 | let cgImage = self.context.createCGImage(outputImage, from: outputImage.extent) else {
202 | return nil
203 | }
204 | return UIImage(cgImage: cgImage)
205 | }
206 | }
207 |
208 | /// UIImageへのコンバートとリサイズを並行して行う(bicubic法)
209 | func convert(from ciImage: CIImage, bicubic scale: CGFloat) -> UIImage? {
210 | return autoreleasepool { [weak self] in
211 | // UIImage -> CGImage -> UIImage
212 | guard let self = self,
213 | let outputImage = ciImage.resizeUsingBicubic(to: scale),
214 | let cgImage = self.context.createCGImage(outputImage, from: outputImage.extent) else {
215 | return nil
216 | }
217 | return UIImage(cgImage: cgImage)
218 | }
219 | }
220 | }
221 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Sources/Utilities/CIImage+Resize.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ScaleFilter.swift
3 | // ImageProcessingSample
4 | //
5 | // Created by kotetu on 2019/08/13.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import CoreImage
10 |
11 | extension CIImage {
12 | func resizeUsingAffine(to scale: CGFloat) -> CIImage? {
13 | return self.transformed(by: CGAffineTransform(scaleX: scale, y: scale))
14 | }
15 |
16 | func resizeUsingLanczos(to scale: CGFloat) -> CIImage? {
17 | guard let filter = CIFilter(name: "CILanczosScaleTransform") else {
18 | return nil
19 | }
20 | filter.setDefaults()
21 | filter.setValue(self, forKey: kCIInputImageKey)
22 | filter.setValue(scale, forKey: kCIInputScaleKey)
23 | return filter.outputImage
24 | }
25 |
26 | func resizeUsingBicubic(to scale: CGFloat) -> CIImage? {
27 | guard let filter = CIFilter(name: "CIBicubicScaleTransform") else {
28 | return nil
29 | }
30 | filter.setDefaults()
31 | filter.setValue(self, forKey: kCIInputImageKey)
32 | filter.setValue(scale, forKey: kCIInputScaleKey)
33 | return filter.outputImage
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Sources/Utilities/UIImage+Resize.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+Resize.swift
3 | // ImageProcessingSample
4 | //
5 | // Created by kotetu on 2019/08/31.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIImage {
12 | func resize(to scale: CGFloat) -> UIImage {
13 | let newSize = CGSize(width: size.width * scale,
14 | height: size.height * scale)
15 | return resize(to: newSize)
16 | }
17 |
18 | func resize(to size: CGSize) -> UIImage {
19 | // UIGraphicsImageRendererデバイスのスクリーンスケールに合わせて画像をリサイズするようになっている。
20 | // ただ、ここでは画像処理用のリサイズを行いたいので、UIGraphicsImageRendererFormat.scaleを1に設定する必要がある。
21 | // ※ UI表示用にリサイズする場合は逆にscale設定しない方が良い
22 | let format = UIGraphicsImageRendererFormat()
23 | format.scale = 1
24 | let renderer = UIGraphicsImageRenderer(size: size, format: format)
25 | return renderer.image(actions: { context in
26 | let newRect = CGRect(origin: .zero, size: size)
27 | self.draw(in: newRect)
28 | })
29 | }
30 |
31 | func resizeForOLD(to scale: CGFloat) -> UIImage? {
32 | let newSize = CGSize(width: size.width * scale,
33 | height: size.height * scale)
34 | return resizeForOLD(to: newSize)
35 | }
36 |
37 | func resizeForOLD(to size: CGSize) -> UIImage? {
38 | UIGraphicsBeginImageContext(size)
39 | defer {
40 | UIGraphicsEndImageContext()
41 | }
42 | let newRect = CGRect(origin: .zero, size: size)
43 | draw(in: newRect)
44 | return UIGraphicsGetImageFromCurrentImageContext()
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Sources/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // ImageProcessingSample
4 | //
5 | // Created by kotetu on 2019/07/30.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import CameraFramework
10 | import OpneCVImageProcessingFramework
11 |
12 | final class ViewController: UIViewController {
13 | @IBOutlet private weak var cameraPreview: UIView!
14 | @IBOutlet private weak var detectCirclePreview: UIView!
15 | @IBOutlet private weak var glkPreview: GLVideoPreview!
16 | @IBOutlet private weak var mtkPreview: MetalVideoPreview!
17 |
18 | /// CIImageの描画先Viewを指定する(GLVideoPreview or MetalVideoPreview)
19 | private var drawView: CIImageDrawable!
20 |
21 | private let presenter = Presenter(imageProcessor: OpenCVImageProcessor(),
22 | videoAccess: VideoAccess())
23 |
24 | override func viewDidLoad() {
25 | super.viewDidLoad()
26 | presenter.delegate = self
27 |
28 | // CIImageの描画については下記設定を変更する
29 | drawView = mtkPreview
30 | drawView.isHidden = true
31 | }
32 |
33 | override func viewWillAppear(_ animated: Bool) {
34 | super.viewWillAppear(animated)
35 | presenter.initializePreview()
36 | }
37 |
38 | override func viewDidDisappear(_ animated: Bool) {
39 | super.viewDidDisappear(animated)
40 | presenter.terminate()
41 | }
42 | }
43 |
44 | extension ViewController: PresenterDelegate {
45 | func showAccessDeniedError() {
46 | let alert = UIAlertController(title: "エラー",
47 | message: "カメラのアクセスを許可してください。",
48 | preferredStyle: .alert)
49 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
50 | self.present(alert, animated: true, completion: nil)
51 | }
52 |
53 | func showCameraInitializationError() {
54 | let alert = UIAlertController(title: "エラー",
55 | message: "カメラの初期化に失敗しました。",
56 | preferredStyle: .alert)
57 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
58 | self.present(alert, animated: true, completion: nil)
59 | }
60 |
61 | func initializationDidSuccess() {
62 | presenter.startPreview(with: cameraPreview.layer)
63 | }
64 |
65 | func draw(circles: [Circle]) {
66 | DispatchQueue.main.async { [weak self] in
67 | guard let self = self else { return }
68 | self.drawShapeLayer(circles: circles)
69 | }
70 | }
71 |
72 | func draw(ciImage: CIImage) {
73 | // drawView.draw(image: ciImage)
74 | }
75 | }
76 |
77 | private extension ViewController {
78 | func drawShapeLayer(circles: [Circle]) {
79 | detectCirclePreview.layer.sublayers
80 | = circles.map({ circle -> CAShapeLayer in
81 | let shapeLayer = CAShapeLayer()
82 | let path = CGMutablePath()
83 | path.addArc(center: circle.center,
84 | radius: circle.radius,
85 | startAngle: 0,
86 | endAngle: CGFloat.pi * 2,
87 | clockwise: true)
88 | shapeLayer.path = path
89 | shapeLayer.strokeColor = UIColor.yellow.cgColor
90 | shapeLayer.fillColor = nil
91 | shapeLayer.lineWidth = 3.0
92 | return shapeLayer
93 | })
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Storyboards/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/ImageProcessingSample/Storyboards/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/ImageProcessingSampleTests/ImageProcessingSampleTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ImageProcessingSampleTests.swift
3 | // ImageProcessingSampleTests
4 | //
5 | // Created by kotetu on 2019/07/30.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import ImageProcessingSample
11 |
12 | class ImageProcessingSampleTests: XCTestCase {
13 |
14 | override func setUp() {
15 | // Put setup code here. This method is called before the invocation of each test method in the class.
16 | }
17 |
18 | override func tearDown() {
19 | // Put teardown code here. This method is called after the invocation of each test method in the class.
20 | }
21 |
22 | func testExample() {
23 | // This is an example of a functional test case.
24 | // Use XCTAssert and related functions to verify your tests produce the correct results.
25 | }
26 |
27 | func testPerformanceExample() {
28 | // This is an example of a performance test case.
29 | self.measure {
30 | // Put the code you want to measure the time of here.
31 | }
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/ImageProcessingSampleTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ImageProcessingSampleUITests/ImageProcessingSampleUITests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ImageProcessingSampleUITests.swift
3 | // ImageProcessingSampleUITests
4 | //
5 | // Created by kotetu on 2019/07/30.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import XCTest
10 |
11 | class ImageProcessingSampleUITests: XCTestCase {
12 |
13 | override func setUp() {
14 | // Put setup code here. This method is called before the invocation of each test method in the class.
15 |
16 | // In UI tests it is usually best to stop immediately when a failure occurs.
17 | continueAfterFailure = false
18 |
19 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
20 | XCUIApplication().launch()
21 |
22 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
23 | }
24 |
25 | override func tearDown() {
26 | // Put teardown code here. This method is called after the invocation of each test method in the class.
27 | }
28 |
29 | func testExample() {
30 | // Use recording to get started writing UI tests.
31 | // Use XCTAssert and related functions to verify your tests produce the correct results.
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/ImageProcessingSampleUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Kuriyama
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFramework/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 |
22 |
23 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFramework/Sources/Driver/CircleDetectionResult.h:
--------------------------------------------------------------------------------
1 | //
2 | // CircleDetectionResult.h
3 | // OpneCVImageProcessingFramework
4 | //
5 | // Created by kotetu on 2019/08/12.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface CircleDetectionResult : NSObject
14 |
15 | @property (nonatomic) float centerX;
16 | @property (nonatomic) float centerY;
17 | @property (nonatomic) float radius;
18 |
19 | - (nullable instancetype)initWithCenterX:(float)centerX centerY:(float)centerY radius:(float)radius;
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFramework/Sources/Driver/CircleDetectionResult.m:
--------------------------------------------------------------------------------
1 | //
2 | // CircleDetectionResult.m
3 | // OpneCVImageProcessingFramework
4 | //
5 | // Created by kotetu on 2019/08/12.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | #import "CircleDetectionResult.h"
10 |
11 | @implementation CircleDetectionResult
12 |
13 | - (nullable instancetype)initWithCenterX:(float)centerX centerY:(float)centerY radius:(float)radius
14 | {
15 | self = [super init];
16 | if (self) {
17 | self.centerX = centerX;
18 | self.centerY = centerY;
19 | self.radius = radius;
20 | }
21 | return self;
22 | }
23 | @end
24 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFramework/Sources/Driver/OpenCVDriver.h:
--------------------------------------------------------------------------------
1 | //
2 | // OpenCVDriver.h
3 | // OpneCVImageProcessingFramework
4 | //
5 | // Created by kotetu on 2019/08/12.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "CircleDetectionResult.h"
12 |
13 | NS_ASSUME_NONNULL_BEGIN
14 |
15 | @interface OpenCVDriver : NSObject
16 |
17 | /// 入力画像はグレイスケールした画像を指定するようにしてください
18 | - (NSArray *)circleDetectionWithUIImage: (UIImage *)sourceImage minimumDistance:(double)minDistance;
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFramework/Sources/Driver/OpenCVDriver.mm:
--------------------------------------------------------------------------------
1 | //
2 | // OpenCVImageProcessor.m
3 | // OpneCVImageProcessingFramework
4 | //
5 | // Created by kotetu on 2019/08/12.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | // OpenCV系のヘッダはApple系のヘッダよりも先にimportすること
10 | #ifdef __cplusplus
11 | #import
12 | #import
13 | #endif
14 |
15 | #import "OpenCVDriver.h"
16 |
17 | @implementation OpenCVDriver
18 |
19 | - (NSArray *)circleDetectionWithUIImage:(UIImage *)sourceImage minimumDistance:(double)minDistance
20 | {
21 | #ifdef DEBUG
22 | NSDate *startDate;
23 | NSDate *endDate;
24 | startDate = [NSDate date];
25 | #endif
26 |
27 | cv::Mat sourceMat;
28 | cv::Mat sourceGrayScaleMat;
29 | cv::Mat gaussianBlurMat;
30 | std::vector circles;
31 | UIImageToMat(sourceImage, sourceMat, false);
32 |
33 | cv::cvtColor(sourceMat, sourceGrayScaleMat, cv::COLOR_BGR2GRAY);
34 | // そのままの画像だとノイズが多すぎて円が取れすぎるため、ブラー(ぼかし)を入れてノイズを減らす
35 | cv::GaussianBlur(sourceGrayScaleMat, gaussianBlurMat, cv::Size(9, 9), 2, 2);
36 | cv::HoughCircles(gaussianBlurMat, circles, cv::HOUGH_GRADIENT, 1, minDistance);
37 |
38 | NSMutableArray *circleDetectionResults = [[NSMutableArray alloc] init];
39 | for(auto circle : circles) {
40 | [circleDetectionResults addObject:[[CircleDetectionResult alloc] initWithCenterX:circle[0] centerY:circle[1] radius:circle[2]]];
41 | }
42 |
43 | #ifdef DEBUG
44 | endDate = [NSDate date];
45 | NSTimeInterval interval = [endDate timeIntervalSinceDate:startDate];
46 | NSLog(@"Processing Time : %.5f (circleDetection)",interval);
47 | #endif
48 |
49 | return circleDetectionResults;
50 | }
51 | @end
52 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFramework/Sources/OpenCVImageProcessor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // OpenCVImageProcessor.swift
3 | // OpneCVImageProcessingFramework
4 | //
5 | // Created by kotetu on 2019/08/12.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | public struct Circle {
10 | public var center: CGPoint
11 | public var radius: CGFloat
12 |
13 | public init(center: CGPoint, radius: CGFloat) {
14 | self.center = center
15 | self.radius = radius
16 | }
17 | }
18 |
19 | public protocol ImageProcessor {
20 | /// 将来的に、OpenCV以外でも使えるInterfaceにするために、UIImageではない抽象的な画像型を使うようにする
21 | func circleDetection(from image: UIImage, minimumDistance: Double) -> [Circle]
22 | }
23 |
24 | public final class OpenCVImageProcessor: ImageProcessor {
25 | let driver: OpenCVDriver
26 |
27 | public init(driver: OpenCVDriver = OpenCVDriver()) {
28 | self.driver = driver
29 | }
30 |
31 | public func circleDetection(from image: UIImage, minimumDistance: Double = 2) -> [Circle] {
32 | return driver.circleDetection(with: image, minimumDistance: minimumDistance).compactMap {
33 | Circle(center: CGPoint(x: CGFloat($0.centerX),
34 | y: CGFloat($0.centerY)),
35 | radius: CGFloat($0.radius)) }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFramework/Sources/OpneCVImageProcessingFramework.h:
--------------------------------------------------------------------------------
1 | //
2 | // OpneCVImageProcessingFramework.h
3 | // OpneCVImageProcessingFramework
4 | //
5 | // Created by kotetu on 2019/08/11.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | //! Project version number for OpneCVImageProcessingFramework.
13 | FOUNDATION_EXPORT double OpneCVImageProcessingFrameworkVersionNumber;
14 |
15 | //! Project version string for OpneCVImageProcessingFramework.
16 | FOUNDATION_EXPORT const unsigned char OpneCVImageProcessingFrameworkVersionString[];
17 |
18 | // In this header, you should import all the public headers of your framework using statements like #import
19 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFrameworkTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/OpneCVImageProcessingFrameworkTests/OpneCVImageProcessingFrameworkTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // OpneCVImageProcessingFrameworkTests.swift
3 | // OpneCVImageProcessingFrameworkTests
4 | //
5 | // Created by kotetu on 2019/08/11.
6 | // Copyright © 2019 kotetu. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import OpneCVImageProcessingFramework
11 |
12 | class OpneCVImageProcessingFrameworkTests: XCTestCase {
13 |
14 | override func setUp() {
15 | // Put setup code here. This method is called before the invocation of each test method in the class.
16 | }
17 |
18 | override func tearDown() {
19 | // Put teardown code here. This method is called after the invocation of each test method in the class.
20 | }
21 |
22 | func testExample() {
23 | // This is an example of a functional test case.
24 | // Use XCTAssert and related functions to verify your tests produce the correct results.
25 | }
26 |
27 | func testPerformanceExample() {
28 | // This is an example of a performance test case.
29 | self.measure {
30 | // Put the code you want to measure the time of here.
31 | }
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Image-Processing-Sample-iOS
2 |
3 | [](https://developer.apple.com/iphone/index.action)
4 | [](https://developer.apple.com/swift)
5 | [](http://mit-license.org)
6 |
7 | A sample of optimizing image processing in iOS
8 |
9 | # How to build
10 |
11 | Before you build this, run `Scripts/Bootstrap.sh`.
12 |
13 | ```
14 | sh Scripts/Bootstrap.sh
15 | ```
16 |
17 | NOTE: Because It uses **AVFoundation**, it can not run on Simulator.
18 |
--------------------------------------------------------------------------------
/Scripts/Bootstrap.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | SCRIPT_DIR=$(cd $(dirname $0); pwd)/
4 | PROJECT_DIR=$SCRIPT_DIR..
5 |
6 | #
7 | # Carthage Build
8 | #
9 |
10 | carthage bootstrap --platform iOS
11 |
12 | #
13 | # Downloading OpenCV
14 | #
15 |
16 | OPENCV_VERISON=4.1.1
17 | OPENCV_DIR=$PROJECT_DIR/OpenCV
18 | OPENCV_ZIP_FILE=$OPENCV_DIR/opencv-$OPENCV_VERISON-ios-framework.zip
19 | OPENCV_FRAMEWORK_DIR=$OPENCV_DIR/opencv2.framework
20 |
21 | if [ ! -d $OPENCV_DIR ]; then
22 | mkdir $OPENCV_DIR
23 | fi
24 |
25 | if [ ! -f $OPENCV_ZIP_FILE ]; then
26 | curl -L -o $OPENCV_ZIP_FILE -O https://github.com/opencv/opencv/releases/download/$OPENCV_VERISON/opencv-$OPENCV_VERISON-ios-framework.zip
27 | fi
28 |
29 | if [ ! -d $OPENCV_FRAMEWORK_DIR ]; then
30 | unzip $OPENCV_ZIP_FILE -d $OPENCV_DIR
31 | fi
32 |
--------------------------------------------------------------------------------
/cartfile:
--------------------------------------------------------------------------------
1 | github "ReactiveX/RxSwift" ~> 5.0.1
2 |
--------------------------------------------------------------------------------