├── OpenCV.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── teiki.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── teiki.xcuserdatad │ └── xcschemes │ ├── OpenCV.xcscheme │ └── xcschememanagement.plist ├── OpenCV ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── lena1.imageset │ │ ├── Contents.json │ │ └── lena1.png │ └── lenna.imageset │ │ ├── Contents.json │ │ └── lenna.png ├── Info.plist ├── ViewController.h ├── ViewController.mm ├── haarcascade_frontalface_alt.xml └── main.m ├── OpenCVTests ├── Info.plist └── OpenCVTests.m └── README.md /OpenCV.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 36D10B5B1B89D6540085551E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 36D10B5A1B89D6540085551E /* main.m */; }; 11 | 36D10B5E1B89D6540085551E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 36D10B5D1B89D6540085551E /* AppDelegate.m */; }; 12 | 36D10B611B89D6540085551E /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 36D10B601B89D6540085551E /* ViewController.mm */; }; 13 | 36D10B641B89D6540085551E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 36D10B621B89D6540085551E /* Main.storyboard */; }; 14 | 36D10B661B89D6540085551E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 36D10B651B89D6540085551E /* Images.xcassets */; }; 15 | 36D10B691B89D6540085551E /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 36D10B671B89D6540085551E /* LaunchScreen.xib */; }; 16 | 36D10B751B89D6540085551E /* OpenCVTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 36D10B741B89D6540085551E /* OpenCVTests.m */; }; 17 | 36D10B7F1B89D76E0085551E /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36D10B7E1B89D76E0085551E /* opencv2.framework */; }; 18 | 36D10B831B89F1030085551E /* haarcascade_frontalface_alt.xml in Resources */ = {isa = PBXBuildFile; fileRef = 36D10B821B89F1030085551E /* haarcascade_frontalface_alt.xml */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 36D10B6F1B89D6540085551E /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 36D10B4D1B89D6540085551E /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 36D10B541B89D6540085551E; 27 | remoteInfo = OpenCV; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 36D10B551B89D6540085551E /* OpenCV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenCV.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 36D10B591B89D6540085551E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | 36D10B5A1B89D6540085551E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | 36D10B5C1B89D6540085551E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | 36D10B5D1B89D6540085551E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | 36D10B5F1B89D6540085551E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 38 | 36D10B601B89D6540085551E /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = ""; }; 39 | 36D10B631B89D6540085551E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | 36D10B651B89D6540085551E /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | 36D10B681B89D6540085551E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 42 | 36D10B6E1B89D6540085551E /* OpenCVTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OpenCVTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 36D10B731B89D6540085551E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 36D10B741B89D6540085551E /* OpenCVTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OpenCVTests.m; sourceTree = ""; }; 45 | 36D10B7E1B89D76E0085551E /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = opencv2.framework; path = ../../Downloads/opencv2.framework; sourceTree = ""; }; 46 | 36D10B821B89F1030085551E /* haarcascade_frontalface_alt.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = haarcascade_frontalface_alt.xml; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 36D10B521B89D6540085551E /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | 36D10B7F1B89D76E0085551E /* opencv2.framework in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 36D10B6B1B89D6540085551E /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 36D10B4C1B89D6540085551E = { 69 | isa = PBXGroup; 70 | children = ( 71 | 36D10B7E1B89D76E0085551E /* opencv2.framework */, 72 | 36D10B571B89D6540085551E /* OpenCV */, 73 | 36D10B711B89D6540085551E /* OpenCVTests */, 74 | 36D10B561B89D6540085551E /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 36D10B561B89D6540085551E /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 36D10B551B89D6540085551E /* OpenCV.app */, 82 | 36D10B6E1B89D6540085551E /* OpenCVTests.xctest */, 83 | ); 84 | name = Products; 85 | sourceTree = ""; 86 | }; 87 | 36D10B571B89D6540085551E /* OpenCV */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 36D10B5C1B89D6540085551E /* AppDelegate.h */, 91 | 36D10B5D1B89D6540085551E /* AppDelegate.m */, 92 | 36D10B5F1B89D6540085551E /* ViewController.h */, 93 | 36D10B601B89D6540085551E /* ViewController.mm */, 94 | 36D10B621B89D6540085551E /* Main.storyboard */, 95 | 36D10B651B89D6540085551E /* Images.xcassets */, 96 | 36D10B671B89D6540085551E /* LaunchScreen.xib */, 97 | 36D10B581B89D6540085551E /* Supporting Files */, 98 | ); 99 | path = OpenCV; 100 | sourceTree = ""; 101 | }; 102 | 36D10B581B89D6540085551E /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 36D10B821B89F1030085551E /* haarcascade_frontalface_alt.xml */, 106 | 36D10B591B89D6540085551E /* Info.plist */, 107 | 36D10B5A1B89D6540085551E /* main.m */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | 36D10B711B89D6540085551E /* OpenCVTests */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 36D10B741B89D6540085551E /* OpenCVTests.m */, 116 | 36D10B721B89D6540085551E /* Supporting Files */, 117 | ); 118 | path = OpenCVTests; 119 | sourceTree = ""; 120 | }; 121 | 36D10B721B89D6540085551E /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 36D10B731B89D6540085551E /* Info.plist */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | 36D10B541B89D6540085551E /* OpenCV */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = 36D10B781B89D6540085551E /* Build configuration list for PBXNativeTarget "OpenCV" */; 135 | buildPhases = ( 136 | 36D10B511B89D6540085551E /* Sources */, 137 | 36D10B521B89D6540085551E /* Frameworks */, 138 | 36D10B531B89D6540085551E /* Resources */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = OpenCV; 145 | productName = OpenCV; 146 | productReference = 36D10B551B89D6540085551E /* OpenCV.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | 36D10B6D1B89D6540085551E /* OpenCVTests */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = 36D10B7B1B89D6540085551E /* Build configuration list for PBXNativeTarget "OpenCVTests" */; 152 | buildPhases = ( 153 | 36D10B6A1B89D6540085551E /* Sources */, 154 | 36D10B6B1B89D6540085551E /* Frameworks */, 155 | 36D10B6C1B89D6540085551E /* Resources */, 156 | ); 157 | buildRules = ( 158 | ); 159 | dependencies = ( 160 | 36D10B701B89D6540085551E /* PBXTargetDependency */, 161 | ); 162 | name = OpenCVTests; 163 | productName = OpenCVTests; 164 | productReference = 36D10B6E1B89D6540085551E /* OpenCVTests.xctest */; 165 | productType = "com.apple.product-type.bundle.unit-test"; 166 | }; 167 | /* End PBXNativeTarget section */ 168 | 169 | /* Begin PBXProject section */ 170 | 36D10B4D1B89D6540085551E /* Project object */ = { 171 | isa = PBXProject; 172 | attributes = { 173 | LastUpgradeCheck = 0640; 174 | ORGANIZATIONNAME = "丁琪"; 175 | TargetAttributes = { 176 | 36D10B541B89D6540085551E = { 177 | CreatedOnToolsVersion = 6.4; 178 | }; 179 | 36D10B6D1B89D6540085551E = { 180 | CreatedOnToolsVersion = 6.4; 181 | TestTargetID = 36D10B541B89D6540085551E; 182 | }; 183 | }; 184 | }; 185 | buildConfigurationList = 36D10B501B89D6540085551E /* Build configuration list for PBXProject "OpenCV" */; 186 | compatibilityVersion = "Xcode 3.2"; 187 | developmentRegion = English; 188 | hasScannedForEncodings = 0; 189 | knownRegions = ( 190 | en, 191 | Base, 192 | ); 193 | mainGroup = 36D10B4C1B89D6540085551E; 194 | productRefGroup = 36D10B561B89D6540085551E /* Products */; 195 | projectDirPath = ""; 196 | projectRoot = ""; 197 | targets = ( 198 | 36D10B541B89D6540085551E /* OpenCV */, 199 | 36D10B6D1B89D6540085551E /* OpenCVTests */, 200 | ); 201 | }; 202 | /* End PBXProject section */ 203 | 204 | /* Begin PBXResourcesBuildPhase section */ 205 | 36D10B531B89D6540085551E /* Resources */ = { 206 | isa = PBXResourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 36D10B641B89D6540085551E /* Main.storyboard in Resources */, 210 | 36D10B691B89D6540085551E /* LaunchScreen.xib in Resources */, 211 | 36D10B831B89F1030085551E /* haarcascade_frontalface_alt.xml in Resources */, 212 | 36D10B661B89D6540085551E /* Images.xcassets in Resources */, 213 | ); 214 | runOnlyForDeploymentPostprocessing = 0; 215 | }; 216 | 36D10B6C1B89D6540085551E /* Resources */ = { 217 | isa = PBXResourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXResourcesBuildPhase section */ 224 | 225 | /* Begin PBXSourcesBuildPhase section */ 226 | 36D10B511B89D6540085551E /* Sources */ = { 227 | isa = PBXSourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | 36D10B611B89D6540085551E /* ViewController.mm in Sources */, 231 | 36D10B5E1B89D6540085551E /* AppDelegate.m in Sources */, 232 | 36D10B5B1B89D6540085551E /* main.m in Sources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | 36D10B6A1B89D6540085551E /* Sources */ = { 237 | isa = PBXSourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | 36D10B751B89D6540085551E /* OpenCVTests.m in Sources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | /* End PBXSourcesBuildPhase section */ 245 | 246 | /* Begin PBXTargetDependency section */ 247 | 36D10B701B89D6540085551E /* PBXTargetDependency */ = { 248 | isa = PBXTargetDependency; 249 | target = 36D10B541B89D6540085551E /* OpenCV */; 250 | targetProxy = 36D10B6F1B89D6540085551E /* PBXContainerItemProxy */; 251 | }; 252 | /* End PBXTargetDependency section */ 253 | 254 | /* Begin PBXVariantGroup section */ 255 | 36D10B621B89D6540085551E /* Main.storyboard */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | 36D10B631B89D6540085551E /* Base */, 259 | ); 260 | name = Main.storyboard; 261 | sourceTree = ""; 262 | }; 263 | 36D10B671B89D6540085551E /* LaunchScreen.xib */ = { 264 | isa = PBXVariantGroup; 265 | children = ( 266 | 36D10B681B89D6540085551E /* Base */, 267 | ); 268 | name = LaunchScreen.xib; 269 | sourceTree = ""; 270 | }; 271 | /* End PBXVariantGroup section */ 272 | 273 | /* Begin XCBuildConfiguration section */ 274 | 36D10B761B89D6540085551E /* Debug */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ALWAYS_SEARCH_USER_PATHS = NO; 278 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 279 | CLANG_CXX_LIBRARY = "libc++"; 280 | CLANG_ENABLE_MODULES = YES; 281 | CLANG_ENABLE_OBJC_ARC = YES; 282 | CLANG_WARN_BOOL_CONVERSION = YES; 283 | CLANG_WARN_CONSTANT_CONVERSION = YES; 284 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 285 | CLANG_WARN_EMPTY_BODY = YES; 286 | CLANG_WARN_ENUM_CONVERSION = YES; 287 | CLANG_WARN_INT_CONVERSION = YES; 288 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 289 | CLANG_WARN_UNREACHABLE_CODE = YES; 290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 292 | COPY_PHASE_STRIP = NO; 293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 294 | ENABLE_STRICT_OBJC_MSGSEND = YES; 295 | GCC_C_LANGUAGE_STANDARD = gnu99; 296 | GCC_DYNAMIC_NO_PIC = NO; 297 | GCC_NO_COMMON_BLOCKS = YES; 298 | GCC_OPTIMIZATION_LEVEL = 0; 299 | GCC_PREPROCESSOR_DEFINITIONS = ( 300 | "DEBUG=1", 301 | "$(inherited)", 302 | ); 303 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 304 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 305 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 306 | GCC_WARN_UNDECLARED_SELECTOR = YES; 307 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 308 | GCC_WARN_UNUSED_FUNCTION = YES; 309 | GCC_WARN_UNUSED_VARIABLE = YES; 310 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 311 | MTL_ENABLE_DEBUG_INFO = YES; 312 | ONLY_ACTIVE_ARCH = YES; 313 | SDKROOT = iphoneos; 314 | TARGETED_DEVICE_FAMILY = "1,2"; 315 | }; 316 | name = Debug; 317 | }; 318 | 36D10B771B89D6540085551E /* Release */ = { 319 | isa = XCBuildConfiguration; 320 | buildSettings = { 321 | ALWAYS_SEARCH_USER_PATHS = NO; 322 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 323 | CLANG_CXX_LIBRARY = "libc++"; 324 | CLANG_ENABLE_MODULES = YES; 325 | CLANG_ENABLE_OBJC_ARC = YES; 326 | CLANG_WARN_BOOL_CONVERSION = YES; 327 | CLANG_WARN_CONSTANT_CONVERSION = YES; 328 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 329 | CLANG_WARN_EMPTY_BODY = YES; 330 | CLANG_WARN_ENUM_CONVERSION = YES; 331 | CLANG_WARN_INT_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_UNREACHABLE_CODE = YES; 334 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 335 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 336 | COPY_PHASE_STRIP = NO; 337 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 338 | ENABLE_NS_ASSERTIONS = NO; 339 | ENABLE_STRICT_OBJC_MSGSEND = YES; 340 | GCC_C_LANGUAGE_STANDARD = gnu99; 341 | GCC_NO_COMMON_BLOCKS = YES; 342 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 343 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 344 | GCC_WARN_UNDECLARED_SELECTOR = YES; 345 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 346 | GCC_WARN_UNUSED_FUNCTION = YES; 347 | GCC_WARN_UNUSED_VARIABLE = YES; 348 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 349 | MTL_ENABLE_DEBUG_INFO = NO; 350 | SDKROOT = iphoneos; 351 | TARGETED_DEVICE_FAMILY = "1,2"; 352 | VALIDATE_PRODUCT = YES; 353 | }; 354 | name = Release; 355 | }; 356 | 36D10B791B89D6540085551E /* Debug */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 360 | FRAMEWORK_SEARCH_PATHS = ( 361 | "$(inherited)", 362 | /Users/teiki/Downloads, 363 | ); 364 | INFOPLIST_FILE = OpenCV/Info.plist; 365 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | }; 368 | name = Debug; 369 | }; 370 | 36D10B7A1B89D6540085551E /* Release */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | FRAMEWORK_SEARCH_PATHS = ( 375 | "$(inherited)", 376 | /Users/teiki/Downloads, 377 | ); 378 | INFOPLIST_FILE = OpenCV/Info.plist; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 380 | PRODUCT_NAME = "$(TARGET_NAME)"; 381 | }; 382 | name = Release; 383 | }; 384 | 36D10B7C1B89D6540085551E /* Debug */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | BUNDLE_LOADER = "$(TEST_HOST)"; 388 | FRAMEWORK_SEARCH_PATHS = ( 389 | "$(SDKROOT)/Developer/Library/Frameworks", 390 | "$(inherited)", 391 | ); 392 | GCC_PREPROCESSOR_DEFINITIONS = ( 393 | "DEBUG=1", 394 | "$(inherited)", 395 | ); 396 | INFOPLIST_FILE = OpenCVTests/Info.plist; 397 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OpenCV.app/OpenCV"; 400 | }; 401 | name = Debug; 402 | }; 403 | 36D10B7D1B89D6540085551E /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | BUNDLE_LOADER = "$(TEST_HOST)"; 407 | FRAMEWORK_SEARCH_PATHS = ( 408 | "$(SDKROOT)/Developer/Library/Frameworks", 409 | "$(inherited)", 410 | ); 411 | INFOPLIST_FILE = OpenCVTests/Info.plist; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 413 | PRODUCT_NAME = "$(TARGET_NAME)"; 414 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OpenCV.app/OpenCV"; 415 | }; 416 | name = Release; 417 | }; 418 | /* End XCBuildConfiguration section */ 419 | 420 | /* Begin XCConfigurationList section */ 421 | 36D10B501B89D6540085551E /* Build configuration list for PBXProject "OpenCV" */ = { 422 | isa = XCConfigurationList; 423 | buildConfigurations = ( 424 | 36D10B761B89D6540085551E /* Debug */, 425 | 36D10B771B89D6540085551E /* Release */, 426 | ); 427 | defaultConfigurationIsVisible = 0; 428 | defaultConfigurationName = Release; 429 | }; 430 | 36D10B781B89D6540085551E /* Build configuration list for PBXNativeTarget "OpenCV" */ = { 431 | isa = XCConfigurationList; 432 | buildConfigurations = ( 433 | 36D10B791B89D6540085551E /* Debug */, 434 | 36D10B7A1B89D6540085551E /* Release */, 435 | ); 436 | defaultConfigurationIsVisible = 0; 437 | }; 438 | 36D10B7B1B89D6540085551E /* Build configuration list for PBXNativeTarget "OpenCVTests" */ = { 439 | isa = XCConfigurationList; 440 | buildConfigurations = ( 441 | 36D10B7C1B89D6540085551E /* Debug */, 442 | 36D10B7D1B89D6540085551E /* Release */, 443 | ); 444 | defaultConfigurationIsVisible = 0; 445 | }; 446 | /* End XCConfigurationList section */ 447 | }; 448 | rootObject = 36D10B4D1B89D6540085551E /* Project object */; 449 | } 450 | -------------------------------------------------------------------------------- /OpenCV.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OpenCV.xcodeproj/project.xcworkspace/xcuserdata/teiki.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinghing/OpenCV/da1ef9d261392f765ed3264f11880e4a82ccec38/OpenCV.xcodeproj/project.xcworkspace/xcuserdata/teiki.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /OpenCV.xcodeproj/xcuserdata/teiki.xcuserdatad/xcschemes/OpenCV.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /OpenCV.xcodeproj/xcuserdata/teiki.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | OpenCV.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 36D10B541B89D6540085551E 16 | 17 | primary 18 | 19 | 20 | 36D10B6D1B89D6540085551E 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /OpenCV/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OpenCV 4 | // 5 | // Created by 丁琪 on 15/8/23. 6 | // Copyright (c) 2015年 丁琪. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /OpenCV/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // OpenCV 4 | // 5 | // Created by 丁琪 on 15/8/23. 6 | // Copyright (c) 2015年 丁琪. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /OpenCV/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /OpenCV/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 | -------------------------------------------------------------------------------- /OpenCV/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /OpenCV/Images.xcassets/lena1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "lena1.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /OpenCV/Images.xcassets/lena1.imageset/lena1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinghing/OpenCV/da1ef9d261392f765ed3264f11880e4a82ccec38/OpenCV/Images.xcassets/lena1.imageset/lena1.png -------------------------------------------------------------------------------- /OpenCV/Images.xcassets/lenna.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "lenna.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /OpenCV/Images.xcassets/lenna.imageset/lenna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dinghing/OpenCV/da1ef9d261392f765ed3264f11880e4a82ccec38/OpenCV/Images.xcassets/lenna.imageset/lenna.png -------------------------------------------------------------------------------- /OpenCV/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | ------.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /OpenCV/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OpenCV 4 | // 5 | // Created by 丁琪 on 15/8/23. 6 | // Copyright (c) 2015年 丁琪. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /OpenCV/ViewController.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OpenCV 4 | // 5 | // Created by 丁琪 on 15/8/23. 6 | // Copyright (c) 2015年 丁琪. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | #import 12 | #import 13 | 14 | @interface ViewController () 15 | { 16 | cv::CascadeClassifier faceDetector; 17 | } 18 | @property (weak, nonatomic) IBOutlet UIImageView *imgView; 19 | 20 | @end 21 | 22 | @implementation ViewController 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | // 添加xml文件 27 | NSString* cascadePath = [[NSBundle mainBundle] 28 | pathForResource:@"haarcascade_frontalface_alt" 29 | ofType:@"xml"]; 30 | faceDetector.load([cascadePath UTF8String]); 31 | 32 | 33 | //上传图片 34 | UIImage *image = [UIImage imageNamed:@"lena1.png"]; 35 | cv::Mat faceImage; 36 | UIImageToMat(image, faceImage); 37 | 38 | // 转为灰度 39 | cv::Mat gray; 40 | cvtColor(faceImage, gray, CV_BGR2GRAY); 41 | 42 | // 检测人脸并储存 43 | std::vectorfaces; 44 | faceDetector.detectMultiScale(gray, faces,1.1,2,0|CV_HAAR_SCALE_IMAGE,cv::Size(30,30)); 45 | 46 | // 在每个人脸上画一个红色四方形 47 | for(unsigned int i= 0;i < faces.size();i++) 48 | { 49 | const cv::Rect& face = faces[i]; 50 | cv::Point tl(face.x,face.y); 51 | cv::Point br = tl + cv::Point(face.width,face.height); 52 | 53 | // 四方形的画法 54 | cv::Scalar magenta = cv::Scalar(255, 0, 255); 55 | cv::rectangle(faceImage, tl, br, magenta, 4, 8, 0); 56 | } 57 | 58 | self.imgView.image = MatToUIImage(faceImage); 59 | } 60 | 61 | - (void)didReceiveMemoryWarning { 62 | [super didReceiveMemoryWarning]; 63 | // Dispose of any resources that can be recreated. 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /OpenCV/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OpenCV 4 | // 5 | // Created by 丁琪 on 15/8/23. 6 | // Copyright (c) 2015年 丁琪. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /OpenCVTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | ------.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /OpenCVTests/OpenCVTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // OpenCVTests.m 3 | // OpenCVTests 4 | // 5 | // Created by 丁琪 on 15/8/23. 6 | // Copyright (c) 2015年 丁琪. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface OpenCVTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation OpenCVTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenCV 2 | ## this is a sample code for OpenCV on iOS 3 | you can download it for test 4 | --------------------------------------------------------------------------------