提交 0b38fb11 编写于 作者: A Alexander Shishkov

Initial commit

上级 9737999c
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
83E816F61736583E0054AED6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E816F51736583E0054AED6 /* UIKit.framework */; };
83E816F81736583E0054AED6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E816F71736583E0054AED6 /* Foundation.framework */; };
83E816FA1736583E0054AED6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E816F91736583E0054AED6 /* CoreGraphics.framework */; };
83E817001736583E0054AED6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 83E816FE1736583E0054AED6 /* InfoPlist.strings */; };
83E817021736583E0054AED6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E817011736583E0054AED6 /* main.m */; };
83E817061736583E0054AED6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E817051736583E0054AED6 /* AppDelegate.m */; };
83E817081736583E0054AED6 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 83E817071736583E0054AED6 /* Default.png */; };
83E8170A1736583E0054AED6 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 83E817091736583E0054AED6 /* Default@2x.png */; };
83E8170C1736583F0054AED6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 83E8170B1736583F0054AED6 /* Default-568h@2x.png */; };
83E8170F1736583F0054AED6 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 83E8170D1736583F0054AED6 /* MainStoryboard_iPhone.storyboard */; };
83E817121736583F0054AED6 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 83E817101736583F0054AED6 /* MainStoryboard_iPad.storyboard */; };
83E817151736583F0054AED6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E817141736583F0054AED6 /* ViewController.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
83E816F11736583E0054AED6 /* Chapter01_HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Chapter01_HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };
83E816F51736583E0054AED6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
83E816F71736583E0054AED6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
83E816F91736583E0054AED6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
83E816FD1736583E0054AED6 /* Chapter01_HelloWorld-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Chapter01_HelloWorld-Info.plist"; sourceTree = "<group>"; };
83E816FF1736583E0054AED6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
83E817011736583E0054AED6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
83E817031736583E0054AED6 /* Chapter01_HelloWorld-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Chapter01_HelloWorld-Prefix.pch"; sourceTree = "<group>"; };
83E817041736583E0054AED6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
83E817051736583E0054AED6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
83E817071736583E0054AED6 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
83E817091736583E0054AED6 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
83E8170B1736583F0054AED6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
83E8170E1736583F0054AED6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
83E817111736583F0054AED6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
83E817131736583F0054AED6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
83E817141736583F0054AED6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
83E816EE1736583E0054AED6 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
83E816F61736583E0054AED6 /* UIKit.framework in Frameworks */,
83E816F81736583E0054AED6 /* Foundation.framework in Frameworks */,
83E816FA1736583E0054AED6 /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
83E816E61736583E0054AED6 = {
isa = PBXGroup;
children = (
83E816FB1736583E0054AED6 /* Chapter01_HelloWorld */,
83E816F41736583E0054AED6 /* Frameworks */,
83E816F21736583E0054AED6 /* Products */,
);
sourceTree = "<group>";
};
83E816F21736583E0054AED6 /* Products */ = {
isa = PBXGroup;
children = (
83E816F11736583E0054AED6 /* Chapter01_HelloWorld.app */,
);
name = Products;
sourceTree = "<group>";
};
83E816F41736583E0054AED6 /* Frameworks */ = {
isa = PBXGroup;
children = (
83E816F51736583E0054AED6 /* UIKit.framework */,
83E816F71736583E0054AED6 /* Foundation.framework */,
83E816F91736583E0054AED6 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
83E816FB1736583E0054AED6 /* Chapter01_HelloWorld */ = {
isa = PBXGroup;
children = (
83E817041736583E0054AED6 /* AppDelegate.h */,
83E817051736583E0054AED6 /* AppDelegate.m */,
83E8170D1736583F0054AED6 /* MainStoryboard_iPhone.storyboard */,
83E817101736583F0054AED6 /* MainStoryboard_iPad.storyboard */,
83E817131736583F0054AED6 /* ViewController.h */,
83E817141736583F0054AED6 /* ViewController.m */,
83E816FC1736583E0054AED6 /* Supporting Files */,
);
path = Chapter01_HelloWorld;
sourceTree = "<group>";
};
83E816FC1736583E0054AED6 /* Supporting Files */ = {
isa = PBXGroup;
children = (
83E816FD1736583E0054AED6 /* Chapter01_HelloWorld-Info.plist */,
83E816FE1736583E0054AED6 /* InfoPlist.strings */,
83E817011736583E0054AED6 /* main.m */,
83E817031736583E0054AED6 /* Chapter01_HelloWorld-Prefix.pch */,
83E817071736583E0054AED6 /* Default.png */,
83E817091736583E0054AED6 /* Default@2x.png */,
83E8170B1736583F0054AED6 /* Default-568h@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
83E816F01736583E0054AED6 /* Chapter01_HelloWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 83E817181736583F0054AED6 /* Build configuration list for PBXNativeTarget "Chapter01_HelloWorld" */;
buildPhases = (
83E816ED1736583E0054AED6 /* Sources */,
83E816EE1736583E0054AED6 /* Frameworks */,
83E816EF1736583E0054AED6 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Chapter01_HelloWorld;
productName = Chapter01_HelloWorld;
productReference = 83E816F11736583E0054AED6 /* Chapter01_HelloWorld.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83E816E81736583E0054AED6 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Alexander Shishkov & Kirill Kornyakov";
};
buildConfigurationList = 83E816EB1736583E0054AED6 /* Build configuration list for PBXProject "Chapter01_HelloWorld" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 83E816E61736583E0054AED6;
productRefGroup = 83E816F21736583E0054AED6 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
83E816F01736583E0054AED6 /* Chapter01_HelloWorld */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
83E816EF1736583E0054AED6 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
83E817001736583E0054AED6 /* InfoPlist.strings in Resources */,
83E817081736583E0054AED6 /* Default.png in Resources */,
83E8170A1736583E0054AED6 /* Default@2x.png in Resources */,
83E8170C1736583F0054AED6 /* Default-568h@2x.png in Resources */,
83E8170F1736583F0054AED6 /* MainStoryboard_iPhone.storyboard in Resources */,
83E817121736583F0054AED6 /* MainStoryboard_iPad.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
83E816ED1736583E0054AED6 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
83E817021736583E0054AED6 /* main.m in Sources */,
83E817061736583E0054AED6 /* AppDelegate.m in Sources */,
83E817151736583F0054AED6 /* ViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
83E816FE1736583E0054AED6 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
83E816FF1736583E0054AED6 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
83E8170D1736583F0054AED6 /* MainStoryboard_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
83E8170E1736583F0054AED6 /* en */,
);
name = MainStoryboard_iPhone.storyboard;
sourceTree = "<group>";
};
83E817101736583F0054AED6 /* MainStoryboard_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
83E817111736583F0054AED6 /* en */,
);
name = MainStoryboard_iPad.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
83E817161736583F0054AED6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
83E817171736583F0054AED6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
83E817191736583F0054AED6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter01_HelloWorld/Chapter01_HelloWorld-Prefix.pch";
INFOPLIST_FILE = "Chapter01_HelloWorld/Chapter01_HelloWorld-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
83E8171A1736583F0054AED6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter01_HelloWorld/Chapter01_HelloWorld-Prefix.pch";
INFOPLIST_FILE = "Chapter01_HelloWorld/Chapter01_HelloWorld-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
83E816EB1736583E0054AED6 /* Build configuration list for PBXProject "Chapter01_HelloWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83E817161736583F0054AED6 /* Debug */,
83E817171736583F0054AED6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83E817181736583F0054AED6 /* Build configuration list for PBXNativeTarget "Chapter01_HelloWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83E817191736583F0054AED6 /* Debug */,
83E8171A1736583F0054AED6 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 83E816E81736583E0054AED6 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Chapter01_HelloWorld.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>297C9A26-93D6-4486-BFC7-A4BDE3258613</string>
<key>IDESourceControlProjectName</key>
<string>Chapter01_HelloWorld</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>A0B627FE-A569-4C91-83C2-9BE1D651D27C</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>book/3848_sources/Chapter01_HelloWorld/Chapter01_HelloWorld.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>A0B627FE-A569-4C91-83C2-9BE1D651D27C</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>A0B627FE-A569-4C91-83C2-9BE1D651D27C</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>A0B627FE-A569-4C91-83C2-9BE1D651D27C</string>
<key>IDESourceControlWCCName</key>
<string>packt</string>
</dict>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83E816F01736583E0054AED6"
BuildableName = "Chapter01_HelloWorld.app"
BlueprintName = "Chapter01_HelloWorld"
ReferencedContainer = "container:Chapter01_HelloWorld.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83E816F01736583E0054AED6"
BuildableName = "Chapter01_HelloWorld.app"
BlueprintName = "Chapter01_HelloWorld"
ReferencedContainer = "container:Chapter01_HelloWorld.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83E816F01736583E0054AED6"
BuildableName = "Chapter01_HelloWorld.app"
BlueprintName = "Chapter01_HelloWorld"
ReferencedContainer = "container:Chapter01_HelloWorld.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83E816F01736583E0054AED6"
BuildableName = "Chapter01_HelloWorld.app"
BlueprintName = "Chapter01_HelloWorld"
ReferencedContainer = "container:Chapter01_HelloWorld.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Chapter01_HelloWorld.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>83E816F01736583E0054AED6</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
/*****************************************************************************
* AppDelegate.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 1 of the "OpenCV for iOS" book
*
* Getting started with iOS, helps you to set up your development environment
* and run your first "Hello World" iOS application.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow* window;
@end
/*****************************************************************************
* AppDelegate.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 1 of the "OpenCV for iOS" book
*
* Getting started with iOS, helps you to set up your development environment
* and run your first "Hello World" iOS application.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "AppDelegate.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// 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.
// 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.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// 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.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// 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.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>OpenCV.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
<string>MainStoryboard_iPad</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// Prefix header for all source files of the 'Chapter01_HelloWorld' target in the 'Chapter01_HelloWorld' project
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
/*****************************************************************************
* ViewController.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 1 of the "OpenCV for iOS" book
*
* Getting started with iOS, helps you to set up your development environment
* and run your first "Hello World" iOS application.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
/*****************************************************************************
* ViewController.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 1 of the "OpenCV for iOS" book
*
* Getting started with iOS, helps you to set up your development environment
* and run your first "Hello World" iOS application.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Console output
NSLog(@"Hello, World!");
// Alert window
UIAlertView *alert = [UIAlertView alloc];
alert = [alert initWithTitle:@"Hey there!"
message:@"Welcome to OpenCV on iOS \
development community"
delegate:nil
cancelButtonTitle:@"Continue"
otherButtonTitles:nil];
[alert show];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="4">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="8eh-61-SL2"/>
<viewControllerLayoutGuide type="bottom" id="LWL-dK-SCf"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="5">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="5">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="i15-rz-g5V"/>
<viewControllerLayoutGuide type="bottom" id="017-yS-q6Q"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="3">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
/*****************************************************************************
* main.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 1 of the "OpenCV for iOS" book
*
* Getting started with iOS, helps you to set up your development environment
* and run your first "Hello World" iOS application.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
8360CCF11736646F00A0F806 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CCF01736646F00A0F806 /* UIKit.framework */; };
8360CCF31736646F00A0F806 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CCF21736646F00A0F806 /* Foundation.framework */; };
8360CCF51736646F00A0F806 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CCF41736646F00A0F806 /* CoreGraphics.framework */; };
8360CCFB1736646F00A0F806 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8360CCF91736646F00A0F806 /* InfoPlist.strings */; };
8360CCFD1736646F00A0F806 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CCFC1736646F00A0F806 /* main.m */; };
8360CD011736646F00A0F806 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CD001736646F00A0F806 /* AppDelegate.m */; };
8360CD031736646F00A0F806 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD021736646F00A0F806 /* Default.png */; };
8360CD051736646F00A0F806 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD041736646F00A0F806 /* Default@2x.png */; };
8360CD071736646F00A0F806 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD061736646F00A0F806 /* Default-568h@2x.png */; };
8360CD0A1736646F00A0F806 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD081736646F00A0F806 /* MainStoryboard_iPhone.storyboard */; };
8360CD0D1736646F00A0F806 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD0B1736646F00A0F806 /* MainStoryboard_iPad.storyboard */; };
8360CD101736646F00A0F806 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CD0F1736646F00A0F806 /* ViewController.m */; };
8360CD17173666DA00A0F806 /* lena.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD16173666DA00A0F806 /* lena.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
8360CCEC1736646F00A0F806 /* Chapter02_DisplayingImage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Chapter02_DisplayingImage.app; sourceTree = BUILT_PRODUCTS_DIR; };
8360CCF01736646F00A0F806 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
8360CCF21736646F00A0F806 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
8360CCF41736646F00A0F806 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
8360CCF81736646F00A0F806 /* Chapter02_DisplayingImage-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Chapter02_DisplayingImage-Info.plist"; sourceTree = "<group>"; };
8360CCFA1736646F00A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8360CCFC1736646F00A0F806 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8360CCFE1736646F00A0F806 /* Chapter02_DisplayingImage-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Chapter02_DisplayingImage-Prefix.pch"; sourceTree = "<group>"; };
8360CCFF1736646F00A0F806 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
8360CD001736646F00A0F806 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8360CD021736646F00A0F806 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
8360CD041736646F00A0F806 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
8360CD061736646F00A0F806 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
8360CD091736646F00A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
8360CD0C1736646F00A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
8360CD0E1736646F00A0F806 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
8360CD0F1736646F00A0F806 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
8360CD16173666DA00A0F806 /* lena.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lena.png; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8360CCE91736646F00A0F806 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8360CCF11736646F00A0F806 /* UIKit.framework in Frameworks */,
8360CCF31736646F00A0F806 /* Foundation.framework in Frameworks */,
8360CCF51736646F00A0F806 /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8360CCE11736646F00A0F806 = {
isa = PBXGroup;
children = (
8360CCF61736646F00A0F806 /* Chapter02_DisplayingImage */,
8360CCEF1736646F00A0F806 /* Frameworks */,
8360CCED1736646F00A0F806 /* Products */,
);
sourceTree = "<group>";
};
8360CCED1736646F00A0F806 /* Products */ = {
isa = PBXGroup;
children = (
8360CCEC1736646F00A0F806 /* Chapter02_DisplayingImage.app */,
);
name = Products;
sourceTree = "<group>";
};
8360CCEF1736646F00A0F806 /* Frameworks */ = {
isa = PBXGroup;
children = (
8360CCF01736646F00A0F806 /* UIKit.framework */,
8360CCF21736646F00A0F806 /* Foundation.framework */,
8360CCF41736646F00A0F806 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
8360CCF61736646F00A0F806 /* Chapter02_DisplayingImage */ = {
isa = PBXGroup;
children = (
8360CCFF1736646F00A0F806 /* AppDelegate.h */,
8360CD001736646F00A0F806 /* AppDelegate.m */,
8360CD081736646F00A0F806 /* MainStoryboard_iPhone.storyboard */,
8360CD0B1736646F00A0F806 /* MainStoryboard_iPad.storyboard */,
8360CD0E1736646F00A0F806 /* ViewController.h */,
8360CD0F1736646F00A0F806 /* ViewController.m */,
8360CCF71736646F00A0F806 /* Supporting Files */,
);
path = Chapter02_DisplayingImage;
sourceTree = "<group>";
};
8360CCF71736646F00A0F806 /* Supporting Files */ = {
isa = PBXGroup;
children = (
8360CD16173666DA00A0F806 /* lena.png */,
8360CCF81736646F00A0F806 /* Chapter02_DisplayingImage-Info.plist */,
8360CCF91736646F00A0F806 /* InfoPlist.strings */,
8360CCFC1736646F00A0F806 /* main.m */,
8360CCFE1736646F00A0F806 /* Chapter02_DisplayingImage-Prefix.pch */,
8360CD021736646F00A0F806 /* Default.png */,
8360CD041736646F00A0F806 /* Default@2x.png */,
8360CD061736646F00A0F806 /* Default-568h@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8360CCEB1736646F00A0F806 /* Chapter02_DisplayingImage */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8360CD131736646F00A0F806 /* Build configuration list for PBXNativeTarget "Chapter02_DisplayingImage" */;
buildPhases = (
8360CCE81736646F00A0F806 /* Sources */,
8360CCE91736646F00A0F806 /* Frameworks */,
8360CCEA1736646F00A0F806 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Chapter02_DisplayingImage;
productName = Chapter02_DisplayingImage;
productReference = 8360CCEC1736646F00A0F806 /* Chapter02_DisplayingImage.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
8360CCE31736646F00A0F806 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Alexander Shishkov & Kirill Kornyakov";
};
buildConfigurationList = 8360CCE61736646F00A0F806 /* Build configuration list for PBXProject "Chapter02_DisplayingImage" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 8360CCE11736646F00A0F806;
productRefGroup = 8360CCED1736646F00A0F806 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8360CCEB1736646F00A0F806 /* Chapter02_DisplayingImage */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8360CCEA1736646F00A0F806 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8360CCFB1736646F00A0F806 /* InfoPlist.strings in Resources */,
8360CD031736646F00A0F806 /* Default.png in Resources */,
8360CD051736646F00A0F806 /* Default@2x.png in Resources */,
8360CD071736646F00A0F806 /* Default-568h@2x.png in Resources */,
8360CD0A1736646F00A0F806 /* MainStoryboard_iPhone.storyboard in Resources */,
8360CD0D1736646F00A0F806 /* MainStoryboard_iPad.storyboard in Resources */,
8360CD17173666DA00A0F806 /* lena.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8360CCE81736646F00A0F806 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8360CCFD1736646F00A0F806 /* main.m in Sources */,
8360CD011736646F00A0F806 /* AppDelegate.m in Sources */,
8360CD101736646F00A0F806 /* ViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
8360CCF91736646F00A0F806 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
8360CCFA1736646F00A0F806 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
8360CD081736646F00A0F806 /* MainStoryboard_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
8360CD091736646F00A0F806 /* en */,
);
name = MainStoryboard_iPhone.storyboard;
sourceTree = "<group>";
};
8360CD0B1736646F00A0F806 /* MainStoryboard_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
8360CD0C1736646F00A0F806 /* en */,
);
name = MainStoryboard_iPad.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
8360CD111736646F00A0F806 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
8360CD121736646F00A0F806 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
8360CD141736646F00A0F806 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter02_DisplayingImage/Chapter02_DisplayingImage-Prefix.pch";
INFOPLIST_FILE = "Chapter02_DisplayingImage/Chapter02_DisplayingImage-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
8360CD151736646F00A0F806 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter02_DisplayingImage/Chapter02_DisplayingImage-Prefix.pch";
INFOPLIST_FILE = "Chapter02_DisplayingImage/Chapter02_DisplayingImage-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
8360CCE61736646F00A0F806 /* Build configuration list for PBXProject "Chapter02_DisplayingImage" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8360CD111736646F00A0F806 /* Debug */,
8360CD121736646F00A0F806 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8360CD131736646F00A0F806 /* Build configuration list for PBXNativeTarget "Chapter02_DisplayingImage" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8360CD141736646F00A0F806 /* Debug */,
8360CD151736646F00A0F806 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 8360CCE31736646F00A0F806 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Chapter02_DisplayingImage.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>79CF8EB5-4641-4F85-BF79-7419E3B23BA5</string>
<key>IDESourceControlProjectName</key>
<string>Chapter02_DisplayingImage</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>D4EEFB5D-ED7C-42B9-B82B-8964CBB02243</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>book/3848_sources/Chapter02_DisplayingImage/Chapter02_DisplayingImage.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>D4EEFB5D-ED7C-42B9-B82B-8964CBB02243</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>D4EEFB5D-ED7C-42B9-B82B-8964CBB02243</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>D4EEFB5D-ED7C-42B9-B82B-8964CBB02243</string>
<key>IDESourceControlWCCName</key>
<string>packt</string>
</dict>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CCEB1736646F00A0F806"
BuildableName = "Chapter02_DisplayingImage.app"
BlueprintName = "Chapter02_DisplayingImage"
ReferencedContainer = "container:Chapter02_DisplayingImage.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CCEB1736646F00A0F806"
BuildableName = "Chapter02_DisplayingImage.app"
BlueprintName = "Chapter02_DisplayingImage"
ReferencedContainer = "container:Chapter02_DisplayingImage.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CCEB1736646F00A0F806"
BuildableName = "Chapter02_DisplayingImage.app"
BlueprintName = "Chapter02_DisplayingImage"
ReferencedContainer = "container:Chapter02_DisplayingImage.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CCEB1736646F00A0F806"
BuildableName = "Chapter02_DisplayingImage.app"
BlueprintName = "Chapter02_DisplayingImage"
ReferencedContainer = "container:Chapter02_DisplayingImage.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Chapter02_DisplayingImage.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>8360CCEB1736646F00A0F806</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
/*****************************************************************************
* AppDelegate.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 2 of the "OpenCV for iOS" book
*
* Displaying Image from Resources introduces you to basic GUI concepts on iOS, and covers loading of an
* image from resources and displaying it on the screen.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow* window;
@end
/*****************************************************************************
* AppDelegate.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 2 of the "OpenCV for iOS" book
*
* Displaying Image from Resources introduces you to basic GUI concepts on iOS, and covers loading of an
* image from resources and displaying it on the screen.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "AppDelegate.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// 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.
// 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.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// 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.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// 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.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>OpenCV.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
<string>MainStoryboard_iPad</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// Prefix header for all source files of the 'Chapter02_DisplayingImage' target in the 'Chapter02_DisplayingImage' project
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
/*****************************************************************************
* ViewController.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 2 of the "OpenCV for iOS" book
*
* Displaying Image from Resources introduces you to basic GUI concepts on iOS, and covers loading of an
* image from resources and displaying it on the screen.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
UIImage* image;
}
@property (nonatomic, weak) IBOutlet UIImageView* imageView;
@end
/*****************************************************************************
* ViewController.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 2 of the "OpenCV for iOS" book
*
* Displaying Image from Resources introduces you to basic GUI concepts on iOS, and covers loading of an
* image from resources and displaying it on the screen.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize imageView;
- (void)viewDidLoad
{
[super viewDidLoad];
// Read the image
image = [UIImage imageNamed:@"lena.png"];
if (image != nil)
imageView.image = image;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="4">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="FjD-63-rVs"/>
<viewControllerLayoutGuide type="bottom" id="Ao0-Eh-SFM"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="5">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="za4-JN-g2e">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="za4-JN-g2e" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="9Al-4j-opH"/>
<constraint firstItem="za4-JN-g2e" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="FcX-VB-aEt"/>
<constraint firstItem="za4-JN-g2e" firstAttribute="bottom" secondItem="5" secondAttribute="bottom" id="Ksz-eD-Zwy"/>
<constraint firstItem="za4-JN-g2e" firstAttribute="top" secondItem="5" secondAttribute="top" id="jyY-SK-sEm"/>
</constraints>
</view>
<connections>
<outlet property="imageView" destination="za4-JN-g2e" id="VJw-OI-fII"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="5">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="5O3-0K-mS1"/>
<viewControllerLayoutGuide type="bottom" id="G7U-V3-V3K"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="3">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="j6M-P5-PqG">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="j6M-P5-PqG" firstAttribute="bottom" secondItem="3" secondAttribute="bottom" id="4yH-d3-4FQ"/>
<constraint firstItem="j6M-P5-PqG" firstAttribute="top" secondItem="3" secondAttribute="top" id="Jzw-wt-itD"/>
<constraint firstItem="j6M-P5-PqG" firstAttribute="trailing" secondItem="3" secondAttribute="trailing" id="N5Y-sZ-wZV"/>
<constraint firstItem="j6M-P5-PqG" firstAttribute="leading" secondItem="3" secondAttribute="leading" id="PWc-bY-LRX"/>
</constraints>
</view>
<connections>
<outlet property="imageView" destination="j6M-P5-PqG" id="BFq-kC-CL2"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
/*****************************************************************************
* main.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 2 of the "OpenCV for iOS" book
*
* Displaying Image from Resources introduces you to basic GUI concepts on iOS, and covers loading of an
* image from resources and displaying it on the screen.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
8360CD5D1736684E00A0F806 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CD5C1736684E00A0F806 /* UIKit.framework */; };
8360CD5F1736684E00A0F806 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CD5E1736684E00A0F806 /* Foundation.framework */; };
8360CD611736684E00A0F806 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CD601736684E00A0F806 /* CoreGraphics.framework */; };
8360CD671736684E00A0F806 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD651736684E00A0F806 /* InfoPlist.strings */; };
8360CD691736684E00A0F806 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CD681736684E00A0F806 /* main.m */; };
8360CD6D1736684E00A0F806 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CD6C1736684E00A0F806 /* AppDelegate.m */; };
8360CD6F1736684E00A0F806 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD6E1736684E00A0F806 /* Default.png */; };
8360CD711736684E00A0F806 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD701736684E00A0F806 /* Default@2x.png */; };
8360CD731736684E00A0F806 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD721736684E00A0F806 /* Default-568h@2x.png */; };
8360CD761736684E00A0F806 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD741736684E00A0F806 /* MainStoryboard_iPhone.storyboard */; };
8360CD791736684E00A0F806 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD771736684E00A0F806 /* MainStoryboard_iPad.storyboard */; };
8360CD7C1736684E00A0F806 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CD7B1736684E00A0F806 /* ViewController.m */; };
8360CD831736685B00A0F806 /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CD821736685B00A0F806 /* opencv2.framework */; };
8360CD851736692500A0F806 /* lena.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD841736692500A0F806 /* lena.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
8360CD581736684E00A0F806 /* Chapter03_LinkingOpenCV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Chapter03_LinkingOpenCV.app; sourceTree = BUILT_PRODUCTS_DIR; };
8360CD5C1736684E00A0F806 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
8360CD5E1736684E00A0F806 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
8360CD601736684E00A0F806 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
8360CD641736684E00A0F806 /* Chapter03_LinkingOpenCV-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Chapter03_LinkingOpenCV-Info.plist"; sourceTree = "<group>"; };
8360CD661736684E00A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8360CD681736684E00A0F806 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8360CD6A1736684E00A0F806 /* Chapter03_LinkingOpenCV-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Chapter03_LinkingOpenCV-Prefix.pch"; sourceTree = "<group>"; };
8360CD6B1736684E00A0F806 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
8360CD6C1736684E00A0F806 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8360CD6E1736684E00A0F806 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
8360CD701736684E00A0F806 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
8360CD721736684E00A0F806 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
8360CD751736684E00A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
8360CD781736684E00A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
8360CD7A1736684E00A0F806 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
8360CD7B1736684E00A0F806 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
8360CD821736685B00A0F806 /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = opencv2.framework; path = ../opencv2.framework; sourceTree = "<group>"; };
8360CD841736692500A0F806 /* lena.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lena.png; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8360CD551736684D00A0F806 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8360CD5D1736684E00A0F806 /* UIKit.framework in Frameworks */,
8360CD5F1736684E00A0F806 /* Foundation.framework in Frameworks */,
8360CD611736684E00A0F806 /* CoreGraphics.framework in Frameworks */,
8360CD831736685B00A0F806 /* opencv2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8360CD4D1736684D00A0F806 = {
isa = PBXGroup;
children = (
8360CD621736684E00A0F806 /* Chapter03_LinkingOpenCV */,
8360CD5B1736684E00A0F806 /* Frameworks */,
8360CD591736684E00A0F806 /* Products */,
);
sourceTree = "<group>";
};
8360CD591736684E00A0F806 /* Products */ = {
isa = PBXGroup;
children = (
8360CD581736684E00A0F806 /* Chapter03_LinkingOpenCV.app */,
);
name = Products;
sourceTree = "<group>";
};
8360CD5B1736684E00A0F806 /* Frameworks */ = {
isa = PBXGroup;
children = (
8360CD821736685B00A0F806 /* opencv2.framework */,
8360CD5C1736684E00A0F806 /* UIKit.framework */,
8360CD5E1736684E00A0F806 /* Foundation.framework */,
8360CD601736684E00A0F806 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
8360CD621736684E00A0F806 /* Chapter03_LinkingOpenCV */ = {
isa = PBXGroup;
children = (
8360CD6B1736684E00A0F806 /* AppDelegate.h */,
8360CD6C1736684E00A0F806 /* AppDelegate.m */,
8360CD741736684E00A0F806 /* MainStoryboard_iPhone.storyboard */,
8360CD771736684E00A0F806 /* MainStoryboard_iPad.storyboard */,
8360CD7A1736684E00A0F806 /* ViewController.h */,
8360CD7B1736684E00A0F806 /* ViewController.m */,
8360CD631736684E00A0F806 /* Supporting Files */,
);
path = Chapter03_LinkingOpenCV;
sourceTree = "<group>";
};
8360CD631736684E00A0F806 /* Supporting Files */ = {
isa = PBXGroup;
children = (
8360CD841736692500A0F806 /* lena.png */,
8360CD641736684E00A0F806 /* Chapter03_LinkingOpenCV-Info.plist */,
8360CD651736684E00A0F806 /* InfoPlist.strings */,
8360CD681736684E00A0F806 /* main.m */,
8360CD6A1736684E00A0F806 /* Chapter03_LinkingOpenCV-Prefix.pch */,
8360CD6E1736684E00A0F806 /* Default.png */,
8360CD701736684E00A0F806 /* Default@2x.png */,
8360CD721736684E00A0F806 /* Default-568h@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8360CD571736684D00A0F806 /* Chapter03_LinkingOpenCV */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8360CD7F1736684E00A0F806 /* Build configuration list for PBXNativeTarget "Chapter03_LinkingOpenCV" */;
buildPhases = (
8360CD541736684D00A0F806 /* Sources */,
8360CD551736684D00A0F806 /* Frameworks */,
8360CD561736684D00A0F806 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Chapter03_LinkingOpenCV;
productName = Chapter03_LinkingOpenCV;
productReference = 8360CD581736684E00A0F806 /* Chapter03_LinkingOpenCV.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
8360CD4F1736684D00A0F806 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Alexander Shishkov & Kirill Kornyakov";
};
buildConfigurationList = 8360CD521736684D00A0F806 /* Build configuration list for PBXProject "Chapter03_LinkingOpenCV" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 8360CD4D1736684D00A0F806;
productRefGroup = 8360CD591736684E00A0F806 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8360CD571736684D00A0F806 /* Chapter03_LinkingOpenCV */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8360CD561736684D00A0F806 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8360CD671736684E00A0F806 /* InfoPlist.strings in Resources */,
8360CD6F1736684E00A0F806 /* Default.png in Resources */,
8360CD711736684E00A0F806 /* Default@2x.png in Resources */,
8360CD731736684E00A0F806 /* Default-568h@2x.png in Resources */,
8360CD761736684E00A0F806 /* MainStoryboard_iPhone.storyboard in Resources */,
8360CD791736684E00A0F806 /* MainStoryboard_iPad.storyboard in Resources */,
8360CD851736692500A0F806 /* lena.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8360CD541736684D00A0F806 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8360CD691736684E00A0F806 /* main.m in Sources */,
8360CD6D1736684E00A0F806 /* AppDelegate.m in Sources */,
8360CD7C1736684E00A0F806 /* ViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
8360CD651736684E00A0F806 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
8360CD661736684E00A0F806 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
8360CD741736684E00A0F806 /* MainStoryboard_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
8360CD751736684E00A0F806 /* en */,
);
name = MainStoryboard_iPhone.storyboard;
sourceTree = "<group>";
};
8360CD771736684E00A0F806 /* MainStoryboard_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
8360CD781736684E00A0F806 /* en */,
);
name = MainStoryboard_iPad.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
8360CD7D1736684E00A0F806 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
8360CD7E1736684E00A0F806 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
8360CD801736684E00A0F806 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter03_LinkingOpenCV/Chapter03_LinkingOpenCV-Prefix.pch";
INFOPLIST_FILE = "Chapter03_LinkingOpenCV/Chapter03_LinkingOpenCV-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
8360CD811736684E00A0F806 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter03_LinkingOpenCV/Chapter03_LinkingOpenCV-Prefix.pch";
INFOPLIST_FILE = "Chapter03_LinkingOpenCV/Chapter03_LinkingOpenCV-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
8360CD521736684D00A0F806 /* Build configuration list for PBXProject "Chapter03_LinkingOpenCV" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8360CD7D1736684E00A0F806 /* Debug */,
8360CD7E1736684E00A0F806 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8360CD7F1736684E00A0F806 /* Build configuration list for PBXNativeTarget "Chapter03_LinkingOpenCV" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8360CD801736684E00A0F806 /* Debug */,
8360CD811736684E00A0F806 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 8360CD4F1736684D00A0F806 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Chapter03_LinkingOpenCV.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>20317A42-8C0E-4D61-B041-D2C6911093F1</string>
<key>IDESourceControlProjectName</key>
<string>Chapter03_LinkingOpenCV</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>A0B627FE-A569-4C91-83C2-9BE1D651D27C</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>book/3848_sources/Chapter03_LinkingOpenCV/Chapter03_LinkingOpenCV.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>A0B627FE-A569-4C91-83C2-9BE1D651D27C</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>A0B627FE-A569-4C91-83C2-9BE1D651D27C</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>A0B627FE-A569-4C91-83C2-9BE1D651D27C</string>
<key>IDESourceControlWCCName</key>
<string>packt</string>
</dict>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CD571736684D00A0F806"
BuildableName = "Chapter03_LinkingOpenCV.app"
BlueprintName = "Chapter03_LinkingOpenCV"
ReferencedContainer = "container:Chapter03_LinkingOpenCV.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CD571736684D00A0F806"
BuildableName = "Chapter03_LinkingOpenCV.app"
BlueprintName = "Chapter03_LinkingOpenCV"
ReferencedContainer = "container:Chapter03_LinkingOpenCV.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CD571736684D00A0F806"
BuildableName = "Chapter03_LinkingOpenCV.app"
BlueprintName = "Chapter03_LinkingOpenCV"
ReferencedContainer = "container:Chapter03_LinkingOpenCV.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CD571736684D00A0F806"
BuildableName = "Chapter03_LinkingOpenCV.app"
BlueprintName = "Chapter03_LinkingOpenCV"
ReferencedContainer = "container:Chapter03_LinkingOpenCV.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Chapter03_LinkingOpenCV.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>8360CD571736684D00A0F806</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
/*****************************************************************************
* AppDelegate.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 3 of the "OpenCV for iOS" book
*
* Linking OpenCV to iOS Project explains how to link OpenCV library
* and call any function from it.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow* window;
@end
/*****************************************************************************
* AppDelegate.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 3 of the "OpenCV for iOS" book
*
* Linking OpenCV to iOS Project explains how to link OpenCV library
* and call any function from it.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "AppDelegate.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// 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.
// 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.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// 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.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// 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.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>OpenCV.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
<string>MainStoryboard_iPad</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// Prefix header for all source files of the 'Chapter03_LinkingOpenCV' target in the 'Chapter03_LinkingOpenCV' project
//
#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#endif
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
/*****************************************************************************
* ViewController.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 3 of the "OpenCV for iOS" book
*
* Linking OpenCV to iOS Project explains how to link OpenCV library
* and call any function from it.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
cv::Mat cvImage;
}
@property (nonatomic, weak) IBOutlet UIImageView* imageView;
@end
/*****************************************************************************
* ViewController.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 3 of the "OpenCV for iOS" book
*
* Linking OpenCV to iOS Project explains how to link OpenCV library
* and call any function from it.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "ViewController.h"
#import "opencv2/highgui/ios.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize imageView;
- (void)viewDidLoad
{
[super viewDidLoad];
UIImage* image = [UIImage imageNamed:@"lena.png"];
// Convert UIImage* to cv::Mat
UIImageToMat(image, cvImage);
if (0)
{
NSString* filePath = [[NSBundle mainBundle]
pathForResource:@"lena" ofType:@"png"];
// Create file handle
NSFileHandle* handle =
[NSFileHandle fileHandleForReadingAtPath:filePath];
// Read content of the file
NSData* data = [handle readDataToEndOfFile];
// Decode image from the data buffer
cvImage = cv::imdecode(cv::Mat(1, [data length], CV_8UC1,
(void*)data.bytes),
CV_LOAD_IMAGE_UNCHANGED);
}
if (0)
{
NSData* data = UIImagePNGRepresentation(image);
// Decode image from the data buffer
cvImage = cv::imdecode(cv::Mat(1, [data length], CV_8UC1,
(void*)data.bytes),
CV_LOAD_IMAGE_UNCHANGED);
}
if (!cvImage.empty())
{
cv::Mat gray;
// Convert the image to grayscale
cv::cvtColor(cvImage, gray, CV_RGBA2GRAY);
// Apply Gaussian filter to remove small edges
cv::GaussianBlur(gray, gray,
cv::Size(5, 5), 1.2, 1.2);
// Calculate edges with Canny
cv::Mat edges;
cv::Canny(gray, edges, 0, 50);
// Fill image with white color
cvImage.setTo(cv::Scalar::all(255));
// Change color on edges
cvImage.setTo(cv::Scalar(0, 128, 255, 255), edges);
// Convert cv::Mat to UIImage* and show the resulting image
imageView.image = MatToUIImage(cvImage);
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="4">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="3xk-uB-Hfq"/>
<viewControllerLayoutGuide type="bottom" id="xCt-dG-lgg"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="5">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LRX-ca-Rom">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="LRX-ca-Rom" firstAttribute="bottom" secondItem="5" secondAttribute="bottom" id="Qo1-V3-tT2"/>
<constraint firstItem="LRX-ca-Rom" firstAttribute="top" secondItem="5" secondAttribute="top" id="Qwd-op-y9S"/>
<constraint firstItem="LRX-ca-Rom" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="bZF-AV-IK4"/>
<constraint firstItem="LRX-ca-Rom" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="n65-8p-smd"/>
</constraints>
</view>
<connections>
<outlet property="imageView" destination="LRX-ca-Rom" id="POY-jf-9T5"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="5">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="THJ-Ab-ElU"/>
<viewControllerLayoutGuide type="bottom" id="gEJ-ox-q8L"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="3">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hSP-Wv-I9e">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="hSP-Wv-I9e" firstAttribute="trailing" secondItem="3" secondAttribute="trailing" id="3jx-Wy-T5M"/>
<constraint firstItem="hSP-Wv-I9e" firstAttribute="top" secondItem="3" secondAttribute="top" id="Lv4-aB-QJH"/>
<constraint firstItem="hSP-Wv-I9e" firstAttribute="bottom" secondItem="3" secondAttribute="bottom" id="TLE-u7-V1v"/>
<constraint firstItem="hSP-Wv-I9e" firstAttribute="leading" secondItem="3" secondAttribute="leading" id="YhR-pJ-0tH"/>
</constraints>
</view>
<connections>
<outlet property="imageView" destination="hSP-Wv-I9e" id="6Jt-YW-Slv"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
/*****************************************************************************
* main.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 3 of the "OpenCV for iOS" book
*
* Linking OpenCV to iOS Project explains how to link OpenCV library
* and call any function from it.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
8360CD9617366B6100A0F806 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CD9517366B6100A0F806 /* UIKit.framework */; };
8360CD9817366B6100A0F806 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CD9717366B6100A0F806 /* Foundation.framework */; };
8360CD9A17366B6100A0F806 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CD9917366B6100A0F806 /* CoreGraphics.framework */; };
8360CDA017366B6100A0F806 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8360CD9E17366B6100A0F806 /* InfoPlist.strings */; };
8360CDA217366B6100A0F806 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CDA117366B6100A0F806 /* main.m */; };
8360CDA617366B6100A0F806 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CDA517366B6100A0F806 /* AppDelegate.m */; };
8360CDA817366B6100A0F806 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CDA717366B6100A0F806 /* Default.png */; };
8360CDAA17366B6100A0F806 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CDA917366B6100A0F806 /* Default@2x.png */; };
8360CDAC17366B6100A0F806 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CDAB17366B6100A0F806 /* Default-568h@2x.png */; };
8360CDAF17366B6100A0F806 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8360CDAD17366B6100A0F806 /* MainStoryboard_iPhone.storyboard */; };
8360CDB217366B6100A0F806 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8360CDB017366B6100A0F806 /* MainStoryboard_iPad.storyboard */; };
8360CDB517366B6100A0F806 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8360CDB417366B6100A0F806 /* ViewController.m */; };
8360CDBC17366B7400A0F806 /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8360CDBB17366B7400A0F806 /* opencv2.framework */; };
8360CDBE17366D3600A0F806 /* lena.png in Resources */ = {isa = PBXBuildFile; fileRef = 8360CDBD17366D3600A0F806 /* lena.png */; };
8360CDC017366D4A00A0F806 /* haarcascade_frontalface_alt.xml in Resources */ = {isa = PBXBuildFile; fileRef = 8360CDBF17366D4A00A0F806 /* haarcascade_frontalface_alt.xml */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
8360CD9117366B6100A0F806 /* Chapter04_DetectingFaces.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Chapter04_DetectingFaces.app; sourceTree = BUILT_PRODUCTS_DIR; };
8360CD9517366B6100A0F806 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
8360CD9717366B6100A0F806 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
8360CD9917366B6100A0F806 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
8360CD9D17366B6100A0F806 /* Chapter04_DetectingFaces-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Chapter04_DetectingFaces-Info.plist"; sourceTree = "<group>"; };
8360CD9F17366B6100A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8360CDA117366B6100A0F806 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8360CDA317366B6100A0F806 /* Chapter04_DetectingFaces-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Chapter04_DetectingFaces-Prefix.pch"; sourceTree = "<group>"; };
8360CDA417366B6100A0F806 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
8360CDA517366B6100A0F806 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8360CDA717366B6100A0F806 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
8360CDA917366B6100A0F806 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
8360CDAB17366B6100A0F806 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
8360CDAE17366B6100A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
8360CDB117366B6100A0F806 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
8360CDB317366B6100A0F806 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
8360CDB417366B6100A0F806 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
8360CDBB17366B7400A0F806 /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = opencv2.framework; path = ../opencv2.framework; sourceTree = "<group>"; };
8360CDBD17366D3600A0F806 /* lena.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lena.png; sourceTree = "<group>"; };
8360CDBF17366D4A00A0F806 /* haarcascade_frontalface_alt.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = haarcascade_frontalface_alt.xml; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8360CD8E17366B6100A0F806 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8360CD9617366B6100A0F806 /* UIKit.framework in Frameworks */,
8360CD9817366B6100A0F806 /* Foundation.framework in Frameworks */,
8360CD9A17366B6100A0F806 /* CoreGraphics.framework in Frameworks */,
8360CDBC17366B7400A0F806 /* opencv2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8360CD8617366B6100A0F806 = {
isa = PBXGroup;
children = (
8360CD9B17366B6100A0F806 /* Chapter04_DetectingFaces */,
8360CD9417366B6100A0F806 /* Frameworks */,
8360CD9217366B6100A0F806 /* Products */,
);
sourceTree = "<group>";
};
8360CD9217366B6100A0F806 /* Products */ = {
isa = PBXGroup;
children = (
8360CD9117366B6100A0F806 /* Chapter04_DetectingFaces.app */,
);
name = Products;
sourceTree = "<group>";
};
8360CD9417366B6100A0F806 /* Frameworks */ = {
isa = PBXGroup;
children = (
8360CDBB17366B7400A0F806 /* opencv2.framework */,
8360CD9517366B6100A0F806 /* UIKit.framework */,
8360CD9717366B6100A0F806 /* Foundation.framework */,
8360CD9917366B6100A0F806 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
8360CD9B17366B6100A0F806 /* Chapter04_DetectingFaces */ = {
isa = PBXGroup;
children = (
8360CDA417366B6100A0F806 /* AppDelegate.h */,
8360CDA517366B6100A0F806 /* AppDelegate.m */,
8360CDAD17366B6100A0F806 /* MainStoryboard_iPhone.storyboard */,
8360CDB017366B6100A0F806 /* MainStoryboard_iPad.storyboard */,
8360CDB317366B6100A0F806 /* ViewController.h */,
8360CDB417366B6100A0F806 /* ViewController.m */,
8360CD9C17366B6100A0F806 /* Supporting Files */,
);
path = Chapter04_DetectingFaces;
sourceTree = "<group>";
};
8360CD9C17366B6100A0F806 /* Supporting Files */ = {
isa = PBXGroup;
children = (
8360CDBF17366D4A00A0F806 /* haarcascade_frontalface_alt.xml */,
8360CDBD17366D3600A0F806 /* lena.png */,
8360CD9D17366B6100A0F806 /* Chapter04_DetectingFaces-Info.plist */,
8360CD9E17366B6100A0F806 /* InfoPlist.strings */,
8360CDA117366B6100A0F806 /* main.m */,
8360CDA317366B6100A0F806 /* Chapter04_DetectingFaces-Prefix.pch */,
8360CDA717366B6100A0F806 /* Default.png */,
8360CDA917366B6100A0F806 /* Default@2x.png */,
8360CDAB17366B6100A0F806 /* Default-568h@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8360CD9017366B6100A0F806 /* Chapter04_DetectingFaces */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8360CDB817366B6100A0F806 /* Build configuration list for PBXNativeTarget "Chapter04_DetectingFaces" */;
buildPhases = (
8360CD8D17366B6100A0F806 /* Sources */,
8360CD8E17366B6100A0F806 /* Frameworks */,
8360CD8F17366B6100A0F806 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Chapter04_DetectingFaces;
productName = Chapter04_DetectingFaces;
productReference = 8360CD9117366B6100A0F806 /* Chapter04_DetectingFaces.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
8360CD8817366B6100A0F806 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Alexander Shishkov & Kirill Kornyakov";
};
buildConfigurationList = 8360CD8B17366B6100A0F806 /* Build configuration list for PBXProject "Chapter04_DetectingFaces" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 8360CD8617366B6100A0F806;
productRefGroup = 8360CD9217366B6100A0F806 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8360CD9017366B6100A0F806 /* Chapter04_DetectingFaces */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8360CD8F17366B6100A0F806 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8360CDA017366B6100A0F806 /* InfoPlist.strings in Resources */,
8360CDA817366B6100A0F806 /* Default.png in Resources */,
8360CDAA17366B6100A0F806 /* Default@2x.png in Resources */,
8360CDAC17366B6100A0F806 /* Default-568h@2x.png in Resources */,
8360CDAF17366B6100A0F806 /* MainStoryboard_iPhone.storyboard in Resources */,
8360CDB217366B6100A0F806 /* MainStoryboard_iPad.storyboard in Resources */,
8360CDBE17366D3600A0F806 /* lena.png in Resources */,
8360CDC017366D4A00A0F806 /* haarcascade_frontalface_alt.xml in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8360CD8D17366B6100A0F806 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8360CDA217366B6100A0F806 /* main.m in Sources */,
8360CDA617366B6100A0F806 /* AppDelegate.m in Sources */,
8360CDB517366B6100A0F806 /* ViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
8360CD9E17366B6100A0F806 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
8360CD9F17366B6100A0F806 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
8360CDAD17366B6100A0F806 /* MainStoryboard_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
8360CDAE17366B6100A0F806 /* en */,
);
name = MainStoryboard_iPhone.storyboard;
sourceTree = "<group>";
};
8360CDB017366B6100A0F806 /* MainStoryboard_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
8360CDB117366B6100A0F806 /* en */,
);
name = MainStoryboard_iPad.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
8360CDB617366B6100A0F806 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
8360CDB717366B6100A0F806 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
8360CDB917366B6100A0F806 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter04_DetectingFaces/Chapter04_DetectingFaces-Prefix.pch";
INFOPLIST_FILE = "Chapter04_DetectingFaces/Chapter04_DetectingFaces-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
8360CDBA17366B6100A0F806 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter04_DetectingFaces/Chapter04_DetectingFaces-Prefix.pch";
INFOPLIST_FILE = "Chapter04_DetectingFaces/Chapter04_DetectingFaces-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
8360CD8B17366B6100A0F806 /* Build configuration list for PBXProject "Chapter04_DetectingFaces" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8360CDB617366B6100A0F806 /* Debug */,
8360CDB717366B6100A0F806 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8360CDB817366B6100A0F806 /* Build configuration list for PBXNativeTarget "Chapter04_DetectingFaces" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8360CDB917366B6100A0F806 /* Debug */,
8360CDBA17366B6100A0F806 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 8360CD8817366B6100A0F806 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Chapter04_DetectingFaces.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>6725734C-B1C9-4DB7-A82A-996E58D8D6CF</string>
<key>IDESourceControlProjectName</key>
<string>Chapter04_DetectingFaces</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>DD959849-5B53-4C28-B6DD-072A690DF575</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>book/3848_sources/Chapter04_DetectingFaces/Chapter04_DetectingFaces.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>DD959849-5B53-4C28-B6DD-072A690DF575</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>DD959849-5B53-4C28-B6DD-072A690DF575</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>DD959849-5B53-4C28-B6DD-072A690DF575</string>
<key>IDESourceControlWCCName</key>
<string>packt</string>
</dict>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CD9017366B6100A0F806"
BuildableName = "Chapter04_DetectingFaces.app"
BlueprintName = "Chapter04_DetectingFaces"
ReferencedContainer = "container:Chapter04_DetectingFaces.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CD9017366B6100A0F806"
BuildableName = "Chapter04_DetectingFaces.app"
BlueprintName = "Chapter04_DetectingFaces"
ReferencedContainer = "container:Chapter04_DetectingFaces.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CD9017366B6100A0F806"
BuildableName = "Chapter04_DetectingFaces.app"
BlueprintName = "Chapter04_DetectingFaces"
ReferencedContainer = "container:Chapter04_DetectingFaces.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8360CD9017366B6100A0F806"
BuildableName = "Chapter04_DetectingFaces.app"
BlueprintName = "Chapter04_DetectingFaces"
ReferencedContainer = "container:Chapter04_DetectingFaces.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Chapter04_DetectingFaces.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>8360CD9017366B6100A0F806</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
/*****************************************************************************
* AppDelegate.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 4 of the "OpenCV for iOS" book
*
* Detecting Faces with Cascade Classifier shows how to detect faces
* using OpenCV.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
/*****************************************************************************
* AppDelegate.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 4 of the "OpenCV for iOS" book
*
* Detecting Faces with Cascade Classifier shows how to detect faces
* using OpenCV.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "AppDelegate.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// 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.
// 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.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// 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.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// 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.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>OpenCV.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
<string>MainStoryboard_iPad</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// Prefix header for all source files of the 'Chapter04_DetectingFaces' target in the 'Chapter04_DetectingFaces' project
//
#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#endif
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
/*****************************************************************************
* ViewController.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 4 of the "OpenCV for iOS" book
*
* Detecting Faces with Cascade Classifier shows how to detect faces
* using OpenCV.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController {
cv::CascadeClassifier faceDetector;
}
@property (nonatomic, weak) IBOutlet UIImageView* imageView;
@end
/*****************************************************************************
* ViewController.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 4 of the "OpenCV for iOS" book
*
* Detecting Faces with Cascade Classifier shows how to detect faces
* using OpenCV.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "ViewController.h"
#import "opencv2/highgui/ios.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize imageView;
- (void)viewDidLoad
{
[super viewDidLoad];
// Load cascade classifier from the XML file
NSString* cascadePath = [[NSBundle mainBundle]
pathForResource:@"haarcascade_frontalface_alt"
ofType:@"xml"];
faceDetector.load([cascadePath UTF8String]);
//Load image with face
UIImage* image = [UIImage imageNamed:@"lena.png"];
cv::Mat faceImage;
UIImageToMat(image, faceImage);
// Convert to grayscale
cv::Mat gray;
cvtColor(faceImage, gray, CV_BGR2GRAY);
// Detect faces
std::vector<cv::Rect> faces;
faceDetector.detectMultiScale(gray, faces, 1.1,
2, 0|CV_HAAR_SCALE_IMAGE, cv::Size(30, 30));
// Draw all detected faces
for(unsigned int i = 0; i < faces.size(); i++)
{
const cv::Rect& face = faces[i];
// Get top-left and bottom-right corner points
cv::Point tl(face.x, face.y);
cv::Point br = tl + cv::Point(face.width, face.height);
// Draw rectangle around the face
cv::Scalar magenta = cv::Scalar(255, 0, 255);
cv::rectangle(faceImage, tl, br, magenta, 4, 8, 0);
}
// Show resulting image
imageView.image = MatToUIImage(faceImage);
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="4">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="SES-Nb-4iE"/>
<viewControllerLayoutGuide type="bottom" id="ES7-Oj-G5V"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="5">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DT9-w0-xVO">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="DT9-w0-xVO" firstAttribute="bottom" secondItem="5" secondAttribute="bottom" id="1lF-JL-7lG"/>
<constraint firstItem="DT9-w0-xVO" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="67D-eo-TKa"/>
<constraint firstItem="DT9-w0-xVO" firstAttribute="top" secondItem="5" secondAttribute="top" id="Yc6-Je-782"/>
<constraint firstItem="DT9-w0-xVO" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="syo-0L-tOm"/>
</constraints>
</view>
<connections>
<outlet property="imageView" destination="DT9-w0-xVO" id="f58-oq-hNz"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="5">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="OfV-zr-w2v"/>
<viewControllerLayoutGuide type="bottom" id="WHo-NJ-rr2"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="3">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="y35-Rx-hSZ">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="y35-Rx-hSZ" firstAttribute="trailing" secondItem="3" secondAttribute="trailing" id="TFp-Nz-haz"/>
<constraint firstItem="y35-Rx-hSZ" firstAttribute="bottom" secondItem="3" secondAttribute="bottom" id="Z6n-zl-hSc"/>
<constraint firstItem="y35-Rx-hSZ" firstAttribute="top" secondItem="3" secondAttribute="top" id="gjh-qq-7Or"/>
<constraint firstItem="y35-Rx-hSZ" firstAttribute="leading" secondItem="3" secondAttribute="leading" id="rjB-OV-Bdl"/>
</constraints>
</view>
<connections>
<outlet property="imageView" destination="y35-Rx-hSZ" id="w7Y-dU-BET"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
/*****************************************************************************
* main.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 4 of the "OpenCV for iOS" book
*
* Detecting Faces with Cascade Classifier shows how to detect faces
* using OpenCV.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
519ACBD8173E5955008EEF3F /* PostcardPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519ACBD6173E5955008EEF3F /* PostcardPrinter.cpp */; };
519ACBDB173E5978008EEF3F /* texture.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 519ACBD9173E5978008EEF3F /* texture.jpg */; };
519ACBDC173E5978008EEF3F /* text.png in Resources */ = {isa = PBXBuildFile; fileRef = 519ACBDA173E5978008EEF3F /* text.png */; };
519ACC24173E8189008EEF3F /* lena.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 519ACC23173E8189008EEF3F /* lena.jpg */; };
83348C31173E572100C6D4D7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83348C30173E572100C6D4D7 /* UIKit.framework */; };
83348C33173E572100C6D4D7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83348C32173E572100C6D4D7 /* Foundation.framework */; };
83348C35173E572100C6D4D7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83348C34173E572100C6D4D7 /* CoreGraphics.framework */; };
83348C3B173E572100C6D4D7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 83348C39173E572100C6D4D7 /* InfoPlist.strings */; };
83348C3D173E572100C6D4D7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 83348C3C173E572100C6D4D7 /* main.m */; };
83348C41173E572100C6D4D7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 83348C40173E572100C6D4D7 /* AppDelegate.m */; };
83348C43173E572100C6D4D7 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 83348C42173E572100C6D4D7 /* Default.png */; };
83348C45173E572100C6D4D7 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 83348C44173E572100C6D4D7 /* Default@2x.png */; };
83348C47173E572100C6D4D7 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 83348C46173E572100C6D4D7 /* Default-568h@2x.png */; };
83348C4A173E572100C6D4D7 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 83348C48173E572100C6D4D7 /* MainStoryboard_iPhone.storyboard */; };
83348C4D173E572100C6D4D7 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 83348C4B173E572100C6D4D7 /* MainStoryboard_iPad.storyboard */; };
83348C50173E572100C6D4D7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83348C4F173E572100C6D4D7 /* ViewController.m */; };
83348C5B173E577E00C6D4D7 /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83348C5A173E577E00C6D4D7 /* opencv2.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
519ACBD6173E5955008EEF3F /* PostcardPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PostcardPrinter.cpp; sourceTree = "<group>"; };
519ACBD7173E5955008EEF3F /* PostcardPrinter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = PostcardPrinter.hpp; sourceTree = "<group>"; };
519ACBD9173E5978008EEF3F /* texture.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = texture.jpg; sourceTree = "<group>"; };
519ACBDA173E5978008EEF3F /* text.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text.png; sourceTree = "<group>"; };
519ACC23173E8189008EEF3F /* lena.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = lena.jpg; sourceTree = "<group>"; };
83348C2C173E572100C6D4D7 /* Chapter05_PrintingPostcard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Chapter05_PrintingPostcard.app; sourceTree = BUILT_PRODUCTS_DIR; };
83348C30173E572100C6D4D7 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
83348C32173E572100C6D4D7 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
83348C34173E572100C6D4D7 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
83348C38173E572100C6D4D7 /* Chapter05_PrintingPostcard-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Chapter05_PrintingPostcard-Info.plist"; sourceTree = "<group>"; };
83348C3A173E572100C6D4D7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
83348C3C173E572100C6D4D7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
83348C3E173E572100C6D4D7 /* Chapter05_PrintingPostcard-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Chapter05_PrintingPostcard-Prefix.pch"; sourceTree = "<group>"; };
83348C3F173E572100C6D4D7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
83348C40173E572100C6D4D7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
83348C42173E572100C6D4D7 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
83348C44173E572100C6D4D7 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
83348C46173E572100C6D4D7 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
83348C49173E572100C6D4D7 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
83348C4C173E572100C6D4D7 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
83348C4E173E572100C6D4D7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
83348C4F173E572100C6D4D7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
83348C5A173E577E00C6D4D7 /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = opencv2.framework; path = ../opencv2.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
83348C29173E572100C6D4D7 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
83348C31173E572100C6D4D7 /* UIKit.framework in Frameworks */,
83348C33173E572100C6D4D7 /* Foundation.framework in Frameworks */,
83348C35173E572100C6D4D7 /* CoreGraphics.framework in Frameworks */,
83348C5B173E577E00C6D4D7 /* opencv2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
83348C21173E572100C6D4D7 = {
isa = PBXGroup;
children = (
83348C36173E572100C6D4D7 /* Chapter05_PrintingPostcard */,
83348C2F173E572100C6D4D7 /* Frameworks */,
83348C2D173E572100C6D4D7 /* Products */,
);
sourceTree = "<group>";
};
83348C2D173E572100C6D4D7 /* Products */ = {
isa = PBXGroup;
children = (
83348C2C173E572100C6D4D7 /* Chapter05_PrintingPostcard.app */,
);
name = Products;
sourceTree = "<group>";
};
83348C2F173E572100C6D4D7 /* Frameworks */ = {
isa = PBXGroup;
children = (
83348C5A173E577E00C6D4D7 /* opencv2.framework */,
83348C30173E572100C6D4D7 /* UIKit.framework */,
83348C32173E572100C6D4D7 /* Foundation.framework */,
83348C34173E572100C6D4D7 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
83348C36173E572100C6D4D7 /* Chapter05_PrintingPostcard */ = {
isa = PBXGroup;
children = (
519ACBD6173E5955008EEF3F /* PostcardPrinter.cpp */,
519ACBD7173E5955008EEF3F /* PostcardPrinter.hpp */,
83348C3F173E572100C6D4D7 /* AppDelegate.h */,
83348C40173E572100C6D4D7 /* AppDelegate.m */,
83348C48173E572100C6D4D7 /* MainStoryboard_iPhone.storyboard */,
83348C4B173E572100C6D4D7 /* MainStoryboard_iPad.storyboard */,
83348C4E173E572100C6D4D7 /* ViewController.h */,
83348C4F173E572100C6D4D7 /* ViewController.m */,
83348C37173E572100C6D4D7 /* Supporting Files */,
);
path = Chapter05_PrintingPostcard;
sourceTree = "<group>";
};
83348C37173E572100C6D4D7 /* Supporting Files */ = {
isa = PBXGroup;
children = (
519ACC23173E8189008EEF3F /* lena.jpg */,
519ACBD9173E5978008EEF3F /* texture.jpg */,
519ACBDA173E5978008EEF3F /* text.png */,
83348C38173E572100C6D4D7 /* Chapter05_PrintingPostcard-Info.plist */,
83348C39173E572100C6D4D7 /* InfoPlist.strings */,
83348C3C173E572100C6D4D7 /* main.m */,
83348C3E173E572100C6D4D7 /* Chapter05_PrintingPostcard-Prefix.pch */,
83348C42173E572100C6D4D7 /* Default.png */,
83348C44173E572100C6D4D7 /* Default@2x.png */,
83348C46173E572100C6D4D7 /* Default-568h@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
83348C2B173E572100C6D4D7 /* Chapter05_PrintingPostcard */ = {
isa = PBXNativeTarget;
buildConfigurationList = 83348C53173E572100C6D4D7 /* Build configuration list for PBXNativeTarget "Chapter05_PrintingPostcard" */;
buildPhases = (
83348C28173E572100C6D4D7 /* Sources */,
83348C29173E572100C6D4D7 /* Frameworks */,
83348C2A173E572100C6D4D7 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Chapter05_PrintingPostcard;
productName = Chapter05_PrintingPostcard;
productReference = 83348C2C173E572100C6D4D7 /* Chapter05_PrintingPostcard.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83348C23173E572100C6D4D7 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Alexander Shishkov & Kirill Kornyakov";
};
buildConfigurationList = 83348C26173E572100C6D4D7 /* Build configuration list for PBXProject "Chapter05_PrintingPostcard" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 83348C21173E572100C6D4D7;
productRefGroup = 83348C2D173E572100C6D4D7 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
83348C2B173E572100C6D4D7 /* Chapter05_PrintingPostcard */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
83348C2A173E572100C6D4D7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
83348C3B173E572100C6D4D7 /* InfoPlist.strings in Resources */,
83348C43173E572100C6D4D7 /* Default.png in Resources */,
83348C45173E572100C6D4D7 /* Default@2x.png in Resources */,
83348C47173E572100C6D4D7 /* Default-568h@2x.png in Resources */,
83348C4A173E572100C6D4D7 /* MainStoryboard_iPhone.storyboard in Resources */,
83348C4D173E572100C6D4D7 /* MainStoryboard_iPad.storyboard in Resources */,
519ACBDB173E5978008EEF3F /* texture.jpg in Resources */,
519ACBDC173E5978008EEF3F /* text.png in Resources */,
519ACC24173E8189008EEF3F /* lena.jpg in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
83348C28173E572100C6D4D7 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
83348C3D173E572100C6D4D7 /* main.m in Sources */,
83348C41173E572100C6D4D7 /* AppDelegate.m in Sources */,
83348C50173E572100C6D4D7 /* ViewController.m in Sources */,
519ACBD8173E5955008EEF3F /* PostcardPrinter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
83348C39173E572100C6D4D7 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
83348C3A173E572100C6D4D7 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
83348C48173E572100C6D4D7 /* MainStoryboard_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
83348C49173E572100C6D4D7 /* en */,
);
name = MainStoryboard_iPhone.storyboard;
sourceTree = "<group>";
};
83348C4B173E572100C6D4D7 /* MainStoryboard_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
83348C4C173E572100C6D4D7 /* en */,
);
name = MainStoryboard_iPad.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
83348C51173E572100C6D4D7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
83348C52173E572100C6D4D7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
83348C54173E572100C6D4D7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter05_PrintingPostcard/Chapter05_PrintingPostcard-Prefix.pch";
INFOPLIST_FILE = "Chapter05_PrintingPostcard/Chapter05_PrintingPostcard-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
83348C55173E572100C6D4D7 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Chapter05_PrintingPostcard/Chapter05_PrintingPostcard-Prefix.pch";
INFOPLIST_FILE = "Chapter05_PrintingPostcard/Chapter05_PrintingPostcard-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
83348C26173E572100C6D4D7 /* Build configuration list for PBXProject "Chapter05_PrintingPostcard" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83348C51173E572100C6D4D7 /* Debug */,
83348C52173E572100C6D4D7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83348C53173E572100C6D4D7 /* Build configuration list for PBXNativeTarget "Chapter05_PrintingPostcard" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83348C54173E572100C6D4D7 /* Debug */,
83348C55173E572100C6D4D7 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 83348C23173E572100C6D4D7 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Chapter05_PrintingPostcard.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>E6D3CA3B-3D2E-4AF6-9CFA-2AA6E44B0177</string>
<key>IDESourceControlProjectName</key>
<string>Chapter05_PrintingPostcard</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>A0B627FE-A569-4C91-83C2-9BE1D651D27C</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>book/3848_sources/Chapter05_PrintingPostcard/Chapter05_PrintingPostcard.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>A0B627FE-A569-4C91-83C2-9BE1D651D27C</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://bitbucket.org/kirill_kornyakov/packt.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>A0B627FE-A569-4C91-83C2-9BE1D651D27C</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>A0B627FE-A569-4C91-83C2-9BE1D651D27C</string>
<key>IDESourceControlWCCName</key>
<string>packt</string>
</dict>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0450"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83348C2B173E572100C6D4D7"
BuildableName = "Chapter05_PrintingPostcard.app"
BlueprintName = "Chapter05_PrintingPostcard"
ReferencedContainer = "container:Chapter05_PrintingPostcard.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83348C2B173E572100C6D4D7"
BuildableName = "Chapter05_PrintingPostcard.app"
BlueprintName = "Chapter05_PrintingPostcard"
ReferencedContainer = "container:Chapter05_PrintingPostcard.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83348C2B173E572100C6D4D7"
BuildableName = "Chapter05_PrintingPostcard.app"
BlueprintName = "Chapter05_PrintingPostcard"
ReferencedContainer = "container:Chapter05_PrintingPostcard.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83348C2B173E572100C6D4D7"
BuildableName = "Chapter05_PrintingPostcard.app"
BlueprintName = "Chapter05_PrintingPostcard"
ReferencedContainer = "container:Chapter05_PrintingPostcard.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Chapter05_PrintingPostcard.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>83348C2B173E572100C6D4D7</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
/*****************************************************************************
* AppDelegate.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 5 of the "OpenCV for iOS" book
*
* Printing Postcard demonstrates how a simple photo effect
* can be implemented.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
/*****************************************************************************
* AppDelegate.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 5 of the "OpenCV for iOS" book
*
* Printing Postcard demonstrates how a simple photo effect
* can be implemented.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "AppDelegate.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// 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.
// 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.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// 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.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// 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.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>OpenCV.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
<string>MainStoryboard_iPad</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// Prefix header for all source files of the 'Chapter05_PrintingPostcard' target in the 'Chapter05_PrintingPostcard' project
//
#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#endif
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
/*****************************************************************************
* PostcardPrinter.cpp
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 5 of the "OpenCV for iOS" book
*
* Printing Postcard demonstrates how a simple photo effect
* can be implemented.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#include "PostcardPrinter.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace std;
using namespace cv;
PostcardPrinter::PostcardPrinter(Parameters& params)
{
params_ = params;
markup();
}
void PostcardPrinter::markup()
{
// Prepare postcard
int unit = 320;
cv::Size postcardSize = cv::Size(2 * unit, 3 * unit);
int border = unit / 8;
// Resize all input images properly
resize(params_.texture, params_.texture, postcardSize);
resize(params_.face, params_.face,
cv::Size(postcardSize.width - 2 * border,
postcardSize.width - 2 * border));
cv::Size newTextSz;
newTextSz.width = params_.face.cols * 0.9;
newTextSz.height =
newTextSz.width * params_.text.rows / params_.text.cols;
resize(params_.text, params_.text, newTextSz);
// Choose places for face and text
cv::Point shift(border, 2 * border);
faceRoi_ = cv::Rect(shift, params_.face.size());
cv::Point origin(border + params_.face.cols * 0.05,
params_.face.rows + 4.5 * border);
textRoi_ = cv::Rect(origin, params_.text.size());
}
void PostcardPrinter::printFragment(Mat& placeForFragment,
const Mat& fragment) const
{
// Get alpha channel
vector<Mat> fragmentPlanes;
split(fragment, fragmentPlanes);
CV_Assert(fragmentPlanes.size() == 4);
Mat alpha = fragmentPlanes[3];
fragmentPlanes.pop_back();
Mat bgrFragment;
merge(fragmentPlanes, bgrFragment);
// Add fragment with crumpling and alpha
crumple(bgrFragment, placeForFragment, alpha);
alphaBlendC3(bgrFragment, placeForFragment, alpha);
}
void PostcardPrinter::print(Mat& postcard) const
{
postcard = params_.texture.clone();
Mat placeForFace = postcard(faceRoi_);
Mat placeForText = postcard(textRoi_);
printFragment(placeForFace, params_.face);
printFragment(placeForText, params_.text);
}
void PostcardPrinter::crumple(Mat& image, const Mat& texture,
const Mat& mask) const
{
Mat relief;
cvtColor(texture, relief, CV_BGR2GRAY);
relief = 255 - relief;
Mat hsvImage;
vector<Mat> planes;
cvtColor(image, hsvImage, CV_BGR2HSV);
split(hsvImage, planes);
CV_Assert(planes.size() == 3);
subtract(planes[2], relief, planes[2], mask);
merge(planes, hsvImage);
cvtColor(hsvImage, image, CV_HSV2BGR);
}
void PostcardPrinter::alphaBlendC3(const Mat& src, Mat& dst,
const Mat& alpha) const
{
for (int i = 0; i < src.rows; i++)
for (int j = 0; j < src.cols; j++)
{
uchar alpha_value = alpha.at<uchar>(i, j);
if (alpha_value != 0)
{
float weight = float(alpha_value) / 255.f;
dst.at<Vec3b>(i, j) = weight * src.at<Vec3b>(i, j) +
(1 - weight) * dst.at<Vec3b>(i, j);
}
}
}
/*****************************************************************************
* PostcardPrinter.hpp
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 5 of the "OpenCV for iOS" book
*
* Printing Postcard demonstrates how a simple photo effect
* can be implemented.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#pragma once
#include "opencv2/core/core.hpp"
class PostcardPrinter
{
public:
struct Parameters
{
cv::Mat face;
cv::Mat texture;
cv::Mat text;
};
PostcardPrinter(Parameters& parameters);
virtual ~PostcardPrinter() {}
void print(cv::Mat& postcard) const;
protected:
void markup();
void crumple(cv::Mat& image, const cv::Mat& texture,
const cv::Mat& mask = cv::Mat()) const;
void printFragment(cv::Mat& placeForFragment,
const cv::Mat& fragment) const;
void alphaBlendC3(const cv::Mat& src, cv::Mat& dst,
const cv::Mat& alpha) const;
Parameters params_;
cv::Rect faceRoi_;
cv::Rect textRoi_;
};
/*****************************************************************************
* ViewController.h
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 5 of the "OpenCV for iOS" book
*
* Printing Postcard demonstrates how a simple photo effect
* can be implemented.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
}
@property (nonatomic, weak) IBOutlet UIImageView* imageView;
@end
/*****************************************************************************
* ViewController.m
******************************************************************************
* by Kirill Kornyakov and Alexander Shishkov, 5th May 2013
******************************************************************************
* Chapter 5 of the "OpenCV for iOS" book
*
* Printing Postcard demonstrates how a simple photo effect
* can be implemented.
*
* Copyright Packt Publishing 2013.
* http://bit.ly/OpenCV_for_iOS_book
*****************************************************************************/
#import "ViewController.h"
#import "PostcardPrinter.hpp"
#import "opencv2/highgui/ios.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize imageView;
- (NSInteger)supportedInterfaceOrientations
{
// Only portrait orientation
return UIInterfaceOrientationMaskPortrait;
}
- (void)viewDidLoad
{
[super viewDidLoad];
PostcardPrinter::Parameters params;
// Load image with face
UIImage* image = [UIImage imageNamed:@"lena.jpg"];
UIImageToMat(image, params.face);
// Load image with texture
image = [UIImage imageNamed:@"texture.jpg"];
UIImageToMat(image, params.texture);
cvtColor(params.texture, params.texture, CV_RGBA2RGB);
// Load image with text
image = [UIImage imageNamed:@"text.png"];
UIImageToMat(image, params.text, true);
// Create PostcardPrinter class
PostcardPrinter postcardPrinter(params);
// Print postcard, and measure printing time
cv::Mat postcard;
int64 timeStart = cv::getTickCount();
postcardPrinter.print(postcard);
int64 timeEnd = cv::getTickCount();
float durationMs =
1000.f * float(timeEnd - timeStart) / cv::getTickFrequency();
NSLog(@"Printing time = %.3fms", durationMs);
if (!postcard.empty())
imageView.image = MatToUIImage(postcard);
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="4">
<objects>
<viewController id="2" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="ec3-hD-3cR"/>
<viewControllerLayoutGuide type="bottom" id="Pg1-vN-7LM"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="5">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="o90-hM-vta">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="o90-hM-vta" firstAttribute="top" secondItem="5" secondAttribute="top" id="0RN-6v-LBx"/>
<constraint firstItem="o90-hM-vta" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="ajM-l5-kua"/>
<constraint firstItem="o90-hM-vta" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="qRL-DC-bt3"/>
<constraint firstItem="o90-hM-vta" firstAttribute="bottom" secondItem="5" secondAttribute="bottom" id="rCt-CP-7fc"/>
</constraints>
</view>
<connections>
<outlet property="imageView" destination="o90-hM-vta" id="Wj6-uf-PP9"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册