├── examples ├── linux-osx │ ├── .gitignore │ └── basic │ │ ├── README.md │ │ ├── Makefile │ │ └── main.cpp └── ios │ ├── OcvARBasic │ ├── OcvARBasic │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ ├── shaders │ │ │ ├── marker_f.glsl │ │ │ └── marker_v.glsl │ │ ├── main.m │ │ ├── OcvARBasic-Prefix.pch │ │ ├── AppDelegate.h │ │ ├── cam-intrinsics │ │ │ └── ipad3-front.xml │ │ ├── helper │ │ │ ├── Tools.h │ │ │ ├── shader.h │ │ │ ├── shader.cpp │ │ │ └── Tools.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── OcvARBasic-Info.plist │ │ ├── RootViewController.h │ │ ├── GLView.h │ │ ├── AppDelegate.m │ │ ├── GLView.m │ │ └── RootViewController.m │ ├── OcvARBasic.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── OcvARBasic.xccheckout │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── OcvARBasic.xcscheme │ │ └── project.pbxproj │ └── README.md │ ├── OcvARBasicNativeCam │ ├── OcvARBasicNativeCam │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ ├── shaders │ │ │ ├── marker_f.glsl │ │ │ └── marker_v.glsl │ │ ├── main.m │ │ ├── OcvARBasicNativeCam-Prefix.pch │ │ ├── CamView.h │ │ ├── AppDelegate.h │ │ ├── cam-intrinsics │ │ │ ├── ipad3-front.xml │ │ │ └── ipad2-front.xml │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── CamView.m │ │ ├── helper │ │ │ ├── shader.h │ │ │ ├── Tools.h │ │ │ ├── shader.cpp │ │ │ └── Tools.m │ │ ├── OcvARBasicNativeCam-Info.plist │ │ ├── RootViewController.h │ │ ├── GLView.h │ │ ├── AppDelegate.m │ │ ├── GLView.m │ │ └── RootViewController.m │ ├── OcvARBasicNativeCam.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── OcvARBasic.xccheckout │ │ │ │ └── OcvARBasicNativeCam.xccheckout │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── OcvARBasicNativeCam.xcscheme │ │ └── project.pbxproj │ └── README.md │ └── OcvARCocos2D │ └── README.md ├── .gitmodules ├── assets ├── marker-7x7-aruco-style │ └── board.png └── marker-templates │ ├── templ-matching-sheet.psd │ └── marker-templ-1-8-black-border.psd ├── .gitignore ├── LICENSE └── README.md /examples/linux-osx/.gitignore: -------------------------------------------------------------------------------- 1 | basic/ocv_ar_basic 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ocv_ar"] 2 | path = ocv_ar 3 | url = git@github.com:htw-inka/ocv_ar.git 4 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /assets/marker-7x7-aruco-style/board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/htw-inka/ocv_ar-examples/HEAD/assets/marker-7x7-aruco-style/board.png -------------------------------------------------------------------------------- /assets/marker-templates/templ-matching-sheet.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/htw-inka/ocv_ar-examples/HEAD/assets/marker-templates/templ-matching-sheet.psd -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/shaders/marker_f.glsl: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | 3 | uniform vec4 uColor; 4 | 5 | void main() { 6 | gl_FragColor = uColor; 7 | } -------------------------------------------------------------------------------- /assets/marker-templates/marker-templ-1-8-black-border.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/htw-inka/ocv_ar-examples/HEAD/assets/marker-templates/marker-templ-1-8-black-border.psd -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/shaders/marker_f.glsl: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | 3 | uniform vec4 uColor; 4 | 5 | void main() { 6 | gl_FragColor = uColor; 7 | } -------------------------------------------------------------------------------- /examples/ios/OcvARCocos2D/README.md: -------------------------------------------------------------------------------- 1 | # ocv_ar integrated into Cocos2D as a mobile augmented reality framework 2 | 3 | This project was moved to a separate repository named *[ocv_ar-cocos2d](https://github.com/htw-inka/ocv_ar-cocos2d)*. -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/shaders/marker_v.glsl: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | 3 | uniform mat4 uProjMat; 4 | uniform mat4 uModelViewMat; 5 | uniform mat4 uTransformMat; // for scaling 6 | 7 | attribute vec4 aPos; 8 | 9 | void main() { 10 | gl_Position = uProjMat * uModelViewMat * uTransformMat * aPos; 11 | } -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/shaders/marker_v.glsl: -------------------------------------------------------------------------------- 1 | precision mediump float; 2 | 3 | uniform mat4 uProjMat; 4 | uniform mat4 uModelViewMat; 5 | uniform mat4 uTransformMat; // for scaling 6 | 7 | attribute vec4 aPos; 8 | 9 | void main() { 10 | gl_Position = uProjMat * uModelViewMat * uTransformMat * aPos; 11 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # exclude object files 2 | *.o 3 | 4 | # exclude opencv lib 5 | opencv-ios/ 6 | 7 | #vim noise: 8 | *.swp 9 | 10 | #osx noise: 11 | .DS_Store 12 | 13 | #xcode noise: 14 | *.pbxuser 15 | *.perspective 16 | *.perspectivev3 17 | 18 | *.mode1v3 19 | *.mode2v3 20 | 21 | **/*.xcodeproj/xcuserdata/** 22 | **/*.xcodeproj/project.xcworkspace/xcuserdata/** 23 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OcvARBasic 4 | // 5 | // Created by Markus Konrad on 19.06.14. 6 | // Copyright (c) 2014 INKA Research Group. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OcvARBasic 4 | // 5 | // Created by Markus Konrad on 19.06.14. 6 | // Copyright (c) 2014 INKA Research Group. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/OcvARBasic-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | #import 15 | #endif 16 | 17 | #ifdef __OBJC__ 18 | #import 19 | #import 20 | #endif 21 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasic - Basic ocv_ar example for iOS 3 | * 4 | * Main app delegate - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | 14 | #import "RootViewController.h" 15 | 16 | @interface AppDelegate : UIResponder 17 | 18 | @property (strong, nonatomic) UIWindow *window; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/OcvARBasicNativeCam-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | #import 15 | #endif 16 | 17 | #ifdef __OBJC__ 18 | #import 19 | #import 20 | #endif 21 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/CamView.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * camera view - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | 14 | @class AVCaptureSession; 15 | 16 | @interface CamView : UIView 17 | 18 | @property (nonatomic, assign) AVCaptureSession *session; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * Main app delegate - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | 14 | #import "RootViewController.h" 15 | 16 | @interface AppDelegate : UIResponder 17 | 18 | @property (strong, nonatomic) UIWindow *window; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/cam-intrinsics/ipad3-front.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 3 5 | 3 6 |
d
7 | 8 | 2.4097821049468839e+03 0. 9.5950000000000000e+02 0. 9 | 2.4097821049468839e+03 5.3950000000000000e+02 0. 0. 1.
10 | 11 | 5 12 | 1 13 |
d
14 | 15 | 8.4161698808384172e-03 9.4286114338382243e-01 0. 0. 16 | -8.4578152377508715e+00
17 | 5.4071702571120117e-01 18 |
19 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/helper/Tools.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasic - Basic ocv_ar example for iOS 3 | * 4 | * Misc. common functions - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | 14 | @interface Tools : NSObject 15 | 16 | // Convert cv::mat image data to UIImage 17 | // code from Patrick O'Keefe (http://www.patokeefe.com/archives/721) 18 | +(UIImage *)imageFromCvMat:(cv::Mat *)mat; 19 | 20 | // get a cvMat image from an UIImage 21 | +(cv::Mat *)cvMatFromImage:(UIImage *)img gray:(BOOL)gray; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/cam-intrinsics/ipad3-front.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 3 5 | 3 6 |
d
7 | 8 | 2.4097821049468839e+03 0. 9.5950000000000000e+02 0. 9 | 2.4097821049468839e+03 5.3950000000000000e+02 0. 0. 1.
10 | 11 | 5 12 | 1 13 |
d
14 | 15 | 8.4161698808384172e-03 9.4286114338382243e-01 0. 0. 16 | -8.4578152377508715e+00
17 | 5.4071702571120117e-01 18 |
19 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/cam-intrinsics/ipad2-front.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 3 5 | 3 6 |
d
7 | 8 | 1.1905173366365445e+03 0. 6.1383616311497508e+02 0. 9 | 1.1905173366365445e+03 3.0708029483709305e+02 0. 0. 1.
10 | 11 | 5 12 | 1 13 |
d
14 | 15 | 3.3398628913791757e-02 3.6208493485118960e-02 16 | -1.3077939973028386e-03 -2.0534401775609144e-03 17 | -7.7594364452126163e-01
18 | 3.6892171280209457e-01 19 |
20 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "ipad", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "ipad", 10 | "size" : "29x29", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "ipad", 15 | "size" : "40x40", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "40x40", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "76x76", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "76x76", 31 | "scale" : "2x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "ipad", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "ipad", 10 | "size" : "29x29", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "ipad", 15 | "size" : "40x40", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "40x40", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "76x76", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "76x76", 31 | "scale" : "2x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/CamView.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * camera view - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "CamView.h" 13 | 14 | #import 15 | 16 | @implementation CamView 17 | 18 | + (Class)layerClass 19 | { 20 | return [AVCaptureVideoPreviewLayer class]; 21 | } 22 | 23 | - (AVCaptureSession *)session 24 | { 25 | return [(AVCaptureVideoPreviewLayer *)[self layer] session]; 26 | } 27 | 28 | - (void)setSession:(AVCaptureSession *)session 29 | { 30 | [(AVCaptureVideoPreviewLayer *)[self layer] setSession:session]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/helper/shader.h: -------------------------------------------------------------------------------- 1 | /** 2 | * simple opengl shader helper class - header file. 3 | * 4 | * Author: Markus Konrad , June 2014. 5 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 6 | * 7 | * BSD licensed (see LICENSE file). 8 | */ 9 | 10 | 11 | #ifndef SHADER_H 12 | #define SHADER_H 13 | 14 | #include 15 | 16 | typedef enum { 17 | ATTR, 18 | UNIF 19 | } ShaderParamType; 20 | 21 | class Shader { 22 | public: 23 | Shader(); 24 | ~Shader(); 25 | 26 | bool buildFromSrc(const char *vshSrc, const char *fshSrc); 27 | void use(); 28 | 29 | GLint getParam(ShaderParamType type, const char *name); 30 | 31 | private: 32 | static GLuint create(const char *vshSrc, const char *fshSrc, GLuint *vshId, GLuint *fshId); 33 | static GLuint compile(GLenum type, const char *src); 34 | 35 | GLuint programId; 36 | GLuint vshId; 37 | GLuint fshId; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /examples/linux-osx/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic ocv_ar example for Linux and Mac OSX 2 | 3 | * shows how to set up ocv_ar to compile for Linux Mac OSX 4 | * shows the frame output of the individual steps of the marker detection 5 | * uses `CvVideoCamera` to grab the camera's frames 6 | * no marker pose estimation in 3D is provided (see OpenGL based examples for this) 7 | 8 | ## Usage 9 | 10 | * use keys 1 to 6 to switch between the display of the individual processing steps (note that for key *1* only the source camera frame is shown) 11 | * use the ESC key to close the program 12 | 13 | ## Compile 14 | 15 | This project comes with a *Makefile*. Have a look in this file and make sure that `HEADER_SEARCH_PATH` and `LIB_SEARCH_PATH` point to the correct paths of your OpenCV installation. The Makefile also references the *ocv_ar* sources contained as submodule in this git repository. 16 | 17 | When all paths are set correctly, you can compile the program via `make`. -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/helper/shader.h: -------------------------------------------------------------------------------- 1 | /** 2 | * simple opengl shader helper class - header file. 3 | * 4 | * Author: Markus Konrad , June 2014. 5 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 6 | * 7 | * BSD licensed (see LICENSE file). 8 | */ 9 | 10 | 11 | #ifndef SHADER_H 12 | #define SHADER_H 13 | 14 | #include 15 | 16 | typedef enum { 17 | ATTR, 18 | UNIF 19 | } ShaderParamType; 20 | 21 | class Shader { 22 | public: 23 | Shader(); 24 | ~Shader(); 25 | 26 | bool buildFromSrc(const char *vshSrc, const char *fshSrc); 27 | void use(); 28 | 29 | GLint getParam(ShaderParamType type, const char *name); 30 | 31 | private: 32 | static GLuint create(const char *vshSrc, const char *fshSrc, GLuint *vshId, GLuint *fshId); 33 | static GLuint compile(GLenum type, const char *src); 34 | 35 | GLuint programId; 36 | GLuint vshId; 37 | GLuint fshId; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "ipad", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "1x" 9 | }, 10 | { 11 | "orientation" : "landscape", 12 | "idiom" : "ipad", 13 | "extent" : "full-screen", 14 | "minimum-system-version" : "7.0", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "orientation" : "portrait", 19 | "idiom" : "ipad", 20 | "extent" : "full-screen", 21 | "minimum-system-version" : "7.0", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "orientation" : "landscape", 26 | "idiom" : "ipad", 27 | "extent" : "full-screen", 28 | "minimum-system-version" : "7.0", 29 | "scale" : "2x" 30 | } 31 | ], 32 | "info" : { 33 | "version" : 1, 34 | "author" : "xcode" 35 | } 36 | } -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/OcvARBasic-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | de.htwberlin.inka.development.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations~ipad 32 | 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /examples/linux-osx/basic/Makefile: -------------------------------------------------------------------------------- 1 | # ocv_ar_basic Makefile 2 | # make sure to provide the correct paths for 3 | # HEADER_SEARCH_PATH and LIB_SEARCH_PATH below 4 | # also check if OCV_AR_DIR points to your ocv_ar sources path 5 | 6 | HEADER_SEARCH_PATH = /opt/local/include 7 | LIB_SEARCH_PATH = /opt/local/lib 8 | 9 | CC = g++ 10 | CFLAGS = -g -Wall -I$(HEADER_SEARCH_PATH) 11 | LDFLAGS = -g -L$(LIB_SEARCH_PATH) \ 12 | -lopencv_core \ 13 | -lopencv_imgproc \ 14 | -lopencv_calib3d \ 15 | -lopencv_highgui 16 | 17 | OCV_AR_DIR = ../../../ocv_ar 18 | 19 | OCV_AR_SRC = $(OCV_AR_DIR)/detect.cpp \ 20 | $(OCV_AR_DIR)/ident.cpp \ 21 | $(OCV_AR_DIR)/ident_7x7.cpp \ 22 | $(OCV_AR_DIR)/ident_templ.cpp \ 23 | $(OCV_AR_DIR)/marker.cpp \ 24 | $(OCV_AR_DIR)/tools.cpp 25 | OCV_AR_OBJ = $(OCV_AR_SRC:.cpp=.o) 26 | SRC = main.cpp 27 | OBJ = main.o 28 | PROG = ocv_ar_basic 29 | 30 | all: $(OCV_AR_OBJ) $(OBJ) 31 | if [ -f detect.o ]; then for o in $(OCV_AR_OBJ); do mv `basename $$o` $(OCV_AR_DIR)/; done; fi 32 | $(CC) $(LDFLAGS) -o $(PROG) $(OCV_AR_OBJ) $(OBJ) 33 | 34 | $(OCV_AR_OBJ): $(OCV_AR_SRC) 35 | $(CC) $(CFLAGS) -c $(OCV_AR_SRC) 36 | 37 | $(OBJ): $(SRC) 38 | $(CC) $(CFLAGS) -c $(SRC) 39 | 40 | clean: 41 | rm $(OCV_AR_OBJ) 42 | rm $(OBJ) 43 | rm $(PROG) 44 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/OcvARBasicNativeCam-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | de.htwberlin.inka.development.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations~ipad 32 | 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/helper/Tools.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * Misc. common functions - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | #import 14 | 15 | @interface Tools : NSObject 16 | 17 | // Convert cv::mat image data to UIImage 18 | // code from Patrick O'Keefe (http://www.patokeefe.com/archives/721) 19 | + (UIImage *)imageFromCvMat:(const cv::Mat *)mat; 20 | 21 | // get a cvMat image from an UIImage 22 | + (cv::Mat *)cvMatFromImage:(const UIImage *)img gray:(BOOL)gray; 23 | 24 | // create a CGImage from a cv::Mat 25 | // you will need to distroy the returned object later! 26 | + (CGImageRef)CGImageFromCvMat:(const cv::Mat &)mat; 27 | 28 | /** 29 | * Convert a sample buffer from the camera (YUV 4:2:0 [NV12] pixel format) to an 30 | * OpenCV that will contain only the luminance (grayscale) data 31 | * See http://www.fourcc.org/yuv.php#NV12 and https://wiki.videolan.org/YUV/#NV12.2FNV21 32 | * for details about the pixel format 33 | */ 34 | + (void)convertYUVSampleBuffer:(CMSampleBufferRef)buf toGrayscaleMat:(cv::Mat &)mat; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/RootViewController.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasic - Basic ocv_ar example for iOS 3 | * 4 | * Main view controller - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | 14 | #import 15 | 16 | #include "../../../../ocv_ar/ocv_ar.h" 17 | 18 | #import "Tools.h" 19 | #import "GLView.h" 20 | 21 | // change to following lines to adjust to your setting: 22 | 23 | #define MARKER_REAL_SIZE_M 0.042f 24 | #define CAM_INTRINSICS_FILE @"ipad3-front.xml" 25 | #define USE_DIST_COEFF NO 26 | #define PROJ_FLIP_MODE FLIP_V 27 | 28 | using namespace cv; 29 | using namespace ocv_ar; 30 | 31 | /** 32 | * Main view controller. 33 | * Handles UI initialization and interactions. 34 | */ 35 | @interface RootViewController : UIViewController { 36 | CvVideoCamera *cam; // for grabbing video frames 37 | 38 | UIView *baseView; // root view 39 | UIImageView *frameView; // frame view shows the grabbed video frames 40 | GLView *glView; // gl view displays the highlighted markers 41 | 42 | Detect *detector; // ocv_ar::Detector for marker detection 43 | 44 | BOOL useDistCoeff; // use distortion coefficients in camera intrinsics? 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/README.md: -------------------------------------------------------------------------------- 1 | # Basic ocv_ar example for iOS 2 | 3 | * shows how to set up ocv_ar for iOS 4 | * uses `CvVideoCamera` to grab the camera's frames 5 | * has a simple GUI to switch between the stages of the marker detection process 6 | * uses OpenGL to display simple colored squares above found markers 7 | * was tested with an iPad 3 on iOS 7 8 | 9 | ## Project setup notices 10 | 11 | ### General 12 | * make sure that *opencv2.framework* from [OpenCV for iOS](http://sourceforge.net/projects/opencvlibrary/files/opencv-ios/2.4.9/opencv2.framework.zip/download) resides at `../../../opencv-ios` 13 | * device orientation is restricted to *landscape right* but you might change it 14 | * iOS 6.0 is set as deployment target 15 | * see the list of linked frameworks and libraries in the project setup 16 | 17 | ### Build Settings 18 | * *"Compile sources As"* is set to *"Objective-C++"* 19 | * *"Automatic Reference Counting"* is set to *"NO"* 20 | 21 | ## Configuration options 22 | * check out `RootViewController.h`, it has the following configuration options: 23 | * `MARKER_REAL_SIZE_M` - set the size of your printed markers in meters 24 | * `CAM_INTRINSICS_FILE` - select the camera intrinsics file you belonging to your device. you may need to run your own calibration, for example with the tool [cam-intrinsics-db](https://github.com/htw-inka/cam-intrinsics-db) 25 | * `PROJ_FLIP_MODE` - flip the OpenGL projection (marker display). this might be necessary if you select another default device orientation 26 | 27 | ## TODO 28 | 29 | * test and adjust for iPad 2 30 | * test and adjust for iPad 4 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, HTW Berlin / Project MINERVA 2 | (http://inka.htw-berlin.de/inka/projekte/minerva/) 3 | 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of the HTW Berlin / INKA Research Group nor the names 16 | of its contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 20 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 23 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/README.md: -------------------------------------------------------------------------------- 1 | # Basic ocv_ar example for iOS that uses the native iOS camera API 2 | 3 | * shows how to set up ocv_ar for iOS 4 | * shows how to use the native iOS camera API in conjunction with ocv_ar, which is faster than using `CvVideoCamera` 5 | * has a simple GUI to switch between the stages of the marker detection process 6 | * uses OpenGL to display simple colored squares above found markers 7 | * makes use of the `ocv_ar::Track` class for marker tracking and smooth marker motion via pose interpolation 8 | * was tested with an iPad 3 on iOS 7 9 | 10 | ## Project setup notices 11 | 12 | ### General 13 | * make sure that *opencv2.framework* from [OpenCV for iOS](http://sourceforge.net/projects/opencvlibrary/files/opencv-ios/2.4.9/opencv2.framework.zip/download) resides at `../../../opencv-ios` 14 | * device orientation is restricted to *landscape right* but you might change it 15 | * iOS 6.0 is set as deployment target 16 | * see the list of linked frameworks and libraries in the project setup 17 | 18 | ### Build Settings 19 | * *"Compile sources As"* is set to *"Objective-C++"* 20 | * *"Automatic Reference Counting"* is set to *"NO"* 21 | 22 | ## Configuration options 23 | * check out `RootViewController.h`, it has the following configuration options: 24 | * `MARKER_REAL_SIZE_M` - set the size of your printed markers in meters 25 | * `CAM_INTRINSICS_FILE` - select the camera intrinsics file you belonging to your device. you may need to run your own calibration, for example with the tool [cam-intrinsics-db](https://github.com/htw-inka/cam-intrinsics-db) 26 | * `PROJ_FLIP_MODE` - flip the OpenGL projection (marker display). this might be necessary if you select another default device orientation 27 | 28 | ## TODO 29 | 30 | * test and adjust for iPad 4 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Example projects for ocv_ar - OpenCV based Augmented Reality library 2 | 3 | *Markus Konrad , June 2014* 4 | 5 | *INKA Research Group / Project MINERVA, HTW Berlin - http://inka.htw-berlin.de/inka/projekte/minerva/* 6 | 7 | This repository contains some examples on how to use the OpenCV based Augmented Reality library *[ocv_ar](https://github.com/htw-inka/ocv_ar)*. For now, only iOS based exampels exist, but different platforms will be available in the future. 8 | 9 | ## How to clone this repository 10 | 11 | Please note that *ocv_ar* is included as a submodule in this repository. Therefore, the following command needs to be used to clone the repo: 12 | 13 | ``` 14 | git clone --recursive git@github.com:htw-inka/ocv_ar-examples.git 15 | ``` 16 | 17 | ## Available projects in folder *examples/* 18 | 19 | All projects come with a separate README file for instructions on how to compile and configure the project. 20 | 21 | ### ios/OcvARBasic 22 | 23 | Basic iOS based ocv_ar showcase that uses OpenGL for display and *CvVideoCamera* for grabbing the video frames from the camera. 24 | 25 | ### ios/OcvARBasicNativeCam 26 | 27 | iOS based ocv_ar showcase that uses OpenGL for display and native iOS camera APIs for grabbing the video frames. It makes use of the `ocv_ar::Track` class for marker tracking and smooth marker motion. **This is the most full-featured version and shows the current state best.** 28 | 29 | ### ios/OcvARBCocos2D 30 | 31 | This folder contained an ocv_ar showcase that uses [Cocos2D](http://www.cocos2d-swift.org/) for display and native iOS camera APIs for grabbing the video frames. It was moved to a separate repository named *[ocv_ar-cocos2d](https://github.com/htw-inka/ocv_ar-cocos2d)*. 32 | 33 | ### linux-osx/basic 34 | 35 | Basic ocv_ar example that compiles under Linux and Mac OSX. -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/GLView.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasic - Basic ocv_ar example for iOS 3 | * 4 | * gl view - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | #import 14 | 15 | #include "helper/shader.h" 16 | #include "../../../../ocv_ar/ocv_ar.h" 17 | 18 | using namespace cv; 19 | using namespace std; 20 | 21 | /** 22 | * GLView highlights the found markers according to their estimated 3D pose. 23 | * It sits above the camera frame view and is not opaque. 24 | */ 25 | @interface GLView : GLKView { 26 | BOOL glInitialized; 27 | 28 | Shader markerDispShader; // marker display shader 29 | 30 | GLint shAttrPos; // shader attribute: vertex data 31 | 32 | GLint shMarkerProjMat; // shader uniform: projection matrix 33 | GLint shMarkerModelViewMat; // shader uniform: model-view matrix 34 | GLint shMarkerTransformMat; // shader uniform: transform matrix 35 | GLint shMarkerColor; // shader uniform: marker color 36 | 37 | CGSize viewportSize; // real gl viewport size in pixels 38 | 39 | GLfloat markerScaleMat[16]; // global marker transform (scale) matrix 40 | } 41 | 42 | @property (nonatomic, assign) vector markers; // found markers 43 | @property (nonatomic, assign) float *markerProjMat; // 4x4 projection matrix 44 | @property (nonatomic, assign) float markerScale; // marker scaling 45 | @property (nonatomic, assign) BOOL showMarkers; // enable/disable marker display 46 | 47 | - (void)setMarkerScale:(float)s; // overwrite 'assign' method 48 | 49 | /** 50 | * Resize the gl view and adjust gl properties 51 | */ 52 | - (void)resizeView:(CGSize)size; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/RootViewController.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * Main view controller - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | 14 | #import 15 | #import 16 | 17 | #include "../../../../ocv_ar/ocv_ar.h" 18 | 19 | #import "CamView.h" 20 | #import "GLView.h" 21 | 22 | // change to following lines to adjust to your setting: 23 | 24 | #define MARKER_REAL_SIZE_M 0.042f 25 | #define CAM_SESSION_PRESET AVCaptureSessionPresetHigh 26 | #define USE_DIST_COEFF NO 27 | #define PROJ_FLIP_MODE ocv_ar::FLIP_H 28 | 29 | /** 30 | * Main view controller. 31 | * Handles UI initialization and interactions. Handles camera frame input. 32 | */ 33 | @interface RootViewController : UIViewController { 34 | NSString *camIntrinsicsFile; // camera intrinsics file to use 35 | AVCaptureSession *camSession; // controlls the camera session 36 | AVCaptureDeviceInput *camDeviceInput; // input device: camera 37 | AVCaptureVideoDataOutput *vidDataOutput; // controlls the video output 38 | 39 | cv::Mat curFrame; // currently grabbed camera frame (grayscale) 40 | cv::Mat *dispFrame; // frame to display. is NULL when the "normal" camera preview is displayed 41 | 42 | UIView *baseView; // root view 43 | UIImageView *procFrameView; // view for processed frames 44 | CamView *camView; // shows the grabbed video frames ("camera preview") 45 | 46 | ocv_ar::Detect *detector; // ocv_ar::Detector for marker detection 47 | ocv_ar::Track *tracker; // ocv_ar::Track for marker tracking and motion interpolation 48 | 49 | BOOL useDistCoeff; // use distortion coefficients in camera intrinsics? 50 | } 51 | 52 | @property (nonatomic,readonly) GLView *glView; // gl view displays the highlighted markers 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/GLView.h: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * gl view - header file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import 13 | #import 14 | #import 15 | 16 | #include "helper/shader.h" 17 | #include "../../../../ocv_ar/ocv_ar.h" 18 | 19 | using namespace cv; 20 | using namespace std; 21 | 22 | /** 23 | * GLView highlights the found markers according to their estimated 3D pose. 24 | * It sits above the camera frame view and is not opaque. 25 | */ 26 | @interface GLView : GLKView { 27 | BOOL glInitialized; 28 | 29 | Shader markerDispShader; // marker display shader 30 | 31 | GLint shAttrPos; // shader attribute: vertex data 32 | 33 | GLint shMarkerProjMat; // shader uniform: projection matrix 34 | GLint shMarkerModelViewMat; // shader uniform: model-view matrix 35 | GLint shMarkerTransformMat; // shader uniform: transform matrix 36 | GLint shMarkerColor; // shader uniform: marker color 37 | 38 | CGSize viewportSize; // real gl viewport size in pixels 39 | 40 | GLfloat markerScaleMat[16]; // global marker transform (scale) matrix 41 | } 42 | 43 | @property (nonatomic, assign) ocv_ar::Track *tracker; // tracker object that handles marker tracking and motion interpolation 44 | @property (nonatomic, assign) float *markerProjMat; // 4x4 projection matrix 45 | @property (nonatomic, assign) float markerScale; // marker scaling 46 | @property (nonatomic, assign) BOOL showMarkers; // enable/disable marker display 47 | 48 | /** 49 | * set a marker scale (real marker side length in meters) 50 | * overwrite 'assign' method 51 | */ 52 | - (void)setMarkerScale:(float)s; 53 | 54 | /** 55 | * Resize the gl view and adjust gl properties 56 | */ 57 | - (void)resizeView:(CGSize)size; 58 | 59 | /** 60 | * redraw the frame (will just call [self display]) 61 | */ 62 | - (void)render:(CADisplayLink *)displayLink; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic.xcodeproj/project.xcworkspace/xcshareddata/OcvARBasic.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | ECECA6C4-5C0E-4B87-B742-0D23A6B438E9 9 | IDESourceControlProjectName 10 | OcvARBasic 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 6DEFD4E5-5D1D-4C3A-8373-A1E6C7F173F7 14 | ssh://github.com/htw-inka/ocv_ar-examples.git 15 | DF1D8106-AB40-43B1-93CC-8C21CFCE0A45 16 | ssh://github.com/htw-inka/ocv_ar.git 17 | 18 | IDESourceControlProjectPath 19 | examples/ios/OcvARBasic/OcvARBasic.xcodeproj/project.xcworkspace 20 | IDESourceControlProjectRelativeInstallPathDictionary 21 | 22 | 6DEFD4E5-5D1D-4C3A-8373-A1E6C7F173F7 23 | ../../../../.. 24 | DF1D8106-AB40-43B1-93CC-8C21CFCE0A45 25 | ../../../../../ocv_ar 26 | 27 | IDESourceControlProjectURL 28 | ssh://github.com/htw-inka/ocv_ar-examples.git 29 | IDESourceControlProjectVersion 30 | 110 31 | IDESourceControlProjectWCCIdentifier 32 | 6DEFD4E5-5D1D-4C3A-8373-A1E6C7F173F7 33 | IDESourceControlProjectWCConfigurations 34 | 35 | 36 | IDESourceControlRepositoryExtensionIdentifierKey 37 | public.vcs.git 38 | IDESourceControlWCCIdentifierKey 39 | DF1D8106-AB40-43B1-93CC-8C21CFCE0A45 40 | IDESourceControlWCCName 41 | ocv_ar 42 | 43 | 44 | IDESourceControlRepositoryExtensionIdentifierKey 45 | public.vcs.git 46 | IDESourceControlWCCIdentifierKey 47 | 6DEFD4E5-5D1D-4C3A-8373-A1E6C7F173F7 48 | IDESourceControlWCCName 49 | ocv_ar-examples 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam.xcodeproj/project.xcworkspace/xcshareddata/OcvARBasic.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | E54ACC7C-56F6-4597-BA21-1F67CA222FF5 9 | IDESourceControlProjectName 10 | OcvARBasic 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 1EA6DD9D-9E5A-42A2-AD3D-7C961B8E5F84 14 | ssh://github.com/htw-inka/ocv_ar.git 15 | 5C75F632-6382-4743-82F1-0994151A2B7D 16 | ssh://github.com/htw-inka/ocv_ar-examples.git 17 | 18 | IDESourceControlProjectPath 19 | examples/ios/OcvARBasicNativeCam/OcvARBasic.xcodeproj/project.xcworkspace 20 | IDESourceControlProjectRelativeInstallPathDictionary 21 | 22 | 1EA6DD9D-9E5A-42A2-AD3D-7C961B8E5F84 23 | ../../../../../ocv_ar 24 | 5C75F632-6382-4743-82F1-0994151A2B7D 25 | ../../../../.. 26 | 27 | IDESourceControlProjectURL 28 | ssh://github.com/htw-inka/ocv_ar-examples.git 29 | IDESourceControlProjectVersion 30 | 110 31 | IDESourceControlProjectWCCIdentifier 32 | 5C75F632-6382-4743-82F1-0994151A2B7D 33 | IDESourceControlProjectWCConfigurations 34 | 35 | 36 | IDESourceControlRepositoryExtensionIdentifierKey 37 | public.vcs.git 38 | IDESourceControlWCCIdentifierKey 39 | 1EA6DD9D-9E5A-42A2-AD3D-7C961B8E5F84 40 | IDESourceControlWCCName 41 | ocv_ar 42 | 43 | 44 | IDESourceControlRepositoryExtensionIdentifierKey 45 | public.vcs.git 46 | IDESourceControlWCCIdentifierKey 47 | 5C75F632-6382-4743-82F1-0994151A2B7D 48 | IDESourceControlWCCName 49 | ocv_ar-examples 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam.xcodeproj/project.xcworkspace/xcshareddata/OcvARBasicNativeCam.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | F2972F0F-3904-442A-95ED-D4483D199543 9 | IDESourceControlProjectName 10 | OcvARBasicNativeCam 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 61BE6F5A-20E9-474C-98EB-2E2428976A6E 14 | ssh://github.com/htw-inka/ocv_ar.git 15 | 6DEFD4E5-5D1D-4C3A-8373-A1E6C7F173F7 16 | ssh://github.com/htw-inka/ocv_ar-examples.git 17 | 18 | IDESourceControlProjectPath 19 | examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam.xcodeproj/project.xcworkspace 20 | IDESourceControlProjectRelativeInstallPathDictionary 21 | 22 | 61BE6F5A-20E9-474C-98EB-2E2428976A6E 23 | ../../../../../../ocv_ar 24 | 6DEFD4E5-5D1D-4C3A-8373-A1E6C7F173F7 25 | ../../../../.. 26 | 27 | IDESourceControlProjectURL 28 | ssh://github.com/htw-inka/ocv_ar-examples.git 29 | IDESourceControlProjectVersion 30 | 110 31 | IDESourceControlProjectWCCIdentifier 32 | 6DEFD4E5-5D1D-4C3A-8373-A1E6C7F173F7 33 | IDESourceControlProjectWCConfigurations 34 | 35 | 36 | IDESourceControlRepositoryExtensionIdentifierKey 37 | public.vcs.git 38 | IDESourceControlWCCIdentifierKey 39 | 61BE6F5A-20E9-474C-98EB-2E2428976A6E 40 | IDESourceControlWCCName 41 | ocv_ar 42 | 43 | 44 | IDESourceControlRepositoryExtensionIdentifierKey 45 | public.vcs.git 46 | IDESourceControlWCCIdentifierKey 47 | 6DEFD4E5-5D1D-4C3A-8373-A1E6C7F173F7 48 | IDESourceControlWCCName 49 | ocv_ar-examples 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasic - Basic ocv_ar example for iOS 3 | * 4 | * Main app delegate - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "AppDelegate.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | self.window.backgroundColor = [UIColor whiteColor]; 20 | 21 | // add our custom view controller "RootViewController" 22 | UIViewController *rootViewCtrl = [[[RootViewController alloc] initWithNibName:nil bundle:nil] autorelease]; 23 | [self.window setRootViewController:rootViewCtrl]; 24 | 25 | [self.window makeKeyAndVisible]; 26 | 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application 31 | { 32 | // 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. 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidEnterBackground:(UIApplication *)application 37 | { 38 | // 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. 39 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 40 | } 41 | 42 | - (void)applicationWillEnterForeground:(UIApplication *)application 43 | { 44 | // 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. 45 | } 46 | 47 | - (void)applicationDidBecomeActive:(UIApplication *)application 48 | { 49 | // 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. 50 | } 51 | 52 | - (void)applicationWillTerminate:(UIApplication *)application 53 | { 54 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * Main app delegate - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "AppDelegate.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | self.window.backgroundColor = [UIColor whiteColor]; 20 | 21 | // add our custom view controller "RootViewController" 22 | RootViewController *rootViewCtrl = [[[RootViewController alloc] initWithNibName:nil bundle:nil] autorelease]; 23 | [self.window setRootViewController:rootViewCtrl]; 24 | 25 | // start the main application window 26 | [self.window makeKeyAndVisible]; 27 | 28 | return YES; 29 | } 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application 32 | { 33 | // 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. 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application 38 | { 39 | // 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. 40 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 41 | } 42 | 43 | - (void)applicationWillEnterForeground:(UIApplication *)application 44 | { 45 | // 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. 46 | } 47 | 48 | - (void)applicationDidBecomeActive:(UIApplication *)application 49 | { 50 | // 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. 51 | } 52 | 53 | - (void)applicationWillTerminate:(UIApplication *)application 54 | { 55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/helper/shader.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * simple opengl shader helper class - implementation file. 3 | * 4 | * Author: Markus Konrad , June 2014. 5 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 6 | * 7 | * BSD licensed (see LICENSE file). 8 | */ 9 | 10 | #include "shader.h" 11 | 12 | #include 13 | 14 | Shader::Shader() { 15 | programId = -1; 16 | } 17 | 18 | Shader::~Shader() { 19 | if (programId > 0) { 20 | glDeleteProgram(programId); 21 | } 22 | } 23 | 24 | bool Shader::buildFromSrc(const char *vshSrc, const char *fshSrc) { 25 | programId = create(vshSrc, fshSrc, &vshId, &fshId); 26 | 27 | return (programId > 0); 28 | } 29 | 30 | void Shader::use() { 31 | glUseProgram(programId); 32 | } 33 | 34 | GLint Shader::getParam(ShaderParamType type, const char *name) { 35 | GLint id = (type == ATTR) ? 36 | glGetAttribLocation(programId, name) : 37 | glGetUniformLocation(programId, name); 38 | 39 | if (id < 0) { 40 | std::cerr << "Shader: Could not get parameter id for param " << name << std::endl; 41 | } 42 | 43 | return id; 44 | } 45 | 46 | GLuint Shader::create(const char *vshSrc, const char *fshSrc, GLuint *vshId, GLuint *fshId) { 47 | *vshId = compile(GL_VERTEX_SHADER, vshSrc); 48 | *fshId = compile(GL_FRAGMENT_SHADER, fshSrc); 49 | 50 | GLuint programId = glCreateProgram(); 51 | 52 | if (programId == 0) { 53 | std::cerr << "Shader: Could not create shader program." << std::endl; 54 | return -1; 55 | } 56 | 57 | glAttachShader(programId, *vshId); // add the vertex shader to program 58 | glAttachShader(programId, *fshId); // add the fragment shader to program 59 | glLinkProgram(programId); 60 | 61 | // check link status 62 | GLint linkStatus; 63 | glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus); 64 | if (linkStatus != GL_TRUE) { 65 | std::cerr << "Shader: Could not link shader program:" << std::endl; 66 | GLchar infoLogBuf[1024]; 67 | GLsizei infoLogLen; 68 | glGetProgramInfoLog(programId, 1024, &infoLogLen, infoLogBuf); 69 | std::cerr << infoLogBuf << std::endl; 70 | 71 | glDeleteProgram(programId); 72 | 73 | return -1; 74 | } 75 | 76 | return programId; 77 | } 78 | 79 | GLuint Shader::compile(GLenum type, const char *src) { 80 | GLuint shId = glCreateShader(type); 81 | 82 | if (shId == 0) { 83 | std::cerr << "Shader: Could not create shader." << std::endl; 84 | return -1; 85 | } 86 | 87 | glShaderSource(shId, 1, (const GLchar**)&src, NULL); 88 | glCompileShader(shId); 89 | 90 | // check compile status 91 | GLint compileStatus; 92 | glGetShaderiv(shId, GL_COMPILE_STATUS, &compileStatus); 93 | 94 | if (compileStatus != GL_TRUE) { 95 | std::cerr << "Shader: Could not compile shader:" << std::endl; 96 | GLchar infoLogBuf[1024]; 97 | GLsizei infoLogLen; 98 | glGetShaderInfoLog(shId, 1024, &infoLogLen, infoLogBuf); 99 | std::cerr << infoLogBuf << std::endl; 100 | 101 | glDeleteShader(shId); 102 | 103 | return -1; 104 | } 105 | 106 | return shId; 107 | } 108 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/helper/shader.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * simple opengl shader helper class - implementation file. 3 | * 4 | * Author: Markus Konrad , June 2014. 5 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 6 | * 7 | * BSD licensed (see LICENSE file). 8 | */ 9 | 10 | #include "shader.h" 11 | 12 | #include 13 | 14 | Shader::Shader() { 15 | programId = -1; 16 | } 17 | 18 | Shader::~Shader() { 19 | if (programId > 0) { 20 | glDeleteProgram(programId); 21 | } 22 | } 23 | 24 | bool Shader::buildFromSrc(const char *vshSrc, const char *fshSrc) { 25 | programId = create(vshSrc, fshSrc, &vshId, &fshId); 26 | 27 | return (programId > 0); 28 | } 29 | 30 | void Shader::use() { 31 | glUseProgram(programId); 32 | } 33 | 34 | GLint Shader::getParam(ShaderParamType type, const char *name) { 35 | GLint id = (type == ATTR) ? 36 | glGetAttribLocation(programId, name) : 37 | glGetUniformLocation(programId, name); 38 | 39 | if (id < 0) { 40 | std::cerr << "Shader: Could not get parameter id for param " << name << std::endl; 41 | } 42 | 43 | return id; 44 | } 45 | 46 | GLuint Shader::create(const char *vshSrc, const char *fshSrc, GLuint *vshId, GLuint *fshId) { 47 | *vshId = compile(GL_VERTEX_SHADER, vshSrc); 48 | *fshId = compile(GL_FRAGMENT_SHADER, fshSrc); 49 | 50 | GLuint programId = glCreateProgram(); 51 | 52 | if (programId == 0) { 53 | std::cerr << "Shader: Could not create shader program." << std::endl; 54 | return -1; 55 | } 56 | 57 | glAttachShader(programId, *vshId); // add the vertex shader to program 58 | glAttachShader(programId, *fshId); // add the fragment shader to program 59 | glLinkProgram(programId); 60 | 61 | // check link status 62 | GLint linkStatus; 63 | glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus); 64 | if (linkStatus != GL_TRUE) { 65 | std::cerr << "Shader: Could not link shader program:" << std::endl; 66 | GLchar infoLogBuf[1024]; 67 | GLsizei infoLogLen; 68 | glGetProgramInfoLog(programId, 1024, &infoLogLen, infoLogBuf); 69 | std::cerr << infoLogBuf << std::endl; 70 | 71 | glDeleteProgram(programId); 72 | 73 | return -1; 74 | } 75 | 76 | return programId; 77 | } 78 | 79 | GLuint Shader::compile(GLenum type, const char *src) { 80 | GLuint shId = glCreateShader(type); 81 | 82 | if (shId == 0) { 83 | std::cerr << "Shader: Could not create shader." << std::endl; 84 | return -1; 85 | } 86 | 87 | glShaderSource(shId, 1, (const GLchar**)&src, NULL); 88 | glCompileShader(shId); 89 | 90 | // check compile status 91 | GLint compileStatus; 92 | glGetShaderiv(shId, GL_COMPILE_STATUS, &compileStatus); 93 | 94 | if (compileStatus != GL_TRUE) { 95 | std::cerr << "Shader: Could not compile shader:" << std::endl; 96 | GLchar infoLogBuf[1024]; 97 | GLsizei infoLogLen; 98 | glGetShaderInfoLog(shId, 1024, &infoLogLen, infoLogBuf); 99 | std::cerr << infoLogBuf << std::endl; 100 | 101 | glDeleteShader(shId); 102 | 103 | return -1; 104 | } 105 | 106 | return shId; 107 | } 108 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/helper/Tools.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasic - Basic ocv_ar example for iOS 3 | * 4 | * Misc. common functions - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "Tools.h" 13 | 14 | @implementation Tools 15 | 16 | +(UIImage *)imageFromCvMat:(cv::Mat *)mat { 17 | // code from Patrick O'Keefe (http://www.patokeefe.com/archives/721) 18 | NSData *data = [NSData dataWithBytes:mat->data length:mat->elemSize() * mat->total()]; 19 | 20 | CGColorSpaceRef colorSpace; 21 | 22 | if (mat->elemSize() == 1) { 23 | colorSpace = CGColorSpaceCreateDeviceGray(); 24 | } else { 25 | colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | } 27 | 28 | CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)data); 29 | 30 | // Creating CGImage from cv::Mat 31 | CGImageRef imageRef = CGImageCreate(mat->cols, //width 32 | mat->rows, //height 33 | 8, //bits per component 34 | 8 * mat->elemSize(), //bits per pixel 35 | mat->step.p[0], //bytesPerRow 36 | colorSpace, //colorspace 37 | kCGImageAlphaNone|kCGBitmapByteOrderDefault,// bitmap info 38 | provider, //CGDataProviderRef 39 | NULL, //decode 40 | false, //should interpolate 41 | kCGRenderingIntentDefault //intent 42 | ); 43 | 44 | 45 | // Getting UIImage from CGImage 46 | UIImage *finalImage = [UIImage imageWithCGImage:imageRef]; 47 | CGImageRelease(imageRef); 48 | CGDataProviderRelease(provider); 49 | CGColorSpaceRelease(colorSpace); 50 | 51 | return finalImage; 52 | 53 | } 54 | 55 | +(cv::Mat *)cvMatFromImage:(UIImage *)img gray:(BOOL)gray { 56 | CGColorSpaceRef colorSpace = CGImageGetColorSpace(img.CGImage); 57 | 58 | const int w = [img size].width; 59 | const int h = [img size].height; 60 | 61 | // create cv::Mat 62 | cv::Mat *mat = new cv::Mat(h, w, CV_8UC4); 63 | 64 | // create context 65 | CGContextRef contextRef = CGBitmapContextCreate(mat->ptr(), 66 | w, h, 67 | 8, 68 | mat->step[0], 69 | colorSpace, 70 | kCGImageAlphaNoneSkipLast | 71 | kCGBitmapByteOrderDefault); 72 | 73 | if (!contextRef) { 74 | delete mat; 75 | 76 | return NULL; 77 | } 78 | 79 | // draw the image in the context 80 | CGContextDrawImage(contextRef, CGRectMake(0, 0, w, h), img.CGImage); 81 | 82 | CGContextRelease(contextRef); 83 | CGColorSpaceRelease(colorSpace); 84 | 85 | // convert to grayscale data if necessary 86 | if (gray) { 87 | cv::Mat *grayMat = new cv::Mat(h, w, CV_8UC1); 88 | cv::cvtColor(*mat, *grayMat, CV_RGBA2GRAY); 89 | delete mat; 90 | 91 | return grayMat; 92 | } 93 | 94 | return mat; 95 | } 96 | 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic.xcodeproj/xcshareddata/xcschemes/OcvARBasic.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /examples/linux-osx/basic/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * ocv_ar_basic - Basic ocv_ar example for Linux / Mac OSX 3 | * 4 | * Main program file. 5 | * 6 | * This program shows the basic usage of ocv_ar and how frames are 7 | * processed during marker detection. Use keys 1 to 6 to switch between 8 | * the display of the individual processing steps. Note that for key "1" 9 | * only the source camera frame is shown. This basic program does not make 10 | * use of the marker pose estimation and display (see OpenGL based examples 11 | * for this). Also note that the camera input frame will get downscaled to 12 | * half of its size and width. 13 | * 14 | * Use the ESC key to close the program. 15 | * 16 | * 17 | * Author: Markus Konrad , June 2014. 18 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 19 | * 20 | * BSD licensed (see LICENSE file). 21 | */ 22 | 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | // include ocv_ar library 30 | #include "../../../ocv_ar/ocv_ar.h" 31 | 32 | using namespace std; 33 | 34 | #define WIN_NAME "ocv_ar basic example for linux and mac osx" 35 | 36 | // set up the detector for 7x7 aruco style markers 37 | ocv_ar::Detect detector(ocv_ar::IDENT_TYPE_CODE_7X7); 38 | 39 | cv::VideoCapture cam; 40 | cv::Mat camFrame; // will contain the input frame 41 | cv::Mat *outFrame; // will point to an output frame 42 | 43 | void switchProcOutput(int mode) { 44 | cout << "switching to processing frame output mode " << mode << endl; 45 | 46 | detector.setFrameOutputLevel((ocv_ar::FrameProcLevel)mode); 47 | } 48 | 49 | void shutdown() { 50 | outFrame = NULL; 51 | cam.release(); 52 | } 53 | 54 | int main(int argc, char *argv[]) { 55 | // we do not estimate the correct marker position in 3D space 56 | // in this basic example. therefore we do not specify correct 57 | // camera intrinsics 58 | cv::Mat camMat = cv::Mat::eye(3, 3, CV_64F); 59 | cv::Mat camDist; 60 | detector.setCamIntrinsics(camMat, camDist); 61 | 62 | // try to open the camera 63 | if (!cam.open(0) || !cam.isOpened()) { 64 | cerr << "could not open camera device" << endl; 65 | 66 | shutdown(); 67 | 68 | return 1; 69 | } 70 | 71 | // open a window 72 | cv::namedWindow(WIN_NAME, CV_WINDOW_AUTOSIZE); 73 | bool firstFrame = true; 74 | 75 | // loop until stopped 76 | while (true) { 77 | // read a frame from the camera 78 | if (!cam.read(camFrame)) { 79 | cerr << "could not read camera frame" << endl; 80 | 81 | break; 82 | } 83 | 84 | // for the first frame, prepare the ocv_ar detector 85 | if (firstFrame) { 86 | detector.prepare(camFrame.cols, camFrame.rows, camFrame.channels()); 87 | detector.setFrameOutputLevel(ocv_ar::PROC_LEVEL_DETECTED_MARKERS); 88 | firstFrame = false; 89 | } 90 | 91 | // set the input frame, process the frame and get an output frame 92 | detector.setInputFrame(&camFrame); 93 | detector.processFrame(); 94 | // detector.estimateMarkersPoses(); // this is not necessary here, because we do not display a marker overlay via OpenGL 95 | outFrame = detector.getOutputFrame(); 96 | 97 | // the output frame can be empty when no output frame should be generated 98 | // in the detector. then use the input frame 99 | if (!outFrame) { 100 | outFrame = &camFrame; 101 | } 102 | 103 | // show the frame 104 | cv::imshow(WIN_NAME, *outFrame); 105 | 106 | // handle key input 107 | int key = cv::waitKey(1); 108 | if (key >= '1' && key <= '6') { 109 | switchProcOutput(key - 50); 110 | } else if (key == 27) { 111 | cout << "aborting..." << endl; 112 | 113 | break; 114 | } 115 | } 116 | 117 | shutdown(); 118 | 119 | return 0; 120 | } 121 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam.xcodeproj/xcshareddata/xcschemes/OcvARBasicNativeCam.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/helper/Tools.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * Misc. common functions - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "Tools.h" 13 | 14 | @implementation Tools 15 | 16 | + (UIImage *)imageFromCvMat:(const cv::Mat *)mat { 17 | // code from Patrick O'Keefe (http://www.patokeefe.com/archives/721) 18 | NSData *data = [NSData dataWithBytes:mat->data length:mat->elemSize() * mat->total()]; 19 | 20 | CGColorSpaceRef colorSpace; 21 | 22 | if (mat->elemSize() == 1) { 23 | colorSpace = CGColorSpaceCreateDeviceGray(); 24 | } else { 25 | colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | } 27 | 28 | CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)data); 29 | 30 | // Creating CGImage from cv::Mat 31 | CGImageRef imageRef = CGImageCreate(mat->cols, //width 32 | mat->rows, //height 33 | 8, //bits per component 34 | 8 * mat->elemSize(), //bits per pixel 35 | mat->step.p[0], //bytesPerRow 36 | colorSpace, //colorspace 37 | kCGImageAlphaNone|kCGBitmapByteOrderDefault,// bitmap info 38 | provider, //CGDataProviderRef 39 | NULL, //decode 40 | false, //should interpolate 41 | kCGRenderingIntentDefault //intent 42 | ); 43 | 44 | 45 | // Getting UIImage from CGImage 46 | UIImage *finalImage = [UIImage imageWithCGImage:imageRef]; 47 | CGImageRelease(imageRef); 48 | CGDataProviderRelease(provider); 49 | CGColorSpaceRelease(colorSpace); 50 | 51 | return finalImage; 52 | 53 | } 54 | 55 | + (cv::Mat *)cvMatFromImage:(const UIImage *)img gray:(BOOL)gray { 56 | CGColorSpaceRef colorSpace = CGImageGetColorSpace(img.CGImage); 57 | 58 | const int w = [img size].width; 59 | const int h = [img size].height; 60 | 61 | // create cv::Mat 62 | cv::Mat *mat = new cv::Mat(h, w, CV_8UC4); 63 | 64 | // create context 65 | CGContextRef contextRef = CGBitmapContextCreate(mat->ptr(), 66 | w, h, 67 | 8, 68 | mat->step[0], 69 | colorSpace, 70 | kCGImageAlphaNoneSkipLast | 71 | kCGBitmapByteOrderDefault); 72 | 73 | if (!contextRef) { 74 | delete mat; 75 | 76 | return NULL; 77 | } 78 | 79 | // draw the image in the context 80 | CGContextDrawImage(contextRef, CGRectMake(0, 0, w, h), img.CGImage); 81 | 82 | CGContextRelease(contextRef); 83 | // CGColorSpaceRelease(colorSpace); // "colorSpace" is not owned, only referenced 84 | 85 | // convert to grayscale data if necessary 86 | if (gray) { 87 | cv::Mat *grayMat = new cv::Mat(h, w, CV_8UC1); 88 | cv::cvtColor(*mat, *grayMat, CV_RGBA2GRAY); 89 | delete mat; 90 | 91 | return grayMat; 92 | } 93 | 94 | return mat; 95 | } 96 | 97 | + (CGImageRef)CGImageFromCvMat:(const cv::Mat &)mat { 98 | NSData *data = [NSData dataWithBytes:mat.data length:mat.elemSize() * mat.total()]; 99 | 100 | CGColorSpaceRef colorSpace; 101 | 102 | if (mat.elemSize() == 1) { 103 | colorSpace = CGColorSpaceCreateDeviceGray(); 104 | } else { 105 | colorSpace = CGColorSpaceCreateDeviceRGB(); 106 | } 107 | 108 | CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)data); 109 | 110 | // Creating CGImage from cv::Mat 111 | CGImageRef imageRef = CGImageCreate(mat.cols, //width 112 | mat.rows, //height 113 | 8, //bits per component 114 | 8 * mat.elemSize(), //bits per pixel 115 | mat.step.p[0], //bytesPerRow 116 | colorSpace, //colorspace 117 | kCGImageAlphaNone|kCGBitmapByteOrderDefault,//bitmap info 118 | provider, //CGDataProviderRef 119 | NULL, //decode 120 | false, //should interpolate 121 | kCGRenderingIntentDefault //intent 122 | ); 123 | 124 | CGDataProviderRelease(provider); 125 | CGColorSpaceRelease(colorSpace); 126 | 127 | return imageRef; 128 | } 129 | 130 | + (void)convertYUVSampleBuffer:(CMSampleBufferRef)buf toGrayscaleMat:(cv::Mat &)mat { 131 | CVImageBufferRef imgBuf = CMSampleBufferGetImageBuffer(buf); 132 | 133 | // lock the buffer 134 | CVPixelBufferLockBaseAddress(imgBuf, 0); 135 | 136 | // get the address to the image data 137 | // void *imgBufAddr = CVPixelBufferGetBaseAddress(imgBuf); // this is wrong! see http://stackoverflow.com/a/4109153 138 | void *imgBufAddr = CVPixelBufferGetBaseAddressOfPlane(imgBuf, 0); 139 | 140 | // get image properties 141 | int w = (int)CVPixelBufferGetWidth(imgBuf); 142 | int h = (int)CVPixelBufferGetHeight(imgBuf); 143 | 144 | // create the cv mat 145 | mat.create(h, w, CV_8UC1); // 8 bit unsigned chars for grayscale data 146 | memcpy(mat.data, imgBufAddr, w * h); // the first plane contains the grayscale data 147 | // therefore we use as source 148 | 149 | // unlock again 150 | CVPixelBufferUnlockBaseAddress(imgBuf, 0); 151 | } 152 | 153 | @end 154 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/GLView.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasic - Basic ocv_ar example for iOS 3 | * 4 | * gl view - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "GLView.h" 13 | 14 | #define QUAD_VERTICES 4 15 | #define QUAD_COORDS_PER_VERTEX 3 16 | #define QUAD_TEXCOORDS_PER_VERTEX 2 17 | #define QUAD_VERTEX_BUFSIZE (QUAD_VERTICES * QUAD_COORDS_PER_VERTEX) 18 | #define QUAD_TEX_BUFSIZE (QUAD_VERTICES * QUAD_TEXCOORDS_PER_VERTEX) 19 | 20 | // vertex data for a quad 21 | const GLfloat quadVertices[] = { 22 | -1, -1, 0, 23 | 1, -1, 0, 24 | -1, 1, 0, 25 | 1, 1, 0 }; 26 | 27 | 28 | @interface GLView(Private) 29 | /** 30 | * set up OpenGL 31 | */ 32 | - (void)setupGL; 33 | 34 | /** 35 | * initialize shaders 36 | */ 37 | - (void)initShaders; 38 | 39 | /** 40 | * build a shader from source 41 | */ 42 | - (BOOL)buildShader:(Shader *)shader src:(NSString *)src; 43 | 44 | /** 45 | * draw a 46 | */ 47 | - (void)drawMarker:(ocv_ar::Marker *)marker; 48 | @end 49 | 50 | 51 | @implementation GLView 52 | 53 | @synthesize markers; 54 | @synthesize markerProjMat; 55 | @synthesize markerScale; 56 | @synthesize showMarkers; 57 | 58 | #pragma mark init/dealloc 59 | 60 | - (id)initWithFrame:(CGRect)frame { 61 | // create context 62 | EAGLContext *ctx = [[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2] autorelease]; 63 | [EAGLContext setCurrentContext:ctx]; 64 | 65 | // init 66 | self = [super initWithFrame:frame context:ctx]; 67 | 68 | if (self) { 69 | // defaults 70 | glInitialized = NO; 71 | showMarkers = YES; 72 | 73 | markerProjMat = NULL; 74 | 75 | memset(markerScaleMat, 0, sizeof(GLfloat) * 16); 76 | [self setMarkerScale:1.0f]; 77 | 78 | // configure 79 | [self setOpaque:NO]; 80 | 81 | [self setDrawableColorFormat:GLKViewDrawableColorFormatRGBA8888]; 82 | [self setDrawableDepthFormat:GLKViewDrawableDepthFormat24]; 83 | [self setDrawableStencilFormat:GLKViewDrawableStencilFormat8]; 84 | } 85 | 86 | return self; 87 | } 88 | 89 | #pragma mark parent methods 90 | 91 | - (void)drawRect:(CGRect)rect { 92 | if (!glInitialized) return; 93 | 94 | // Clear the framebuffer 95 | glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // 0.0f for alpha is important for non-opaque gl view! 96 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 97 | 98 | glViewport(0, 0, viewportSize.width, viewportSize.height); 99 | 100 | if (!showMarkers) return; 101 | 102 | // use the marker shader 103 | markerDispShader.use(); 104 | 105 | if (markerProjMat) { 106 | // NSLog(@"GLView: drawing %lu markers", markers.size()); 107 | 108 | // draw each marker 109 | for (vector::const_iterator it = markers.begin(); 110 | it != markers.end(); 111 | ++it) 112 | { 113 | [self drawMarker:(*it)]; 114 | } 115 | } 116 | } 117 | 118 | - (void)resizeView:(CGSize)size { 119 | NSLog(@"GLView: resizing to frame size %dx%d", 120 | (int)size.width, (int)size.height); 121 | 122 | if (!glInitialized) { 123 | NSLog(@"GLView: initializing GL"); 124 | 125 | [self setupGL]; 126 | } 127 | 128 | // handle retina displays, too: 129 | float scale = [[UIScreen mainScreen] scale]; 130 | viewportSize = CGSizeMake(size.width * scale, size.height * scale); 131 | 132 | [self setNeedsDisplay]; 133 | } 134 | 135 | #pragma mark public methods 136 | 137 | - (void)setMarkerScale:(float)s { 138 | markerScale = s; 139 | 140 | // set 4x4 matrix diagonal to s 141 | // markerScaleMat must be zero initialized! 142 | for (int i = 0; i < 3; ++i) { 143 | markerScaleMat[i * 5] = s * 0.5f; 144 | } 145 | markerScaleMat[15] = 1.0f; 146 | } 147 | 148 | #pragma mark private methods 149 | 150 | - (void)drawMarker:(ocv_ar::Marker *)marker { 151 | // set matrixes 152 | glUniformMatrix4fv(shMarkerProjMat, 1, false, markerProjMat); 153 | glUniformMatrix4fv(shMarkerModelViewMat, 1, false, marker->getPoseMatPtr()); 154 | glUniformMatrix4fv(shMarkerTransformMat, 1, false, markerScaleMat); 155 | 156 | int id = marker->getId(); 157 | float idR = (float) ((id * id) % 1024); 158 | float idG = (float) ((id * id * id) % 1024); 159 | float idB = (float) ((id * id * id * id) % 1024); 160 | 161 | float markerColor[] = { idR / 1024.0f, 162 | idG / 1024.0f, 163 | idB / 1024.0f, 164 | 0.75f }; 165 | glUniform4fv(shMarkerColor, 1, markerColor); 166 | 167 | // set geometry 168 | glEnableVertexAttribArray(shAttrPos); 169 | glVertexAttribPointer(shAttrPos, 170 | QUAD_COORDS_PER_VERTEX, 171 | GL_FLOAT, 172 | GL_FALSE, 173 | 0, 174 | quadVertices); 175 | 176 | // draw 177 | glDrawArrays(GL_TRIANGLE_STRIP, 0, QUAD_VERTICES); 178 | 179 | // cleanup 180 | glDisableVertexAttribArray(shAttrPos); 181 | } 182 | 183 | - (void)setupGL { 184 | [self initShaders]; 185 | 186 | glDisable(GL_CULL_FACE); 187 | 188 | glInitialized = YES; 189 | } 190 | 191 | - (void)initShaders { 192 | [self buildShader:&markerDispShader src:@"marker"]; 193 | shMarkerProjMat = markerDispShader.getParam(UNIF, "uProjMat"); 194 | shMarkerModelViewMat = markerDispShader.getParam(UNIF, "uModelViewMat"); 195 | shMarkerTransformMat = markerDispShader.getParam(UNIF, "uTransformMat"); 196 | shMarkerColor = markerDispShader.getParam(UNIF, "uColor"); 197 | } 198 | 199 | - (BOOL)buildShader:(Shader *)shader src:(NSString *)src { 200 | NSString *vshFile = [[NSBundle mainBundle] pathForResource:[src stringByAppendingString:@"_v"] 201 | ofType:@"glsl"]; 202 | NSString *fshFile = [[NSBundle mainBundle] pathForResource:[src stringByAppendingString:@"_f"] 203 | ofType:@"glsl"]; 204 | 205 | const NSString *vshSrc = [NSString stringWithContentsOfFile:vshFile encoding:NSASCIIStringEncoding error:NULL]; 206 | if (!vshSrc) { 207 | NSLog(@"GLView: could not load shader contents from file %@", vshFile); 208 | return NO; 209 | } 210 | 211 | const NSString *fshSrc = [NSString stringWithContentsOfFile:fshFile encoding:NSASCIIStringEncoding error:NULL]; 212 | if (!fshSrc) { 213 | NSLog(@"GLView: could not load shader contents from file %@", fshFile); 214 | return NO; 215 | } 216 | 217 | return shader->buildFromSrc([vshSrc cStringUsingEncoding:NSASCIIStringEncoding], 218 | [fshSrc cStringUsingEncoding:NSASCIIStringEncoding]); 219 | } 220 | 221 | @end 222 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/GLView.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * gl view - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "GLView.h" 13 | 14 | #define QUAD_VERTICES 4 15 | #define QUAD_COORDS_PER_VERTEX 3 16 | #define QUAD_TEXCOORDS_PER_VERTEX 2 17 | #define QUAD_VERTEX_BUFSIZE (QUAD_VERTICES * QUAD_COORDS_PER_VERTEX) 18 | #define QUAD_TEX_BUFSIZE (QUAD_VERTICES * QUAD_TEXCOORDS_PER_VERTEX) 19 | 20 | // vertex data for a quad 21 | const GLfloat quadVertices[] = { 22 | -1, -1, 0, 23 | 1, -1, 0, 24 | -1, 1, 0, 25 | 1, 1, 0 }; 26 | 27 | 28 | @interface GLView(Private) 29 | /** 30 | * set up OpenGL 31 | */ 32 | - (void)setupGL; 33 | 34 | /** 35 | * initialize shaders 36 | */ 37 | - (void)initShaders; 38 | 39 | /** 40 | * build a shader from source 41 | */ 42 | - (BOOL)buildShader:(Shader *)shader src:(NSString *)src; 43 | 44 | /** 45 | * draw a 46 | */ 47 | - (void)drawMarker:(const ocv_ar::Marker *)marker; 48 | @end 49 | 50 | 51 | @implementation GLView 52 | 53 | @synthesize tracker; 54 | @synthesize markerProjMat; 55 | @synthesize markerScale; 56 | @synthesize showMarkers; 57 | 58 | #pragma mark init/dealloc 59 | 60 | - (id)initWithFrame:(CGRect)frame { 61 | // create context 62 | EAGLContext *ctx = [[[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2] autorelease]; 63 | [EAGLContext setCurrentContext:ctx]; 64 | 65 | // init 66 | self = [super initWithFrame:frame context:ctx]; 67 | 68 | if (self) { 69 | // defaults 70 | glInitialized = NO; 71 | showMarkers = YES; 72 | 73 | markerProjMat = NULL; 74 | 75 | memset(markerScaleMat, 0, sizeof(GLfloat) * 16); 76 | [self setMarkerScale:1.0f]; 77 | 78 | // add the render method of our GLView to the main run loop in order to 79 | // render every frame periodically 80 | CADisplayLink *displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(render:)]; 81 | [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; 82 | 83 | // configure 84 | [self setEnableSetNeedsDisplay:NO]; // important to render every frame periodically and not on demand! 85 | [self setOpaque:NO]; // we have a transparent overlay 86 | 87 | [self setDrawableColorFormat:GLKViewDrawableColorFormatRGBA8888]; 88 | [self setDrawableDepthFormat:GLKViewDrawableDepthFormat24]; 89 | [self setDrawableStencilFormat:GLKViewDrawableStencilFormat8]; 90 | } 91 | 92 | return self; 93 | } 94 | 95 | #pragma mark parent methods 96 | 97 | - (void)drawRect:(CGRect)rect { 98 | if (!glInitialized) return; 99 | 100 | // Clear the framebuffer 101 | glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // 0.0f for alpha is important for non-opaque gl view! 102 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 103 | 104 | glViewport(0, 0, viewportSize.width, viewportSize.height); 105 | 106 | if (!showMarkers) return; // break here in order not to display markers 107 | 108 | // update the tracker to smoothly move to new marker positions 109 | tracker->update(); 110 | 111 | // use the marker shader 112 | markerDispShader.use(); 113 | 114 | if (markerProjMat) { 115 | tracker->lockMarkers(); // lock the tracked markers, because they might get updated in a different thread 116 | 117 | // draw each marker 118 | const ocv_ar::MarkerMap *markers = tracker->getMarkers(); 119 | for (ocv_ar::MarkerMap::const_iterator it = markers->begin(); 120 | it != markers->end(); 121 | ++it) 122 | { 123 | [self drawMarker:&(it->second)]; 124 | } 125 | 126 | tracker->unlockMarkers(); // unlock the tracked markers again 127 | } 128 | } 129 | 130 | - (void)resizeView:(CGSize)size { 131 | NSLog(@"GLView: resizing to frame size %dx%d", 132 | (int)size.width, (int)size.height); 133 | 134 | if (!glInitialized) { 135 | NSLog(@"GLView: initializing GL"); 136 | 137 | [self setupGL]; 138 | } 139 | 140 | // handle retina displays, too: 141 | float scale = [[UIScreen mainScreen] scale]; 142 | viewportSize = CGSizeMake(size.width * scale, size.height * scale); 143 | 144 | [self setNeedsDisplay]; 145 | } 146 | 147 | #pragma mark public methods 148 | 149 | - (void)render:(CADisplayLink *)displayLink { 150 | [self display]; 151 | } 152 | 153 | - (void)setMarkerScale:(float)s { 154 | markerScale = s; 155 | 156 | // set 4x4 matrix diagonal to s 157 | // markerScaleMat must be zero initialized! 158 | for (int i = 0; i < 3; ++i) { 159 | markerScaleMat[i * 5] = s * 0.5f; 160 | } 161 | markerScaleMat[15] = 1.0f; 162 | } 163 | 164 | #pragma mark private methods 165 | 166 | - (void)drawMarker:(const ocv_ar::Marker *)marker { 167 | // set matrixes 168 | glUniformMatrix4fv(shMarkerProjMat, 1, false, markerProjMat); 169 | glUniformMatrix4fv(shMarkerModelViewMat, 1, false, marker->getPoseMatPtr()); 170 | glUniformMatrix4fv(shMarkerTransformMat, 1, false, markerScaleMat); 171 | 172 | int id = marker->getId(); 173 | float idR = (float) ((id * id) % 1024); 174 | float idG = (float) ((id * id * id) % 1024); 175 | float idB = (float) ((id * id * id * id) % 1024); 176 | 177 | float markerColor[] = { idR / 1024.0f, 178 | idG / 1024.0f, 179 | idB / 1024.0f, 180 | 0.75f }; 181 | glUniform4fv(shMarkerColor, 1, markerColor); 182 | 183 | // set geometry 184 | glEnableVertexAttribArray(shAttrPos); 185 | glVertexAttribPointer(shAttrPos, 186 | QUAD_COORDS_PER_VERTEX, 187 | GL_FLOAT, 188 | GL_FALSE, 189 | 0, 190 | quadVertices); 191 | 192 | // draw 193 | glDrawArrays(GL_TRIANGLE_STRIP, 0, QUAD_VERTICES); 194 | 195 | // cleanup 196 | glDisableVertexAttribArray(shAttrPos); 197 | } 198 | 199 | - (void)setupGL { 200 | [self initShaders]; 201 | 202 | glDisable(GL_CULL_FACE); 203 | 204 | glInitialized = YES; 205 | } 206 | 207 | - (void)initShaders { 208 | [self buildShader:&markerDispShader src:@"marker"]; 209 | shMarkerProjMat = markerDispShader.getParam(UNIF, "uProjMat"); 210 | shMarkerModelViewMat = markerDispShader.getParam(UNIF, "uModelViewMat"); 211 | shMarkerTransformMat = markerDispShader.getParam(UNIF, "uTransformMat"); 212 | shMarkerColor = markerDispShader.getParam(UNIF, "uColor"); 213 | } 214 | 215 | - (BOOL)buildShader:(Shader *)shader src:(NSString *)src { 216 | NSString *vshFile = [[NSBundle mainBundle] pathForResource:[src stringByAppendingString:@"_v"] 217 | ofType:@"glsl"]; 218 | NSString *fshFile = [[NSBundle mainBundle] pathForResource:[src stringByAppendingString:@"_f"] 219 | ofType:@"glsl"]; 220 | 221 | const NSString *vshSrc = [NSString stringWithContentsOfFile:vshFile encoding:NSASCIIStringEncoding error:NULL]; 222 | if (!vshSrc) { 223 | NSLog(@"GLView: could not load shader contents from file %@", vshFile); 224 | return NO; 225 | } 226 | 227 | const NSString *fshSrc = [NSString stringWithContentsOfFile:fshFile encoding:NSASCIIStringEncoding error:NULL]; 228 | if (!fshSrc) { 229 | NSLog(@"GLView: could not load shader contents from file %@", fshFile); 230 | return NO; 231 | } 232 | 233 | return shader->buildFromSrc([vshSrc cStringUsingEncoding:NSASCIIStringEncoding], 234 | [fshSrc cStringUsingEncoding:NSASCIIStringEncoding]); 235 | } 236 | 237 | @end 238 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic/RootViewController.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasic - Basic ocv_ar example for iOS 3 | * 4 | * Main view controller - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "RootViewController.h" 13 | 14 | @interface RootViewController(Private) 15 | /** 16 | * initialize camera 17 | */ 18 | - (void)initCam; 19 | 20 | /** 21 | * initialize ocv_ar marker detector 22 | */ 23 | - (BOOL)initDetector; 24 | 25 | /** 26 | * resize the frame view to CGRect in 27 | */ 28 | - (void)resizeFrameView:(NSValue *)newFrameRect; 29 | 30 | /** 31 | * handler that is called when a output selection button is pressed 32 | */ 33 | - (void)procOutputSelectBtnAction:(UIButton *)sender; 34 | 35 | /** 36 | * force to redraw views 37 | */ 38 | - (void)updateViews; 39 | @end 40 | 41 | 42 | @implementation RootViewController 43 | 44 | #pragma mark init/dealloc 45 | 46 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 47 | { 48 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 49 | if (self) { 50 | useDistCoeff = USE_DIST_COEFF; 51 | 52 | detector = new Detect(IDENT_TYPE_CODE_7X7, // marker type 53 | MARKER_REAL_SIZE_M, // real marker size in meters 54 | PROJ_FLIP_MODE); // projection flip mode 55 | } 56 | 57 | return self; 58 | } 59 | 60 | - (void)dealloc { 61 | [cam stop]; 62 | [cam release]; 63 | 64 | [glView release]; 65 | [frameView release]; 66 | [baseView release]; 67 | 68 | if (detector) delete detector; 69 | 70 | [super dealloc]; 71 | } 72 | 73 | #pragma mark parent methods 74 | 75 | - (void)didReceiveMemoryWarning { 76 | NSLog(@"memory warning!!!"); 77 | 78 | [super didReceiveMemoryWarning]; 79 | } 80 | 81 | - (void)loadView { 82 | const CGRect screenRect = [[UIScreen mainScreen] bounds]; 83 | 84 | NSLog(@"loading view of size %dx%d", (int)screenRect.size.width, (int)screenRect.size.height); 85 | 86 | // create an empty base view 87 | baseView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenRect.size.height, screenRect.size.width)]; 88 | 89 | // create the image view for the camera frames 90 | frameView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, screenRect.size.height, screenRect.size.width)]; 91 | [baseView addSubview:frameView]; 92 | 93 | // create the GL view 94 | glView = [[GLView alloc] initWithFrame:baseView.frame]; 95 | [baseView addSubview:glView]; 96 | 97 | // set a list of buttons for processing output display 98 | NSArray *btnTitles = [NSArray arrayWithObjects: 99 | @"Normal", 100 | @"Preproc", 101 | @"Thresh", 102 | @"Contours", 103 | @"Candidates", 104 | @"Detected", 105 | nil]; 106 | for (int btnIdx = 0; btnIdx < btnTitles.count; btnIdx++) { 107 | UIButton *procOutputSelectBtn = [UIButton buttonWithType:UIButtonTypeSystem]; 108 | [procOutputSelectBtn setTag:btnIdx - 1]; 109 | [procOutputSelectBtn setTitle:[btnTitles objectAtIndex:btnIdx] 110 | forState:UIControlStateNormal]; 111 | int btnW = 120; 112 | [procOutputSelectBtn setFrame:CGRectMake(10 + (btnW + 20) * btnIdx, 10, btnW, 35)]; 113 | [procOutputSelectBtn setOpaque:YES]; 114 | [procOutputSelectBtn addTarget:self 115 | action:@selector(procOutputSelectBtnAction:) 116 | forControlEvents:UIControlEventTouchUpInside]; 117 | 118 | [baseView addSubview:procOutputSelectBtn]; 119 | } 120 | 121 | // finally set the base view as view for this controller 122 | [self setView:baseView]; 123 | } 124 | 125 | - (void)viewDidLoad { 126 | [super viewDidLoad]; 127 | 128 | // init detector 129 | if ([self initDetector]) { 130 | NSLog(@"cam intrinsics loaded from file %@", CAM_INTRINSICS_FILE); 131 | } else { 132 | NSLog(@"detector initialization failure"); 133 | } 134 | 135 | // set the marker scale for the GL view 136 | [glView setMarkerScale:detector->getMarkerScale()]; 137 | 138 | // set up camera 139 | [self initCam]; 140 | [cam start]; 141 | 142 | NSLog(@"cam loaded: %d", cam.captureSessionLoaded); 143 | } 144 | 145 | #pragma mark CvVideoCameraDelegate methods 146 | 147 | - (void)processImage:(Mat &)image { 148 | if (!detector->isPrepared()) { // on first frame: prepare the detector 149 | detector->prepare(image.cols, image.rows, image.channels()); 150 | 151 | float frameAspectRatio = (float)image.cols / (float)image.rows; 152 | NSLog(@"camera frames are of size %dx%d (aspect %f)", image.cols, image.rows, frameAspectRatio); 153 | 154 | float viewW = frameView.frame.size.width; // this is for landscape view 155 | float viewH = frameView.frame.size.height; // this is for landscape view 156 | NSLog(@"view is of size %dx%d (aspect %f)", (int)viewW, (int)viewH, viewW / viewH); 157 | if (frameAspectRatio != viewW / viewH) { // aspect ratio does not fit 158 | float newViewH = viewW / frameAspectRatio; // calc new height 159 | float viewYOff = (viewH - newViewH) / 2; 160 | NSLog(@"changed view size to %dx%d", (int)viewW, (int)newViewH); 161 | CGRect newFrameViewRect = CGRectMake(0, viewYOff, viewW, newViewH); 162 | 163 | // processImage is not running on the main thread, therefore 164 | // calling "setFrame" would have no effect! 165 | [self performSelectorOnMainThread:@selector(resizeFrameView:) 166 | withObject:[NSValue valueWithCGRect:newFrameViewRect] 167 | waitUntilDone:NO]; 168 | } 169 | } 170 | 171 | // set the grabbed frame as input 172 | detector->setInputFrame(&image); 173 | 174 | // process the frame 175 | detector->processFrame(); 176 | 177 | // estimate the 3D poses of the marker 178 | detector->estimateMarkersPoses(); 179 | 180 | // "outFrame" is only set when a processing level for output is selected 181 | Mat *outFrame = detector->getOutputFrame(); 182 | 183 | if (outFrame) { // display this frame instead of the original camera frame 184 | outFrame->copyTo(image); 185 | } 186 | 187 | // update gl view 188 | [glView setMarkers:detector->getMarkers()]; 189 | 190 | [self performSelectorOnMainThread:@selector(updateViews) 191 | withObject:nil 192 | waitUntilDone:NO]; 193 | } 194 | 195 | #pragma mark private methods 196 | 197 | - (void)updateViews { 198 | [glView setNeedsDisplay]; 199 | } 200 | 201 | - (void)initCam { 202 | assert(cam == NULL); 203 | 204 | NSLog(@"initializing cam"); 205 | 206 | cam = [[CvVideoCamera alloc] initWithParentView:frameView]; 207 | 208 | cam.defaultAVCaptureDevicePosition = AVCaptureDevicePositionBack; 209 | cam.defaultAVCaptureSessionPreset = AVCaptureSessionPresetHigh; 210 | cam.defaultAVCaptureVideoOrientation = AVCaptureVideoOrientationLandscapeLeft; 211 | cam.defaultFPS = 30; 212 | // cam.grayscale = NO; 213 | 214 | [cam setDelegate:self]; 215 | } 216 | 217 | - (BOOL)initDetector { 218 | FileStorage fs; 219 | const char *path = [[[NSBundle mainBundle] pathForResource:CAM_INTRINSICS_FILE ofType:NULL] 220 | cStringUsingEncoding:NSASCIIStringEncoding]; 221 | 222 | if (!path) { 223 | NSLog(@"could not find cam intrinsics file %@", CAM_INTRINSICS_FILE); 224 | return NO; 225 | } 226 | 227 | fs.open(path, FileStorage::READ); 228 | 229 | if (!fs.isOpened()) { 230 | NSLog(@"could not load cam intrinsics file %@", CAM_INTRINSICS_FILE); 231 | return NO; 232 | } 233 | 234 | Mat camMat; 235 | Mat distCoeff; 236 | 237 | fs["Camera_Matrix"] >> camMat; 238 | 239 | if (useDistCoeff) { 240 | fs["Distortion_Coefficients"] >> distCoeff; 241 | } 242 | 243 | if (camMat.empty()) { 244 | NSLog(@"could not load cam instrinsics matrix from file %@", CAM_INTRINSICS_FILE); 245 | 246 | return NO; 247 | } 248 | 249 | detector->setCamIntrinsics(camMat, distCoeff); 250 | 251 | return YES; 252 | } 253 | 254 | - (void)resizeFrameView:(NSValue *)newFrameRect { 255 | // running this on the main thread is necessary 256 | // stopping and starting again the camera is also necessary 257 | 258 | const CGRect r = [newFrameRect CGRectValue]; 259 | 260 | [cam stop]; 261 | [frameView setFrame:r]; 262 | [cam start]; 263 | 264 | // also calculate a new GL projection matrix and resize the gl view 265 | float *projMatPtr = detector->getProjMat(r.size.width, r.size.height); 266 | [glView setMarkerProjMat:projMatPtr]; 267 | [glView setFrame:r]; 268 | [glView resizeView:r.size]; 269 | 270 | NSLog(@"new view size %dx%d, pos %d,%d", 271 | (int)frameView.frame.size.width, (int)frameView.frame.size.height, 272 | (int)frameView.frame.origin.x, (int)frameView.frame.origin.y); 273 | } 274 | 275 | - (void)procOutputSelectBtnAction:(UIButton *)sender { 276 | NSLog(@"proc output selection button pressed: %@ (proc type %d)", [sender titleForState:UIControlStateNormal], sender.tag); 277 | 278 | [glView setShowMarkers:(sender.tag < 0)]; // only show markers in "normal" display mode 279 | 280 | detector->setFrameOutputLevel((ocv_ar::FrameProcLevel)sender.tag); 281 | } 282 | 283 | @end 284 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam/RootViewController.m: -------------------------------------------------------------------------------- 1 | /** 2 | * OcvARBasicNativeCam - Basic ocv_ar example for iOS with native camera usage 3 | * 4 | * Main view controller - implementation file. 5 | * 6 | * Author: Markus Konrad , June 2014. 7 | * INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/ 8 | * 9 | * BSD licensed (see LICENSE file). 10 | */ 11 | 12 | #import "RootViewController.h" 13 | #import "helper/Tools.h" 14 | #import 15 | 16 | /** 17 | * Small helper function to convert a fourCC to 18 | * a character string for printf and the like 19 | */ 20 | void fourCCStringFromCode(int code, char fourCC[5]) { 21 | for (int i = 0; i < 4; i++) { 22 | fourCC[3 - i] = code >> (i * 8); 23 | } 24 | fourCC[4] = '\0'; 25 | } 26 | 27 | void printFloatMat4x4(const float *m) { 28 | for (int y = 0; y < 4; ++y) { 29 | for (int x = 0; x < 4; ++x) { 30 | printf("%f ", m[y * 4 + x]); 31 | } 32 | 33 | printf("\n"); 34 | } 35 | } 36 | 37 | @interface RootViewController(Private) 38 | /** 39 | * initialize camera 40 | */ 41 | - (void)initCam; 42 | 43 | /** 44 | * initialize ocv_ar marker detector 45 | */ 46 | - (BOOL)initDetector; 47 | 48 | /** 49 | * Called on the first input frame and prepares everything for the specified 50 | * frame size and number of color channels 51 | */ 52 | - (void)prepareForFramesOfSize:(CGSize)size numChannels:(int)chan; 53 | 54 | /** 55 | * resize the proc frame view to CGRect in and also 56 | * set the correct frame for the gl view 57 | */ 58 | - (void)setCorrectedFrameForViews:(NSValue *)newFrameRect; 59 | 60 | /** 61 | * Notify the video session about the interface orientation change 62 | */ 63 | - (void)interfaceOrientationChanged:(UIInterfaceOrientation)o; 64 | 65 | /** 66 | * handler that is called when a output selection button is pressed 67 | */ 68 | - (void)procOutputSelectBtnAction:(UIButton *)sender; 69 | 70 | /** 71 | * force to redraw views. this method is only to display the intermediate 72 | * frame processing output for debugging 73 | */ 74 | - (void)updateViews; 75 | @end 76 | 77 | 78 | @implementation RootViewController 79 | 80 | @synthesize glView; 81 | 82 | #pragma mark init/dealloc 83 | 84 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 85 | { 86 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 87 | if (self) { 88 | // find out the ipad model 89 | 90 | struct utsname systemInfo; 91 | uname(&systemInfo); 92 | NSString *machineInfo = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding]; 93 | NSString *machineInfoShort = [[machineInfo substringToIndex:5] lowercaseString]; 94 | 95 | NSLog(@"RootViewController: device model (short) is %@", machineInfoShort); 96 | 97 | int machineModelVersion = 0; 98 | if ([machineInfoShort isEqualToString:@"ipad2"]) { 99 | machineModelVersion = 2; 100 | } else if ([machineInfoShort isEqualToString:@"ipad3"]) { 101 | machineModelVersion = 3; 102 | } else { 103 | NSLog(@"RootViewController: no camera intrinsics available for this model!"); 104 | machineModelVersion = 2; // default. might not work! 105 | } 106 | 107 | camIntrinsicsFile = [NSString stringWithFormat:@"ipad%d-front.xml", machineModelVersion]; 108 | 109 | useDistCoeff = USE_DIST_COEFF; 110 | 111 | // create the detector 112 | detector = new ocv_ar::Detect(ocv_ar::IDENT_TYPE_CODE_7X7, // marker type 113 | MARKER_REAL_SIZE_M, // real marker size in meters 114 | PROJ_FLIP_MODE); // projection flip mode 115 | // create the tracker and pass it a reference to the detector object 116 | tracker = new ocv_ar::Track(detector); 117 | } 118 | 119 | return self; 120 | } 121 | 122 | - (void)dealloc { 123 | [camIntrinsicsFile release]; 124 | 125 | // release camera stuff 126 | [vidDataOutput release]; 127 | [camDeviceInput release]; 128 | [camSession release]; 129 | 130 | // release views 131 | [glView release]; 132 | [camView release]; 133 | [procFrameView release]; 134 | [baseView release]; 135 | 136 | // delete marker detection and tracking objects 137 | if (tracker) delete tracker; 138 | if (detector) delete detector; 139 | 140 | [super dealloc]; 141 | } 142 | 143 | #pragma mark parent methods 144 | 145 | - (void)didReceiveMemoryWarning { 146 | NSLog(@"memory warning!!!"); 147 | 148 | [super didReceiveMemoryWarning]; 149 | } 150 | 151 | - (void)loadView { 152 | const CGRect screenRect = [[UIScreen mainScreen] bounds]; 153 | 154 | NSLog(@"loading view of size %dx%d", (int)screenRect.size.width, (int)screenRect.size.height); 155 | 156 | // create an empty base view 157 | CGRect baseFrame = CGRectMake(0, 0, screenRect.size.height, screenRect.size.width); 158 | baseView = [[UIView alloc] initWithFrame:baseFrame]; 159 | 160 | // create the image view for the camera frames 161 | camView = [[CamView alloc] initWithFrame:baseFrame]; 162 | [baseView addSubview:camView]; 163 | 164 | // create view for processed frames 165 | procFrameView = [[UIImageView alloc] initWithFrame:baseFrame]; 166 | [procFrameView setHidden:YES]; // initially hidden 167 | [baseView addSubview:procFrameView]; 168 | 169 | // create the GL view 170 | glView = [[GLView alloc] initWithFrame:baseView.frame]; 171 | [glView setTracker:tracker]; // pass the tracker object 172 | [baseView addSubview:glView]; 173 | 174 | // set a list of buttons for processing output display 175 | NSArray *btnTitles = [NSArray arrayWithObjects: 176 | @"Normal", 177 | @"Preproc", 178 | @"Thresh", 179 | @"Contours", 180 | @"Candidates", 181 | @"Detected", 182 | nil]; 183 | for (int btnIdx = 0; btnIdx < btnTitles.count; btnIdx++) { 184 | UIButton *procOutputSelectBtn = [UIButton buttonWithType:UIButtonTypeSystem]; 185 | [procOutputSelectBtn setTag:btnIdx - 1]; 186 | [procOutputSelectBtn setTitle:[btnTitles objectAtIndex:btnIdx] 187 | forState:UIControlStateNormal]; 188 | int btnW = 120; 189 | [procOutputSelectBtn setFrame:CGRectMake(10 + (btnW + 20) * btnIdx, 10, btnW, 35)]; 190 | [procOutputSelectBtn setOpaque:YES]; 191 | [procOutputSelectBtn addTarget:self 192 | action:@selector(procOutputSelectBtnAction:) 193 | forControlEvents:UIControlEventTouchUpInside]; 194 | 195 | [baseView addSubview:procOutputSelectBtn]; 196 | } 197 | 198 | // finally set the base view as view for this controller 199 | [self setView:baseView]; 200 | } 201 | 202 | - (void)viewWillAppear:(BOOL)animated { 203 | NSLog(@"view will appear - start camera session"); 204 | 205 | [camSession startRunning]; 206 | } 207 | 208 | - (void)viewDidDisappear:(BOOL)animated { 209 | NSLog(@"view did disappear - stop camera session"); 210 | 211 | [camSession stopRunning]; 212 | } 213 | 214 | - (void)viewDidLoad { 215 | [super viewDidLoad]; 216 | 217 | // init detector 218 | if ([self initDetector]) { 219 | NSLog(@"cam intrinsics loaded from file %@", camIntrinsicsFile); 220 | } else { 221 | NSLog(@"detector initialization failure"); 222 | } 223 | 224 | // set the marker scale for the GL view 225 | [glView setMarkerScale:detector->getMarkerScale()]; 226 | 227 | // set up camera 228 | [self initCam]; 229 | } 230 | 231 | - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)o duration:(NSTimeInterval)duration { 232 | [self interfaceOrientationChanged:o]; 233 | } 234 | 235 | #pragma mark AVCaptureVideoDataOutputSampleBufferDelegate methods 236 | 237 | - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer 238 | fromConnection:(AVCaptureConnection *)connection 239 | { 240 | // note that this method does *not* run in the main thread! 241 | 242 | // convert the incoming YUV camera frame to a grayscale cv mat 243 | [Tools convertYUVSampleBuffer:sampleBuffer toGrayscaleMat:curFrame]; 244 | 245 | if (!detector->isPrepared()) { // on first frame: prepare for the frames 246 | [self prepareForFramesOfSize:CGSizeMake(curFrame.cols, curFrame.rows) 247 | numChannels:curFrame.channels()]; 248 | } 249 | 250 | // tell the tracker to run the detection on the input frame 251 | tracker->detect(&curFrame); 252 | 253 | // get an output frame. may be NULL if no frame processing output is selected 254 | dispFrame = detector->getOutputFrame(); 255 | 256 | // update the views on the main thread 257 | if (dispFrame) { 258 | [self performSelectorOnMainThread:@selector(updateViews) 259 | withObject:nil 260 | waitUntilDone:NO]; 261 | } 262 | } 263 | 264 | #pragma mark private methods 265 | 266 | - (void)updateViews { 267 | // this method is only to display the intermediate frame processing 268 | // output of the detector. 269 | // (it is slow but it's only for debugging) 270 | 271 | // when we have a frame to display in "procFrameView" ... 272 | // ... convert it to an UIImage 273 | UIImage *dispUIImage = [Tools imageFromCvMat:dispFrame]; 274 | 275 | // and display it with the UIImageView "procFrameView" 276 | [procFrameView setImage:dispUIImage]; 277 | [procFrameView setNeedsDisplay]; 278 | } 279 | 280 | - (void)initCam { 281 | NSLog(@"initializing cam"); 282 | 283 | NSError *error = nil; 284 | 285 | // set up the camera capture session 286 | camSession = [[AVCaptureSession alloc] init]; 287 | [camSession setSessionPreset:CAM_SESSION_PRESET]; 288 | [camView setSession:camSession]; 289 | 290 | // get the camera device 291 | NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; 292 | assert(devices.count > 0); 293 | 294 | AVCaptureDevice *camDevice = [devices firstObject]; 295 | for (AVCaptureDevice *device in devices) { 296 | if ([device position] == AVCaptureDevicePositionBack) { 297 | camDevice = device; 298 | break; 299 | } 300 | } 301 | 302 | camDeviceInput = [[AVCaptureDeviceInput deviceInputWithDevice:camDevice error:&error] retain]; 303 | 304 | if (error) { 305 | NSLog(@"error getting camera device: %@", error); 306 | return; 307 | } 308 | 309 | assert(camDeviceInput); 310 | 311 | // add the camera device to the session 312 | if ([camSession canAddInput:camDeviceInput]) { 313 | [camSession addInput:camDeviceInput]; 314 | [self interfaceOrientationChanged:self.interfaceOrientation]; 315 | } 316 | 317 | // create camera output 318 | vidDataOutput = [[AVCaptureVideoDataOutput alloc] init]; 319 | [camSession addOutput:vidDataOutput]; 320 | 321 | // set output delegate to self 322 | dispatch_queue_t queue = dispatch_queue_create("vid_output_queue", NULL); 323 | [vidDataOutput setSampleBufferDelegate:self queue:queue]; 324 | dispatch_release(queue); 325 | 326 | // get best output video format 327 | NSArray *outputPixelFormats = vidDataOutput.availableVideoCVPixelFormatTypes; 328 | int bestPixelFormatCode = -1; 329 | for (NSNumber *format in outputPixelFormats) { 330 | int code = [format intValue]; 331 | if (bestPixelFormatCode == -1) bestPixelFormatCode = code; // choose the first as best 332 | char fourCC[5]; 333 | fourCCStringFromCode(code, fourCC); 334 | NSLog(@"available video output format: %s (code %d)", fourCC, code); 335 | } 336 | 337 | // specify output video format 338 | NSDictionary *outputSettings = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:bestPixelFormatCode] 339 | forKey:(id)kCVPixelBufferPixelFormatTypeKey]; 340 | [vidDataOutput setVideoSettings:outputSettings]; 341 | 342 | // // cap to 15 fps 343 | // [vidDataOutput setMinFrameDuration:CMTimeMake(1, 15)]; 344 | } 345 | 346 | - (BOOL)initDetector { 347 | cv::FileStorage fs; 348 | const char *path = [[[NSBundle mainBundle] pathForResource:camIntrinsicsFile ofType:NULL] 349 | cStringUsingEncoding:NSASCIIStringEncoding]; 350 | 351 | if (!path) { 352 | NSLog(@"could not find cam intrinsics file %@", camIntrinsicsFile); 353 | return NO; 354 | } 355 | 356 | fs.open(path, cv::FileStorage::READ); 357 | 358 | if (!fs.isOpened()) { 359 | NSLog(@"could not load cam intrinsics file %@", camIntrinsicsFile); 360 | return NO; 361 | } 362 | 363 | cv::Mat camMat; 364 | cv::Mat distCoeff; 365 | 366 | fs["Camera_Matrix"] >> camMat; 367 | 368 | if (useDistCoeff) { 369 | fs["Distortion_Coefficients"] >> distCoeff; 370 | } 371 | 372 | if (camMat.empty()) { 373 | NSLog(@"could not load cam instrinsics matrix from file %@", camIntrinsicsFile); 374 | 375 | return NO; 376 | } 377 | 378 | detector->setCamIntrinsics(camMat, distCoeff); 379 | 380 | return YES; 381 | } 382 | 383 | - (void)prepareForFramesOfSize:(CGSize)size numChannels:(int)chan { 384 | // WARNING: this method will not be called from the main thead! 385 | 386 | detector->prepare(size.width, size.height, chan); 387 | 388 | float frameAspectRatio = size.width / size.height; 389 | NSLog(@"camera frames are of size %dx%d (aspect %f)", (int)size.width, (int)size.height, frameAspectRatio); 390 | 391 | // update proc frame view size 392 | float newViewH = procFrameView.frame.size.width / frameAspectRatio; // calc new height 393 | float viewYOff = (procFrameView.frame.size.height - newViewH) / 2; 394 | 395 | CGRect correctedViewRect = CGRectMake(0, viewYOff, procFrameView.frame.size.width, newViewH); 396 | [self performSelectorOnMainThread:@selector(setCorrectedFrameForViews:) // we need to execute this on the main thead 397 | withObject:[NSValue valueWithCGRect:correctedViewRect] // otherwise it will have no effect 398 | waitUntilDone:NO]; 399 | } 400 | 401 | - (void)setCorrectedFrameForViews:(NSValue *)newFrameRect { 402 | // WARNING: this *must* be executed on the main thread 403 | 404 | // set the corrected frame for the proc frame view 405 | CGRect r = [newFrameRect CGRectValue]; 406 | [procFrameView setFrame:r]; 407 | 408 | // also calculate a new GL projection matrix and resize the gl view 409 | float *projMatPtr = detector->getProjMat(r.size.width, r.size.height); 410 | NSLog(@"projection matrix:"); 411 | printFloatMat4x4(projMatPtr); 412 | NSLog(@"------------------"); 413 | [glView setMarkerProjMat:projMatPtr]; 414 | [glView setFrame:r]; 415 | [glView resizeView:r.size]; 416 | } 417 | 418 | - (void)procOutputSelectBtnAction:(UIButton *)sender { 419 | NSLog(@"proc output selection button pressed: %@ (proc type %ld)", 420 | [sender titleForState:UIControlStateNormal], (long)sender.tag); 421 | 422 | BOOL normalDispMode = (sender.tag < 0); 423 | [glView setShowMarkers:normalDispMode]; // only show markers in "normal" display mode 424 | [camView setHidden:!normalDispMode]; // only show original camera frames in "normal" display mode 425 | [procFrameView setHidden:normalDispMode]; // only show processed frames for other than "normal" display mode 426 | 427 | detector->setFrameOutputLevel((ocv_ar::FrameProcLevel)sender.tag); 428 | } 429 | 430 | - (void)interfaceOrientationChanged:(UIInterfaceOrientation)o { 431 | [[(AVCaptureVideoPreviewLayer *)camView.layer connection] setVideoOrientation:(AVCaptureVideoOrientation)o]; 432 | } 433 | 434 | @end 435 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasic/OcvARBasic.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 28EA5A361952DC0900B46513 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A351952DC0900B46513 /* Foundation.framework */; }; 11 | 28EA5A381952DC0900B46513 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A371952DC0900B46513 /* CoreGraphics.framework */; }; 12 | 28EA5A3A1952DC0900B46513 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A391952DC0900B46513 /* UIKit.framework */; }; 13 | 28EA5A401952DC0900B46513 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5A3E1952DC0900B46513 /* InfoPlist.strings */; }; 14 | 28EA5A421952DC0900B46513 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5A411952DC0900B46513 /* main.m */; }; 15 | 28EA5A461952DC0900B46513 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5A451952DC0900B46513 /* AppDelegate.m */; }; 16 | 28EA5A481952DC0900B46513 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5A471952DC0900B46513 /* Images.xcassets */; }; 17 | 28EA5A911952E1D300B46513 /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A901952E1D300B46513 /* opencv2.framework */; }; 18 | 28EA5A941952E1F700B46513 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A921952E1F700B46513 /* GLKit.framework */; }; 19 | 28EA5A951952E1F700B46513 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A931952E1F700B46513 /* OpenGLES.framework */; }; 20 | 28EA5A971952E1FF00B46513 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A961952E1FF00B46513 /* QuartzCore.framework */; }; 21 | 28EA5A991952E20500B46513 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A981952E20500B46513 /* CoreVideo.framework */; }; 22 | 28EA5A9B1952E20B00B46513 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A9A1952E20B00B46513 /* CoreMedia.framework */; }; 23 | 28EA5A9D1952E21000B46513 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A9C1952E21000B46513 /* CoreImage.framework */; }; 24 | 28EA5A9F1952E21700B46513 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A9E1952E21700B46513 /* AVFoundation.framework */; }; 25 | 28EA5AA11952E21D00B46513 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5AA01952E21D00B46513 /* AssetsLibrary.framework */; }; 26 | 28EA5AB41952E26F00B46513 /* detect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AA41952E26F00B46513 /* detect.cpp */; }; 27 | 28EA5AB51952E26F00B46513 /* ident.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AA61952E26F00B46513 /* ident.cpp */; }; 28 | 28EA5AB71952E26F00B46513 /* ident_templ.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AAA1952E26F00B46513 /* ident_templ.cpp */; }; 29 | 28EA5AB91952E26F00B46513 /* marker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AAD1952E26F00B46513 /* marker.cpp */; }; 30 | 28EA5ABB1952E26F00B46513 /* tools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AB11952E26F00B46513 /* tools.cpp */; }; 31 | 28EA5ABE1952E2CB00B46513 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5ABD1952E2CB00B46513 /* RootViewController.m */; }; 32 | 28EA5AC41952E76F00B46513 /* shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AC01952E76F00B46513 /* shader.cpp */; }; 33 | 28EA5AC51952E76F00B46513 /* Tools.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AC31952E76F00B46513 /* Tools.m */; }; 34 | 28EA5AC81952E85800B46513 /* GLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AC71952E85800B46513 /* GLView.m */; }; 35 | 28EA5AD01952E93A00B46513 /* marker_f.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5ACC1952E93A00B46513 /* marker_f.glsl */; }; 36 | 28EA5AD11952E93A00B46513 /* marker_v.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5ACD1952E93A00B46513 /* marker_v.glsl */; }; 37 | 28EA5AD41952EB2100B46513 /* ipad3-front.xml in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5AD31952EB2100B46513 /* ipad3-front.xml */; }; 38 | 28EA5AD7195319D200B46513 /* ident_7x7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AD5195319D200B46513 /* ident_7x7.cpp */; }; 39 | /* End PBXBuildFile section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 28EA5A321952DC0900B46513 /* OcvARBasic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OcvARBasic.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 28EA5A351952DC0900B46513 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 44 | 28EA5A371952DC0900B46513 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 45 | 28EA5A391952DC0900B46513 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 46 | 28EA5A3D1952DC0900B46513 /* OcvARBasic-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OcvARBasic-Info.plist"; sourceTree = ""; }; 47 | 28EA5A3F1952DC0900B46513 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 48 | 28EA5A411952DC0900B46513 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 28EA5A431952DC0900B46513 /* OcvARBasic-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OcvARBasic-Prefix.pch"; sourceTree = ""; }; 50 | 28EA5A441952DC0900B46513 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | 28EA5A451952DC0900B46513 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | 28EA5A471952DC0900B46513 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 53 | 28EA5A4E1952DC0900B46513 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 54 | 28EA5A901952E1D300B46513 /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = opencv2.framework; path = "../../../opencv-ios/opencv2.framework"; sourceTree = ""; }; 55 | 28EA5A921952E1F700B46513 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; 56 | 28EA5A931952E1F700B46513 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 57 | 28EA5A961952E1FF00B46513 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 58 | 28EA5A981952E20500B46513 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 59 | 28EA5A9A1952E20B00B46513 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 60 | 28EA5A9C1952E21000B46513 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; 61 | 28EA5A9E1952E21700B46513 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 62 | 28EA5AA01952E21D00B46513 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; 63 | 28EA5AA31952E26F00B46513 /* conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conf.h; sourceTree = ""; }; 64 | 28EA5AA41952E26F00B46513 /* detect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = detect.cpp; sourceTree = ""; }; 65 | 28EA5AA51952E26F00B46513 /* detect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = detect.h; sourceTree = ""; }; 66 | 28EA5AA61952E26F00B46513 /* ident.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ident.cpp; sourceTree = ""; }; 67 | 28EA5AA71952E26F00B46513 /* ident.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ident.h; sourceTree = ""; }; 68 | 28EA5AAA1952E26F00B46513 /* ident_templ.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ident_templ.cpp; sourceTree = ""; }; 69 | 28EA5AAB1952E26F00B46513 /* ident_templ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ident_templ.h; sourceTree = ""; }; 70 | 28EA5AAD1952E26F00B46513 /* marker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = marker.cpp; sourceTree = ""; }; 71 | 28EA5AAE1952E26F00B46513 /* marker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = marker.h; sourceTree = ""; }; 72 | 28EA5AAF1952E26F00B46513 /* ocv_ar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocv_ar.h; sourceTree = ""; }; 73 | 28EA5AB11952E26F00B46513 /* tools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tools.cpp; sourceTree = ""; }; 74 | 28EA5AB21952E26F00B46513 /* tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tools.h; sourceTree = ""; }; 75 | 28EA5AB31952E26F00B46513 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; 76 | 28EA5ABC1952E2CB00B46513 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; 77 | 28EA5ABD1952E2CB00B46513 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; 78 | 28EA5AC01952E76F00B46513 /* shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shader.cpp; sourceTree = ""; }; 79 | 28EA5AC11952E76F00B46513 /* shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shader.h; sourceTree = ""; }; 80 | 28EA5AC21952E76F00B46513 /* Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tools.h; sourceTree = ""; }; 81 | 28EA5AC31952E76F00B46513 /* Tools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tools.m; sourceTree = ""; }; 82 | 28EA5AC61952E85800B46513 /* GLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLView.h; sourceTree = ""; }; 83 | 28EA5AC71952E85800B46513 /* GLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLView.m; sourceTree = ""; }; 84 | 28EA5ACC1952E93A00B46513 /* marker_f.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = marker_f.glsl; sourceTree = ""; }; 85 | 28EA5ACD1952E93A00B46513 /* marker_v.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = marker_v.glsl; sourceTree = ""; }; 86 | 28EA5AD31952EB2100B46513 /* ipad3-front.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "ipad3-front.xml"; sourceTree = ""; }; 87 | 28EA5AD5195319D200B46513 /* ident_7x7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ident_7x7.cpp; sourceTree = ""; }; 88 | 28EA5AD6195319D200B46513 /* ident_7x7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ident_7x7.h; sourceTree = ""; }; 89 | /* End PBXFileReference section */ 90 | 91 | /* Begin PBXFrameworksBuildPhase section */ 92 | 28EA5A2F1952DC0900B46513 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | 28EA5AA11952E21D00B46513 /* AssetsLibrary.framework in Frameworks */, 97 | 28EA5A9F1952E21700B46513 /* AVFoundation.framework in Frameworks */, 98 | 28EA5A9D1952E21000B46513 /* CoreImage.framework in Frameworks */, 99 | 28EA5A9B1952E20B00B46513 /* CoreMedia.framework in Frameworks */, 100 | 28EA5A991952E20500B46513 /* CoreVideo.framework in Frameworks */, 101 | 28EA5A971952E1FF00B46513 /* QuartzCore.framework in Frameworks */, 102 | 28EA5A941952E1F700B46513 /* GLKit.framework in Frameworks */, 103 | 28EA5A951952E1F700B46513 /* OpenGLES.framework in Frameworks */, 104 | 28EA5A911952E1D300B46513 /* opencv2.framework in Frameworks */, 105 | 28EA5A381952DC0900B46513 /* CoreGraphics.framework in Frameworks */, 106 | 28EA5A3A1952DC0900B46513 /* UIKit.framework in Frameworks */, 107 | 28EA5A361952DC0900B46513 /* Foundation.framework in Frameworks */, 108 | ); 109 | runOnlyForDeploymentPostprocessing = 0; 110 | }; 111 | /* End PBXFrameworksBuildPhase section */ 112 | 113 | /* Begin PBXGroup section */ 114 | 28EA5A291952DC0900B46513 = { 115 | isa = PBXGroup; 116 | children = ( 117 | 28EA5A3B1952DC0900B46513 /* OcvARBasic */, 118 | 28EA5A341952DC0900B46513 /* Frameworks */, 119 | 28EA5A331952DC0900B46513 /* Products */, 120 | ); 121 | sourceTree = ""; 122 | }; 123 | 28EA5A331952DC0900B46513 /* Products */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 28EA5A321952DC0900B46513 /* OcvARBasic.app */, 127 | ); 128 | name = Products; 129 | sourceTree = ""; 130 | }; 131 | 28EA5A341952DC0900B46513 /* Frameworks */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 28EA5AA01952E21D00B46513 /* AssetsLibrary.framework */, 135 | 28EA5A9E1952E21700B46513 /* AVFoundation.framework */, 136 | 28EA5A9C1952E21000B46513 /* CoreImage.framework */, 137 | 28EA5A9A1952E20B00B46513 /* CoreMedia.framework */, 138 | 28EA5A981952E20500B46513 /* CoreVideo.framework */, 139 | 28EA5A961952E1FF00B46513 /* QuartzCore.framework */, 140 | 28EA5A921952E1F700B46513 /* GLKit.framework */, 141 | 28EA5A931952E1F700B46513 /* OpenGLES.framework */, 142 | 28EA5A901952E1D300B46513 /* opencv2.framework */, 143 | 28EA5A351952DC0900B46513 /* Foundation.framework */, 144 | 28EA5A371952DC0900B46513 /* CoreGraphics.framework */, 145 | 28EA5A391952DC0900B46513 /* UIKit.framework */, 146 | 28EA5A4E1952DC0900B46513 /* XCTest.framework */, 147 | ); 148 | name = Frameworks; 149 | sourceTree = ""; 150 | }; 151 | 28EA5A3B1952DC0900B46513 /* OcvARBasic */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 28EA5AA21952E26F00B46513 /* ocv_ar */, 155 | 28EA5ABF1952E76F00B46513 /* helper */, 156 | 28EA5A441952DC0900B46513 /* AppDelegate.h */, 157 | 28EA5A451952DC0900B46513 /* AppDelegate.m */, 158 | 28EA5ABC1952E2CB00B46513 /* RootViewController.h */, 159 | 28EA5ABD1952E2CB00B46513 /* RootViewController.m */, 160 | 28EA5AC61952E85800B46513 /* GLView.h */, 161 | 28EA5AC71952E85800B46513 /* GLView.m */, 162 | 28EA5A471952DC0900B46513 /* Images.xcassets */, 163 | 28EA5AD21952EB2100B46513 /* cam-intrinsics */, 164 | 28EA5AC91952E93A00B46513 /* shaders */, 165 | 28EA5A3C1952DC0900B46513 /* Supporting Files */, 166 | ); 167 | path = OcvARBasic; 168 | sourceTree = ""; 169 | }; 170 | 28EA5A3C1952DC0900B46513 /* Supporting Files */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 28EA5A3D1952DC0900B46513 /* OcvARBasic-Info.plist */, 174 | 28EA5A3E1952DC0900B46513 /* InfoPlist.strings */, 175 | 28EA5A411952DC0900B46513 /* main.m */, 176 | 28EA5A431952DC0900B46513 /* OcvARBasic-Prefix.pch */, 177 | ); 178 | name = "Supporting Files"; 179 | sourceTree = ""; 180 | }; 181 | 28EA5AA21952E26F00B46513 /* ocv_ar */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 28EA5AA31952E26F00B46513 /* conf.h */, 185 | 28EA5AA41952E26F00B46513 /* detect.cpp */, 186 | 28EA5AA51952E26F00B46513 /* detect.h */, 187 | 28EA5AA61952E26F00B46513 /* ident.cpp */, 188 | 28EA5AA71952E26F00B46513 /* ident.h */, 189 | 28EA5AD6195319D200B46513 /* ident_7x7.h */, 190 | 28EA5AD5195319D200B46513 /* ident_7x7.cpp */, 191 | 28EA5AAA1952E26F00B46513 /* ident_templ.cpp */, 192 | 28EA5AAB1952E26F00B46513 /* ident_templ.h */, 193 | 28EA5AAD1952E26F00B46513 /* marker.cpp */, 194 | 28EA5AAE1952E26F00B46513 /* marker.h */, 195 | 28EA5AAF1952E26F00B46513 /* ocv_ar.h */, 196 | 28EA5AB11952E26F00B46513 /* tools.cpp */, 197 | 28EA5AB21952E26F00B46513 /* tools.h */, 198 | 28EA5AB31952E26F00B46513 /* types.h */, 199 | ); 200 | name = ocv_ar; 201 | path = ../../../../ocv_ar; 202 | sourceTree = ""; 203 | }; 204 | 28EA5ABF1952E76F00B46513 /* helper */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | 28EA5AC11952E76F00B46513 /* shader.h */, 208 | 28EA5AC01952E76F00B46513 /* shader.cpp */, 209 | 28EA5AC21952E76F00B46513 /* Tools.h */, 210 | 28EA5AC31952E76F00B46513 /* Tools.m */, 211 | ); 212 | path = helper; 213 | sourceTree = ""; 214 | }; 215 | 28EA5AC91952E93A00B46513 /* shaders */ = { 216 | isa = PBXGroup; 217 | children = ( 218 | 28EA5ACC1952E93A00B46513 /* marker_f.glsl */, 219 | 28EA5ACD1952E93A00B46513 /* marker_v.glsl */, 220 | ); 221 | path = shaders; 222 | sourceTree = ""; 223 | }; 224 | 28EA5AD21952EB2100B46513 /* cam-intrinsics */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 28EA5AD31952EB2100B46513 /* ipad3-front.xml */, 228 | ); 229 | path = "cam-intrinsics"; 230 | sourceTree = ""; 231 | }; 232 | /* End PBXGroup section */ 233 | 234 | /* Begin PBXNativeTarget section */ 235 | 28EA5A311952DC0900B46513 /* OcvARBasic */ = { 236 | isa = PBXNativeTarget; 237 | buildConfigurationList = 28EA5A5E1952DC0900B46513 /* Build configuration list for PBXNativeTarget "OcvARBasic" */; 238 | buildPhases = ( 239 | 28EA5A2E1952DC0900B46513 /* Sources */, 240 | 28EA5A2F1952DC0900B46513 /* Frameworks */, 241 | 28EA5A301952DC0900B46513 /* Resources */, 242 | ); 243 | buildRules = ( 244 | ); 245 | dependencies = ( 246 | ); 247 | name = OcvARBasic; 248 | productName = OcvARBasic; 249 | productReference = 28EA5A321952DC0900B46513 /* OcvARBasic.app */; 250 | productType = "com.apple.product-type.application"; 251 | }; 252 | /* End PBXNativeTarget section */ 253 | 254 | /* Begin PBXProject section */ 255 | 28EA5A2A1952DC0900B46513 /* Project object */ = { 256 | isa = PBXProject; 257 | attributes = { 258 | LastUpgradeCheck = 0510; 259 | ORGANIZATIONNAME = "INKA Research Group"; 260 | }; 261 | buildConfigurationList = 28EA5A2D1952DC0900B46513 /* Build configuration list for PBXProject "OcvARBasic" */; 262 | compatibilityVersion = "Xcode 3.2"; 263 | developmentRegion = English; 264 | hasScannedForEncodings = 0; 265 | knownRegions = ( 266 | en, 267 | ); 268 | mainGroup = 28EA5A291952DC0900B46513; 269 | productRefGroup = 28EA5A331952DC0900B46513 /* Products */; 270 | projectDirPath = ""; 271 | projectRoot = ""; 272 | targets = ( 273 | 28EA5A311952DC0900B46513 /* OcvARBasic */, 274 | ); 275 | }; 276 | /* End PBXProject section */ 277 | 278 | /* Begin PBXResourcesBuildPhase section */ 279 | 28EA5A301952DC0900B46513 /* Resources */ = { 280 | isa = PBXResourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 28EA5AD41952EB2100B46513 /* ipad3-front.xml in Resources */, 284 | 28EA5AD01952E93A00B46513 /* marker_f.glsl in Resources */, 285 | 28EA5A401952DC0900B46513 /* InfoPlist.strings in Resources */, 286 | 28EA5A481952DC0900B46513 /* Images.xcassets in Resources */, 287 | 28EA5AD11952E93A00B46513 /* marker_v.glsl in Resources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | /* End PBXResourcesBuildPhase section */ 292 | 293 | /* Begin PBXSourcesBuildPhase section */ 294 | 28EA5A2E1952DC0900B46513 /* Sources */ = { 295 | isa = PBXSourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | 28EA5AC41952E76F00B46513 /* shader.cpp in Sources */, 299 | 28EA5AB71952E26F00B46513 /* ident_templ.cpp in Sources */, 300 | 28EA5AB41952E26F00B46513 /* detect.cpp in Sources */, 301 | 28EA5ABB1952E26F00B46513 /* tools.cpp in Sources */, 302 | 28EA5AC81952E85800B46513 /* GLView.m in Sources */, 303 | 28EA5A461952DC0900B46513 /* AppDelegate.m in Sources */, 304 | 28EA5ABE1952E2CB00B46513 /* RootViewController.m in Sources */, 305 | 28EA5AD7195319D200B46513 /* ident_7x7.cpp in Sources */, 306 | 28EA5AC51952E76F00B46513 /* Tools.m in Sources */, 307 | 28EA5AB51952E26F00B46513 /* ident.cpp in Sources */, 308 | 28EA5AB91952E26F00B46513 /* marker.cpp in Sources */, 309 | 28EA5A421952DC0900B46513 /* main.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXVariantGroup section */ 316 | 28EA5A3E1952DC0900B46513 /* InfoPlist.strings */ = { 317 | isa = PBXVariantGroup; 318 | children = ( 319 | 28EA5A3F1952DC0900B46513 /* en */, 320 | ); 321 | name = InfoPlist.strings; 322 | sourceTree = ""; 323 | }; 324 | /* End PBXVariantGroup section */ 325 | 326 | /* Begin XCBuildConfiguration section */ 327 | 28EA5A5C1952DC0900B46513 /* Debug */ = { 328 | isa = XCBuildConfiguration; 329 | buildSettings = { 330 | ALWAYS_SEARCH_USER_PATHS = NO; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BOOL_CONVERSION = YES; 336 | CLANG_WARN_CONSTANT_CONVERSION = YES; 337 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 338 | CLANG_WARN_EMPTY_BODY = YES; 339 | CLANG_WARN_ENUM_CONVERSION = YES; 340 | CLANG_WARN_INT_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 343 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 344 | COPY_PHASE_STRIP = NO; 345 | GCC_C_LANGUAGE_STANDARD = gnu99; 346 | GCC_DYNAMIC_NO_PIC = NO; 347 | GCC_OPTIMIZATION_LEVEL = 0; 348 | GCC_PREPROCESSOR_DEFINITIONS = ( 349 | "DEBUG=1", 350 | "$(inherited)", 351 | ); 352 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 353 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 354 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 355 | GCC_WARN_UNDECLARED_SELECTOR = YES; 356 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 357 | GCC_WARN_UNUSED_FUNCTION = YES; 358 | GCC_WARN_UNUSED_VARIABLE = YES; 359 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 360 | ONLY_ACTIVE_ARCH = YES; 361 | SDKROOT = iphoneos; 362 | TARGETED_DEVICE_FAMILY = 2; 363 | }; 364 | name = Debug; 365 | }; 366 | 28EA5A5D1952DC0900B46513 /* Release */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | ALWAYS_SEARCH_USER_PATHS = NO; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BOOL_CONVERSION = YES; 375 | CLANG_WARN_CONSTANT_CONVERSION = YES; 376 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 377 | CLANG_WARN_EMPTY_BODY = YES; 378 | CLANG_WARN_ENUM_CONVERSION = YES; 379 | CLANG_WARN_INT_CONVERSION = YES; 380 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 381 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 382 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 383 | COPY_PHASE_STRIP = YES; 384 | ENABLE_NS_ASSERTIONS = NO; 385 | GCC_C_LANGUAGE_STANDARD = gnu99; 386 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 387 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 388 | GCC_WARN_UNDECLARED_SELECTOR = YES; 389 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 390 | GCC_WARN_UNUSED_FUNCTION = YES; 391 | GCC_WARN_UNUSED_VARIABLE = YES; 392 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 393 | SDKROOT = iphoneos; 394 | TARGETED_DEVICE_FAMILY = 2; 395 | VALIDATE_PRODUCT = YES; 396 | }; 397 | name = Release; 398 | }; 399 | 28EA5A5F1952DC0900B46513 /* Debug */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 403 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 404 | CLANG_ENABLE_OBJC_ARC = NO; 405 | FRAMEWORK_SEARCH_PATHS = ( 406 | "$(inherited)", 407 | "/Volumes/cryptsafe/Development/INKA/open/ocv_ar-examples/opencv-ios", 408 | ); 409 | GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; 410 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 411 | GCC_PREFIX_HEADER = "OcvARBasic/OcvARBasic-Prefix.pch"; 412 | INFOPLIST_FILE = "OcvARBasic/OcvARBasic-Info.plist"; 413 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 414 | PRODUCT_NAME = "$(TARGET_NAME)"; 415 | WRAPPER_EXTENSION = app; 416 | }; 417 | name = Debug; 418 | }; 419 | 28EA5A601952DC0900B46513 /* Release */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 423 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 424 | CLANG_ENABLE_OBJC_ARC = NO; 425 | FRAMEWORK_SEARCH_PATHS = ( 426 | "$(inherited)", 427 | "/Volumes/cryptsafe/Development/INKA/open/ocv_ar-examples/opencv-ios", 428 | ); 429 | GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; 430 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 431 | GCC_PREFIX_HEADER = "OcvARBasic/OcvARBasic-Prefix.pch"; 432 | INFOPLIST_FILE = "OcvARBasic/OcvARBasic-Info.plist"; 433 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 434 | PRODUCT_NAME = "$(TARGET_NAME)"; 435 | WRAPPER_EXTENSION = app; 436 | }; 437 | name = Release; 438 | }; 439 | /* End XCBuildConfiguration section */ 440 | 441 | /* Begin XCConfigurationList section */ 442 | 28EA5A2D1952DC0900B46513 /* Build configuration list for PBXProject "OcvARBasic" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | 28EA5A5C1952DC0900B46513 /* Debug */, 446 | 28EA5A5D1952DC0900B46513 /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | defaultConfigurationName = Release; 450 | }; 451 | 28EA5A5E1952DC0900B46513 /* Build configuration list for PBXNativeTarget "OcvARBasic" */ = { 452 | isa = XCConfigurationList; 453 | buildConfigurations = ( 454 | 28EA5A5F1952DC0900B46513 /* Debug */, 455 | 28EA5A601952DC0900B46513 /* Release */, 456 | ); 457 | defaultConfigurationIsVisible = 0; 458 | defaultConfigurationName = Release; 459 | }; 460 | /* End XCConfigurationList section */ 461 | }; 462 | rootObject = 28EA5A2A1952DC0900B46513 /* Project object */; 463 | } 464 | -------------------------------------------------------------------------------- /examples/ios/OcvARBasicNativeCam/OcvARBasicNativeCam.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 283B34EF19866B3E00A04796 /* ipad2-front.xml in Resources */ = {isa = PBXBuildFile; fileRef = 283B34EE19866B3E00A04796 /* ipad2-front.xml */; }; 11 | 2885239E195327610001D473 /* CamView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2885239D195327610001D473 /* CamView.m */; }; 12 | 28EA5A361952DC0900B46513 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A351952DC0900B46513 /* Foundation.framework */; }; 13 | 28EA5A381952DC0900B46513 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A371952DC0900B46513 /* CoreGraphics.framework */; }; 14 | 28EA5A3A1952DC0900B46513 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A391952DC0900B46513 /* UIKit.framework */; }; 15 | 28EA5A401952DC0900B46513 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5A3E1952DC0900B46513 /* InfoPlist.strings */; }; 16 | 28EA5A421952DC0900B46513 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5A411952DC0900B46513 /* main.m */; }; 17 | 28EA5A461952DC0900B46513 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5A451952DC0900B46513 /* AppDelegate.m */; }; 18 | 28EA5A481952DC0900B46513 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5A471952DC0900B46513 /* Images.xcassets */; }; 19 | 28EA5A911952E1D300B46513 /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A901952E1D300B46513 /* opencv2.framework */; }; 20 | 28EA5A941952E1F700B46513 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A921952E1F700B46513 /* GLKit.framework */; }; 21 | 28EA5A951952E1F700B46513 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A931952E1F700B46513 /* OpenGLES.framework */; }; 22 | 28EA5A971952E1FF00B46513 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A961952E1FF00B46513 /* QuartzCore.framework */; }; 23 | 28EA5A991952E20500B46513 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A981952E20500B46513 /* CoreVideo.framework */; }; 24 | 28EA5A9B1952E20B00B46513 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A9A1952E20B00B46513 /* CoreMedia.framework */; }; 25 | 28EA5A9D1952E21000B46513 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A9C1952E21000B46513 /* CoreImage.framework */; }; 26 | 28EA5A9F1952E21700B46513 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5A9E1952E21700B46513 /* AVFoundation.framework */; }; 27 | 28EA5AA11952E21D00B46513 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28EA5AA01952E21D00B46513 /* AssetsLibrary.framework */; }; 28 | 28EA5AB41952E26F00B46513 /* detect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AA41952E26F00B46513 /* detect.cpp */; }; 29 | 28EA5AB51952E26F00B46513 /* ident.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AA61952E26F00B46513 /* ident.cpp */; }; 30 | 28EA5AB71952E26F00B46513 /* ident_templ.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AAA1952E26F00B46513 /* ident_templ.cpp */; }; 31 | 28EA5AB91952E26F00B46513 /* marker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AAD1952E26F00B46513 /* marker.cpp */; }; 32 | 28EA5ABB1952E26F00B46513 /* tools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AB11952E26F00B46513 /* tools.cpp */; }; 33 | 28EA5ABE1952E2CB00B46513 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5ABD1952E2CB00B46513 /* RootViewController.m */; }; 34 | 28EA5AC41952E76F00B46513 /* shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AC01952E76F00B46513 /* shader.cpp */; }; 35 | 28EA5AC51952E76F00B46513 /* Tools.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AC31952E76F00B46513 /* Tools.m */; }; 36 | 28EA5AC81952E85800B46513 /* GLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AC71952E85800B46513 /* GLView.m */; }; 37 | 28EA5AD01952E93A00B46513 /* marker_f.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5ACC1952E93A00B46513 /* marker_f.glsl */; }; 38 | 28EA5AD11952E93A00B46513 /* marker_v.glsl in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5ACD1952E93A00B46513 /* marker_v.glsl */; }; 39 | 28EA5AD41952EB2100B46513 /* ipad3-front.xml in Resources */ = {isa = PBXBuildFile; fileRef = 28EA5AD31952EB2100B46513 /* ipad3-front.xml */; }; 40 | 28EA5AD7195319D200B46513 /* ident_7x7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EA5AD5195319D200B46513 /* ident_7x7.cpp */; }; 41 | 28EFDE5E195AFA5600679F04 /* track.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28EFDE5C195AFA5600679F04 /* track.cpp */; }; 42 | 28F6A779196AD1110093478E /* threading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28F6A777196AD1110093478E /* threading.cpp */; }; 43 | /* End PBXBuildFile section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 283B34EE19866B3E00A04796 /* ipad2-front.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "ipad2-front.xml"; sourceTree = ""; }; 47 | 2885239C195327610001D473 /* CamView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CamView.h; sourceTree = ""; }; 48 | 2885239D195327610001D473 /* CamView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CamView.m; sourceTree = ""; }; 49 | 28EA5A321952DC0900B46513 /* OcvARBasicNativeCam.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OcvARBasicNativeCam.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 28EA5A351952DC0900B46513 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 51 | 28EA5A371952DC0900B46513 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 52 | 28EA5A391952DC0900B46513 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 53 | 28EA5A3D1952DC0900B46513 /* OcvARBasicNativeCam-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OcvARBasicNativeCam-Info.plist"; sourceTree = ""; }; 54 | 28EA5A3F1952DC0900B46513 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 55 | 28EA5A411952DC0900B46513 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 56 | 28EA5A431952DC0900B46513 /* OcvARBasicNativeCam-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OcvARBasicNativeCam-Prefix.pch"; sourceTree = ""; }; 57 | 28EA5A441952DC0900B46513 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 58 | 28EA5A451952DC0900B46513 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 59 | 28EA5A471952DC0900B46513 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 60 | 28EA5A4E1952DC0900B46513 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 61 | 28EA5A901952E1D300B46513 /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = opencv2.framework; path = "../../../opencv-ios/opencv2.framework"; sourceTree = ""; }; 62 | 28EA5A921952E1F700B46513 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; 63 | 28EA5A931952E1F700B46513 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 64 | 28EA5A961952E1FF00B46513 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 65 | 28EA5A981952E20500B46513 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 66 | 28EA5A9A1952E20B00B46513 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 67 | 28EA5A9C1952E21000B46513 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; 68 | 28EA5A9E1952E21700B46513 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 69 | 28EA5AA01952E21D00B46513 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; 70 | 28EA5AA31952E26F00B46513 /* conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conf.h; sourceTree = ""; }; 71 | 28EA5AA41952E26F00B46513 /* detect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = detect.cpp; sourceTree = ""; }; 72 | 28EA5AA51952E26F00B46513 /* detect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = detect.h; sourceTree = ""; }; 73 | 28EA5AA61952E26F00B46513 /* ident.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ident.cpp; sourceTree = ""; }; 74 | 28EA5AA71952E26F00B46513 /* ident.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ident.h; sourceTree = ""; }; 75 | 28EA5AAA1952E26F00B46513 /* ident_templ.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ident_templ.cpp; sourceTree = ""; }; 76 | 28EA5AAB1952E26F00B46513 /* ident_templ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ident_templ.h; sourceTree = ""; }; 77 | 28EA5AAD1952E26F00B46513 /* marker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = marker.cpp; sourceTree = ""; }; 78 | 28EA5AAE1952E26F00B46513 /* marker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = marker.h; sourceTree = ""; }; 79 | 28EA5AAF1952E26F00B46513 /* ocv_ar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocv_ar.h; sourceTree = ""; }; 80 | 28EA5AB11952E26F00B46513 /* tools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tools.cpp; sourceTree = ""; }; 81 | 28EA5AB21952E26F00B46513 /* tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tools.h; sourceTree = ""; }; 82 | 28EA5AB31952E26F00B46513 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; 83 | 28EA5ABC1952E2CB00B46513 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; 84 | 28EA5ABD1952E2CB00B46513 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; 85 | 28EA5AC01952E76F00B46513 /* shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shader.cpp; sourceTree = ""; }; 86 | 28EA5AC11952E76F00B46513 /* shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shader.h; sourceTree = ""; }; 87 | 28EA5AC21952E76F00B46513 /* Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tools.h; sourceTree = ""; }; 88 | 28EA5AC31952E76F00B46513 /* Tools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tools.m; sourceTree = ""; }; 89 | 28EA5AC61952E85800B46513 /* GLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLView.h; sourceTree = ""; }; 90 | 28EA5AC71952E85800B46513 /* GLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLView.m; sourceTree = ""; }; 91 | 28EA5ACC1952E93A00B46513 /* marker_f.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = marker_f.glsl; sourceTree = ""; }; 92 | 28EA5ACD1952E93A00B46513 /* marker_v.glsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = marker_v.glsl; sourceTree = ""; }; 93 | 28EA5AD31952EB2100B46513 /* ipad3-front.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "ipad3-front.xml"; sourceTree = ""; }; 94 | 28EA5AD5195319D200B46513 /* ident_7x7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ident_7x7.cpp; sourceTree = ""; }; 95 | 28EA5AD6195319D200B46513 /* ident_7x7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ident_7x7.h; sourceTree = ""; }; 96 | 28EFDE5C195AFA5600679F04 /* track.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = track.cpp; sourceTree = ""; }; 97 | 28EFDE5D195AFA5600679F04 /* track.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = track.h; sourceTree = ""; }; 98 | 28F6A777196AD1110093478E /* threading.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = threading.cpp; sourceTree = ""; }; 99 | 28F6A778196AD1110093478E /* threading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = threading.h; sourceTree = ""; }; 100 | /* End PBXFileReference section */ 101 | 102 | /* Begin PBXFrameworksBuildPhase section */ 103 | 28EA5A2F1952DC0900B46513 /* Frameworks */ = { 104 | isa = PBXFrameworksBuildPhase; 105 | buildActionMask = 2147483647; 106 | files = ( 107 | 28EA5AA11952E21D00B46513 /* AssetsLibrary.framework in Frameworks */, 108 | 28EA5A9F1952E21700B46513 /* AVFoundation.framework in Frameworks */, 109 | 28EA5A9D1952E21000B46513 /* CoreImage.framework in Frameworks */, 110 | 28EA5A9B1952E20B00B46513 /* CoreMedia.framework in Frameworks */, 111 | 28EA5A991952E20500B46513 /* CoreVideo.framework in Frameworks */, 112 | 28EA5A971952E1FF00B46513 /* QuartzCore.framework in Frameworks */, 113 | 28EA5A941952E1F700B46513 /* GLKit.framework in Frameworks */, 114 | 28EA5A951952E1F700B46513 /* OpenGLES.framework in Frameworks */, 115 | 28EA5A911952E1D300B46513 /* opencv2.framework in Frameworks */, 116 | 28EA5A381952DC0900B46513 /* CoreGraphics.framework in Frameworks */, 117 | 28EA5A3A1952DC0900B46513 /* UIKit.framework in Frameworks */, 118 | 28EA5A361952DC0900B46513 /* Foundation.framework in Frameworks */, 119 | ); 120 | runOnlyForDeploymentPostprocessing = 0; 121 | }; 122 | /* End PBXFrameworksBuildPhase section */ 123 | 124 | /* Begin PBXGroup section */ 125 | 28EA5A291952DC0900B46513 = { 126 | isa = PBXGroup; 127 | children = ( 128 | 28EA5A3B1952DC0900B46513 /* OcvARBasicNativeCam */, 129 | 28EA5A341952DC0900B46513 /* Frameworks */, 130 | 28EA5A331952DC0900B46513 /* Products */, 131 | ); 132 | sourceTree = ""; 133 | }; 134 | 28EA5A331952DC0900B46513 /* Products */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 28EA5A321952DC0900B46513 /* OcvARBasicNativeCam.app */, 138 | ); 139 | name = Products; 140 | sourceTree = ""; 141 | }; 142 | 28EA5A341952DC0900B46513 /* Frameworks */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 28EA5AA01952E21D00B46513 /* AssetsLibrary.framework */, 146 | 28EA5A9E1952E21700B46513 /* AVFoundation.framework */, 147 | 28EA5A9C1952E21000B46513 /* CoreImage.framework */, 148 | 28EA5A9A1952E20B00B46513 /* CoreMedia.framework */, 149 | 28EA5A981952E20500B46513 /* CoreVideo.framework */, 150 | 28EA5A961952E1FF00B46513 /* QuartzCore.framework */, 151 | 28EA5A921952E1F700B46513 /* GLKit.framework */, 152 | 28EA5A931952E1F700B46513 /* OpenGLES.framework */, 153 | 28EA5A901952E1D300B46513 /* opencv2.framework */, 154 | 28EA5A351952DC0900B46513 /* Foundation.framework */, 155 | 28EA5A371952DC0900B46513 /* CoreGraphics.framework */, 156 | 28EA5A391952DC0900B46513 /* UIKit.framework */, 157 | 28EA5A4E1952DC0900B46513 /* XCTest.framework */, 158 | ); 159 | name = Frameworks; 160 | sourceTree = ""; 161 | }; 162 | 28EA5A3B1952DC0900B46513 /* OcvARBasicNativeCam */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 28EA5AA21952E26F00B46513 /* ocv_ar */, 166 | 28EA5ABF1952E76F00B46513 /* helper */, 167 | 28EA5A441952DC0900B46513 /* AppDelegate.h */, 168 | 28EA5A451952DC0900B46513 /* AppDelegate.m */, 169 | 28EA5ABC1952E2CB00B46513 /* RootViewController.h */, 170 | 28EA5ABD1952E2CB00B46513 /* RootViewController.m */, 171 | 2885239C195327610001D473 /* CamView.h */, 172 | 2885239D195327610001D473 /* CamView.m */, 173 | 28EA5AC61952E85800B46513 /* GLView.h */, 174 | 28EA5AC71952E85800B46513 /* GLView.m */, 175 | 28EA5A471952DC0900B46513 /* Images.xcassets */, 176 | 28EA5AD21952EB2100B46513 /* cam-intrinsics */, 177 | 28EA5AC91952E93A00B46513 /* shaders */, 178 | 28EA5A3C1952DC0900B46513 /* Supporting Files */, 179 | ); 180 | path = OcvARBasicNativeCam; 181 | sourceTree = ""; 182 | }; 183 | 28EA5A3C1952DC0900B46513 /* Supporting Files */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 28EA5A3D1952DC0900B46513 /* OcvARBasicNativeCam-Info.plist */, 187 | 28EA5A3E1952DC0900B46513 /* InfoPlist.strings */, 188 | 28EA5A411952DC0900B46513 /* main.m */, 189 | 28EA5A431952DC0900B46513 /* OcvARBasicNativeCam-Prefix.pch */, 190 | ); 191 | name = "Supporting Files"; 192 | sourceTree = ""; 193 | }; 194 | 28EA5AA21952E26F00B46513 /* ocv_ar */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | 28EA5AA31952E26F00B46513 /* conf.h */, 198 | 28EA5AA51952E26F00B46513 /* detect.h */, 199 | 28EA5AA41952E26F00B46513 /* detect.cpp */, 200 | 28EA5AA71952E26F00B46513 /* ident.h */, 201 | 28EA5AA61952E26F00B46513 /* ident.cpp */, 202 | 28EA5AD6195319D200B46513 /* ident_7x7.h */, 203 | 28EA5AD5195319D200B46513 /* ident_7x7.cpp */, 204 | 28EA5AAB1952E26F00B46513 /* ident_templ.h */, 205 | 28EA5AAA1952E26F00B46513 /* ident_templ.cpp */, 206 | 28EA5AAE1952E26F00B46513 /* marker.h */, 207 | 28EA5AAD1952E26F00B46513 /* marker.cpp */, 208 | 28EA5AAF1952E26F00B46513 /* ocv_ar.h */, 209 | 28F6A778196AD1110093478E /* threading.h */, 210 | 28F6A777196AD1110093478E /* threading.cpp */, 211 | 28EA5AB21952E26F00B46513 /* tools.h */, 212 | 28EA5AB11952E26F00B46513 /* tools.cpp */, 213 | 28EFDE5D195AFA5600679F04 /* track.h */, 214 | 28EFDE5C195AFA5600679F04 /* track.cpp */, 215 | 28EA5AB31952E26F00B46513 /* types.h */, 216 | ); 217 | name = ocv_ar; 218 | path = ../../../../ocv_ar; 219 | sourceTree = ""; 220 | }; 221 | 28EA5ABF1952E76F00B46513 /* helper */ = { 222 | isa = PBXGroup; 223 | children = ( 224 | 28EA5AC11952E76F00B46513 /* shader.h */, 225 | 28EA5AC01952E76F00B46513 /* shader.cpp */, 226 | 28EA5AC21952E76F00B46513 /* Tools.h */, 227 | 28EA5AC31952E76F00B46513 /* Tools.m */, 228 | ); 229 | path = helper; 230 | sourceTree = ""; 231 | }; 232 | 28EA5AC91952E93A00B46513 /* shaders */ = { 233 | isa = PBXGroup; 234 | children = ( 235 | 28EA5ACC1952E93A00B46513 /* marker_f.glsl */, 236 | 28EA5ACD1952E93A00B46513 /* marker_v.glsl */, 237 | ); 238 | path = shaders; 239 | sourceTree = ""; 240 | }; 241 | 28EA5AD21952EB2100B46513 /* cam-intrinsics */ = { 242 | isa = PBXGroup; 243 | children = ( 244 | 283B34EE19866B3E00A04796 /* ipad2-front.xml */, 245 | 28EA5AD31952EB2100B46513 /* ipad3-front.xml */, 246 | ); 247 | path = "cam-intrinsics"; 248 | sourceTree = ""; 249 | }; 250 | /* End PBXGroup section */ 251 | 252 | /* Begin PBXNativeTarget section */ 253 | 28EA5A311952DC0900B46513 /* OcvARBasicNativeCam */ = { 254 | isa = PBXNativeTarget; 255 | buildConfigurationList = 28EA5A5E1952DC0900B46513 /* Build configuration list for PBXNativeTarget "OcvARBasicNativeCam" */; 256 | buildPhases = ( 257 | 28EA5A2E1952DC0900B46513 /* Sources */, 258 | 28EA5A2F1952DC0900B46513 /* Frameworks */, 259 | 28EA5A301952DC0900B46513 /* Resources */, 260 | ); 261 | buildRules = ( 262 | ); 263 | dependencies = ( 264 | ); 265 | name = OcvARBasicNativeCam; 266 | productName = OcvARBasic; 267 | productReference = 28EA5A321952DC0900B46513 /* OcvARBasicNativeCam.app */; 268 | productType = "com.apple.product-type.application"; 269 | }; 270 | /* End PBXNativeTarget section */ 271 | 272 | /* Begin PBXProject section */ 273 | 28EA5A2A1952DC0900B46513 /* Project object */ = { 274 | isa = PBXProject; 275 | attributes = { 276 | LastUpgradeCheck = 0510; 277 | ORGANIZATIONNAME = "INKA Research Group"; 278 | }; 279 | buildConfigurationList = 28EA5A2D1952DC0900B46513 /* Build configuration list for PBXProject "OcvARBasicNativeCam" */; 280 | compatibilityVersion = "Xcode 3.2"; 281 | developmentRegion = English; 282 | hasScannedForEncodings = 0; 283 | knownRegions = ( 284 | en, 285 | ); 286 | mainGroup = 28EA5A291952DC0900B46513; 287 | productRefGroup = 28EA5A331952DC0900B46513 /* Products */; 288 | projectDirPath = ""; 289 | projectRoot = ""; 290 | targets = ( 291 | 28EA5A311952DC0900B46513 /* OcvARBasicNativeCam */, 292 | ); 293 | }; 294 | /* End PBXProject section */ 295 | 296 | /* Begin PBXResourcesBuildPhase section */ 297 | 28EA5A301952DC0900B46513 /* Resources */ = { 298 | isa = PBXResourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | 28EA5AD41952EB2100B46513 /* ipad3-front.xml in Resources */, 302 | 28EA5AD01952E93A00B46513 /* marker_f.glsl in Resources */, 303 | 283B34EF19866B3E00A04796 /* ipad2-front.xml in Resources */, 304 | 28EA5A401952DC0900B46513 /* InfoPlist.strings in Resources */, 305 | 28EA5A481952DC0900B46513 /* Images.xcassets in Resources */, 306 | 28EA5AD11952E93A00B46513 /* marker_v.glsl in Resources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | /* End PBXResourcesBuildPhase section */ 311 | 312 | /* Begin PBXSourcesBuildPhase section */ 313 | 28EA5A2E1952DC0900B46513 /* Sources */ = { 314 | isa = PBXSourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | 28EA5AC41952E76F00B46513 /* shader.cpp in Sources */, 318 | 28EA5AB71952E26F00B46513 /* ident_templ.cpp in Sources */, 319 | 2885239E195327610001D473 /* CamView.m in Sources */, 320 | 28EA5AB41952E26F00B46513 /* detect.cpp in Sources */, 321 | 28EA5ABB1952E26F00B46513 /* tools.cpp in Sources */, 322 | 28EA5AC81952E85800B46513 /* GLView.m in Sources */, 323 | 28EA5A461952DC0900B46513 /* AppDelegate.m in Sources */, 324 | 28EA5ABE1952E2CB00B46513 /* RootViewController.m in Sources */, 325 | 28EA5AD7195319D200B46513 /* ident_7x7.cpp in Sources */, 326 | 28EA5AC51952E76F00B46513 /* Tools.m in Sources */, 327 | 28EA5AB51952E26F00B46513 /* ident.cpp in Sources */, 328 | 28EFDE5E195AFA5600679F04 /* track.cpp in Sources */, 329 | 28F6A779196AD1110093478E /* threading.cpp in Sources */, 330 | 28EA5AB91952E26F00B46513 /* marker.cpp in Sources */, 331 | 28EA5A421952DC0900B46513 /* main.m in Sources */, 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | }; 335 | /* End PBXSourcesBuildPhase section */ 336 | 337 | /* Begin PBXVariantGroup section */ 338 | 28EA5A3E1952DC0900B46513 /* InfoPlist.strings */ = { 339 | isa = PBXVariantGroup; 340 | children = ( 341 | 28EA5A3F1952DC0900B46513 /* en */, 342 | ); 343 | name = InfoPlist.strings; 344 | sourceTree = ""; 345 | }; 346 | /* End PBXVariantGroup section */ 347 | 348 | /* Begin XCBuildConfiguration section */ 349 | 28EA5A5C1952DC0900B46513 /* Debug */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | ALWAYS_SEARCH_USER_PATHS = NO; 353 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 354 | CLANG_CXX_LIBRARY = "libc++"; 355 | CLANG_ENABLE_MODULES = YES; 356 | CLANG_ENABLE_OBJC_ARC = YES; 357 | CLANG_WARN_BOOL_CONVERSION = YES; 358 | CLANG_WARN_CONSTANT_CONVERSION = YES; 359 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 360 | CLANG_WARN_EMPTY_BODY = YES; 361 | CLANG_WARN_ENUM_CONVERSION = YES; 362 | CLANG_WARN_INT_CONVERSION = YES; 363 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 364 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 365 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 366 | COPY_PHASE_STRIP = NO; 367 | GCC_C_LANGUAGE_STANDARD = gnu99; 368 | GCC_DYNAMIC_NO_PIC = NO; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 375 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 376 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 377 | GCC_WARN_UNDECLARED_SELECTOR = YES; 378 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 379 | GCC_WARN_UNUSED_FUNCTION = YES; 380 | GCC_WARN_UNUSED_VARIABLE = YES; 381 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 382 | ONLY_ACTIVE_ARCH = YES; 383 | SDKROOT = iphoneos; 384 | TARGETED_DEVICE_FAMILY = 2; 385 | }; 386 | name = Debug; 387 | }; 388 | 28EA5A5D1952DC0900B46513 /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BOOL_CONVERSION = YES; 397 | CLANG_WARN_CONSTANT_CONVERSION = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INT_CONVERSION = YES; 402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 405 | COPY_PHASE_STRIP = YES; 406 | ENABLE_NS_ASSERTIONS = NO; 407 | GCC_C_LANGUAGE_STANDARD = gnu99; 408 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 409 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 410 | GCC_WARN_UNDECLARED_SELECTOR = YES; 411 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 412 | GCC_WARN_UNUSED_FUNCTION = YES; 413 | GCC_WARN_UNUSED_VARIABLE = YES; 414 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 415 | SDKROOT = iphoneos; 416 | TARGETED_DEVICE_FAMILY = 2; 417 | VALIDATE_PRODUCT = YES; 418 | }; 419 | name = Release; 420 | }; 421 | 28EA5A5F1952DC0900B46513 /* Debug */ = { 422 | isa = XCBuildConfiguration; 423 | buildSettings = { 424 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 425 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 426 | CLANG_ENABLE_OBJC_ARC = NO; 427 | FRAMEWORK_SEARCH_PATHS = ( 428 | "$(inherited)", 429 | "/Volumes/cryptsafe/Development/INKA/open/ocv_ar-examples/opencv-ios", 430 | ); 431 | GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; 432 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 433 | GCC_PREFIX_HEADER = "OcvARBasicNativeCam/OcvARBasicNativeCam-Prefix.pch"; 434 | INFOPLIST_FILE = "OcvARBasicNativeCam/OcvARBasicNativeCam-Info.plist"; 435 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 436 | PRODUCT_NAME = OcvARBasicNativeCam; 437 | WRAPPER_EXTENSION = app; 438 | }; 439 | name = Debug; 440 | }; 441 | 28EA5A601952DC0900B46513 /* Release */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 446 | CLANG_ENABLE_OBJC_ARC = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "/Volumes/cryptsafe/Development/INKA/open/ocv_ar-examples/opencv-ios", 450 | ); 451 | GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; 452 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 453 | GCC_PREFIX_HEADER = "OcvARBasicNativeCam/OcvARBasicNativeCam-Prefix.pch"; 454 | INFOPLIST_FILE = "OcvARBasicNativeCam/OcvARBasicNativeCam-Info.plist"; 455 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 456 | PRODUCT_NAME = OcvARBasicNativeCam; 457 | WRAPPER_EXTENSION = app; 458 | }; 459 | name = Release; 460 | }; 461 | /* End XCBuildConfiguration section */ 462 | 463 | /* Begin XCConfigurationList section */ 464 | 28EA5A2D1952DC0900B46513 /* Build configuration list for PBXProject "OcvARBasicNativeCam" */ = { 465 | isa = XCConfigurationList; 466 | buildConfigurations = ( 467 | 28EA5A5C1952DC0900B46513 /* Debug */, 468 | 28EA5A5D1952DC0900B46513 /* Release */, 469 | ); 470 | defaultConfigurationIsVisible = 0; 471 | defaultConfigurationName = Release; 472 | }; 473 | 28EA5A5E1952DC0900B46513 /* Build configuration list for PBXNativeTarget "OcvARBasicNativeCam" */ = { 474 | isa = XCConfigurationList; 475 | buildConfigurations = ( 476 | 28EA5A5F1952DC0900B46513 /* Debug */, 477 | 28EA5A601952DC0900B46513 /* Release */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | /* End XCConfigurationList section */ 483 | }; 484 | rootObject = 28EA5A2A1952DC0900B46513 /* Project object */; 485 | } 486 | --------------------------------------------------------------------------------