├── .gitignore ├── Default-568h@2x.png ├── Default-Landscape@2x~ipad.png ├── Default-Landscape~ipad.png ├── Default-Portrait@2x~ipad.png ├── Default-Portrait~ipad.png ├── Default.png ├── Default@2x.png ├── Icon-72.png ├── Icon-72@2x.png ├── Icon-Small-50.png ├── Icon-Small-50@2x.png ├── Icon-Small.png ├── Icon-Small@2x.png ├── Icon.png ├── Icon@2x.png ├── OpenCV Tutorial.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── OpenCV Tutorial ├── AppDelegate.h ├── AppDelegate.mm ├── BaseSampleViewController.h ├── BaseSampleViewController.mm ├── BooleanTableViewCell.h ├── BooleanTableViewCell.mm ├── BooleanTableViewCell.xib ├── CameraCalibrationAlgorithm.cpp ├── CameraCalibrationAlgorithm.h ├── CameraCalibrationSample.cpp ├── CameraCalibrationSample.h ├── CartoonFilter.cpp ├── CartoonFilter.h ├── ContourDetectionSample.cpp ├── ContourDetectionSample.h ├── ContourDetectionSampleIcon.png ├── ContourDetectionSampleIcon@2x.png ├── DefaultSampleIcon.png ├── DefaultSampleIcon~ipad.png ├── DetailViewController.h ├── DetailViewController.mm ├── DoubleTableViewCell.h ├── DoubleTableViewCell.mm ├── DoubleTableViewCell.xib ├── DrawingCanvas.cpp ├── DrawingCanvas.h ├── EdgeDetectionSample.cpp ├── EdgeDetectionSample.h ├── EdgeDetectionSampleIcon.png ├── EdgeDetectionSampleIcon~ipad.png ├── EnumTableViewCell.h ├── EnumTableViewCell.mm ├── EnumTableViewCell.xib ├── FPSCalculator.h ├── FPSCalculator.mm ├── FeatureDetectionClass.cpp ├── FeatureDetectionClass.h ├── FeatureDetectionSample.cpp ├── FeatureDetectionSample.h ├── FeatureDetectionSampleIcon.png ├── FloatTableViewCell.h ├── FloatTableViewCell.mm ├── FloatTableViewCell.xib ├── Globals.cpp ├── Globals.h ├── ImageFiltersSample.cpp ├── ImageFiltersSample.h ├── ImageViewController.h ├── ImageViewController.mm ├── Int32TableViewCell.h ├── Int32TableViewCell.mm ├── Int32TableViewCell.xib ├── Mandrill512x512.png ├── MasterViewController.h ├── MasterViewController.mm ├── NSString+StdString.h ├── NSString+StdString.mm ├── ObjectTrackingClass.cpp ├── ObjectTrackingClass.h ├── ObjectTrackingSample.cpp ├── ObjectTrackingSample.h ├── ObjectTrackingSampleIcon.png ├── OpenCV Tutorial-Info.plist ├── OpenCV Tutorial-Prefix.pch ├── OptionCell.h ├── OptionCell.mm ├── OptionsTableView.h ├── OptionsTableView.mm ├── ROFSample.cpp ├── ROFSample.h ├── ROFSampleIcon.png ├── SampleBase.cpp ├── SampleBase.h ├── SampleFacade.h ├── SampleFacade.mm ├── SampleOptions.cpp ├── SampleOptions.h ├── SampleOptionsTableViewDelegate.h ├── SampleOptionsTableViewDelegate.mm ├── UIImage2OpenCV.h ├── UIImage2OpenCV.mm ├── VideoTracking.cpp ├── VideoTracking.hpp ├── VideoTrackingSampleIcon.png ├── VideoViewController.h ├── VideoViewController.mm ├── ViewController.h ├── ViewController.mm ├── cog_01.png ├── cog_01@2x.png ├── cog_02.png ├── cog_02@2x.png ├── cvneon.cpp ├── cvneon.h ├── en.lproj │ ├── InfoPlist.strings │ ├── MainStoryboard_iPad.storyboard │ ├── MainStoryboard_iPhone.storyboard │ └── switchCamera.png ├── main.m ├── main.mm ├── photos_polaroid.png ├── photos_polaroid@2x.png ├── record.png ├── record@2x.png ├── refresh.png ├── refresh@2x.png ├── refresh_straight_arrows.png ├── refresh_straight_arrows@2x.png ├── repeat.png ├── repeat@2x.png ├── switchCamera.png ├── switchCamera@2x.png ├── totalvariation.cpp └── totalvariation.h ├── README.md ├── iTunesArtwork.png ├── iTunesArtwork@2x.png └── opencv2.framework ├── Headers ├── Resources ├── Versions ├── A │ ├── Headers │ │ ├── calib3d.hpp │ │ ├── calib3d │ │ │ ├── calib3d.hpp │ │ │ └── calib3d_c.h │ │ ├── core.hpp │ │ ├── core │ │ │ ├── affine.hpp │ │ │ ├── base.hpp │ │ │ ├── bufferpool.hpp │ │ │ ├── core.hpp │ │ │ ├── core_c.h │ │ │ ├── cuda.hpp │ │ │ ├── cuda.inl.hpp │ │ │ ├── cuda_stream_accessor.hpp │ │ │ ├── cuda_types.hpp │ │ │ ├── cvdef.h │ │ │ ├── cvstd.hpp │ │ │ ├── cvstd.inl.hpp │ │ │ ├── directx.hpp │ │ │ ├── eigen.hpp │ │ │ ├── ippasync.hpp │ │ │ ├── mat.hpp │ │ │ ├── mat.inl.hpp │ │ │ ├── matx.hpp │ │ │ ├── ocl.hpp │ │ │ ├── ocl_genbase.hpp │ │ │ ├── opengl.hpp │ │ │ ├── operations.hpp │ │ │ ├── optim.hpp │ │ │ ├── persistence.hpp │ │ │ ├── private.cuda.hpp │ │ │ ├── private.hpp │ │ │ ├── ptr.inl.hpp │ │ │ ├── traits.hpp │ │ │ ├── types.hpp │ │ │ ├── types_c.h │ │ │ ├── utility.hpp │ │ │ ├── version.hpp │ │ │ └── wimage.hpp │ │ ├── features2d.hpp │ │ ├── features2d │ │ │ └── features2d.hpp │ │ ├── flann.hpp │ │ ├── flann │ │ │ ├── all_indices.h │ │ │ ├── allocator.h │ │ │ ├── any.h │ │ │ ├── autotuned_index.h │ │ │ ├── composite_index.h │ │ │ ├── config.h │ │ │ ├── defines.h │ │ │ ├── dist.h │ │ │ ├── dummy.h │ │ │ ├── dynamic_bitset.h │ │ │ ├── flann.hpp │ │ │ ├── flann_base.hpp │ │ │ ├── general.h │ │ │ ├── ground_truth.h │ │ │ ├── hdf5.h │ │ │ ├── heap.h │ │ │ ├── hierarchical_clustering_index.h │ │ │ ├── index_testing.h │ │ │ ├── kdtree_index.h │ │ │ ├── kdtree_single_index.h │ │ │ ├── kmeans_index.h │ │ │ ├── linear_index.h │ │ │ ├── logger.h │ │ │ ├── lsh_index.h │ │ │ ├── lsh_table.h │ │ │ ├── matrix.h │ │ │ ├── miniflann.hpp │ │ │ ├── nn_index.h │ │ │ ├── object_factory.h │ │ │ ├── params.h │ │ │ ├── random.h │ │ │ ├── result_set.h │ │ │ ├── sampling.h │ │ │ ├── saving.h │ │ │ ├── simplex_downhill.h │ │ │ └── timer.h │ │ ├── highgui.hpp │ │ ├── highgui │ │ │ ├── highgui.hpp │ │ │ └── highgui_c.h │ │ ├── imgcodecs.hpp │ │ ├── imgcodecs │ │ │ ├── imgcodecs.hpp │ │ │ ├── imgcodecs_c.h │ │ │ └── ios.h │ │ ├── imgproc.hpp │ │ ├── imgproc │ │ │ ├── imgproc.hpp │ │ │ ├── imgproc_c.h │ │ │ └── types_c.h │ │ ├── ml.hpp │ │ ├── ml │ │ │ └── ml.hpp │ │ ├── objdetect.hpp │ │ ├── objdetect │ │ │ ├── detection_based_tracker.hpp │ │ │ ├── objdetect.hpp │ │ │ └── objdetect_c.h │ │ ├── opencv.hpp │ │ ├── opencv_modules.hpp │ │ ├── photo.hpp │ │ ├── photo │ │ │ ├── cuda.hpp │ │ │ ├── photo.hpp │ │ │ └── photo_c.h │ │ ├── shape.hpp │ │ ├── shape │ │ │ ├── emdL1.hpp │ │ │ ├── hist_cost.hpp │ │ │ ├── shape.hpp │ │ │ ├── shape_distance.hpp │ │ │ └── shape_transformer.hpp │ │ ├── stitching.hpp │ │ ├── stitching │ │ │ ├── detail │ │ │ │ ├── autocalib.hpp │ │ │ │ ├── blenders.hpp │ │ │ │ ├── camera.hpp │ │ │ │ ├── exposure_compensate.hpp │ │ │ │ ├── matchers.hpp │ │ │ │ ├── motion_estimators.hpp │ │ │ │ ├── seam_finders.hpp │ │ │ │ ├── timelapsers.hpp │ │ │ │ ├── util.hpp │ │ │ │ ├── util_inl.hpp │ │ │ │ ├── warpers.hpp │ │ │ │ └── warpers_inl.hpp │ │ │ └── warpers.hpp │ │ ├── video.hpp │ │ ├── video │ │ │ ├── background_segm.hpp │ │ │ ├── tracking.hpp │ │ │ ├── tracking_c.h │ │ │ └── video.hpp │ │ ├── videoio.hpp │ │ ├── videoio │ │ │ ├── cap_ios.h │ │ │ ├── videoio.hpp │ │ │ └── videoio_c.h │ │ ├── videostab.hpp │ │ ├── videostab │ │ │ ├── deblurring.hpp │ │ │ ├── fast_marching.hpp │ │ │ ├── fast_marching_inl.hpp │ │ │ ├── frame_source.hpp │ │ │ ├── global_motion.hpp │ │ │ ├── inpainting.hpp │ │ │ ├── log.hpp │ │ │ ├── motion_core.hpp │ │ │ ├── motion_stabilizing.hpp │ │ │ ├── optical_flow.hpp │ │ │ ├── outlier_rejection.hpp │ │ │ ├── ring_buffer.hpp │ │ │ ├── stabilizer.hpp │ │ │ └── wobble_suppression.hpp │ │ └── world.hpp │ ├── Resources │ │ └── Info.plist │ └── opencv2 └── Current └── opencv2 /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/osx,xcode,objective-c 2 | 3 | ### OSX ### 4 | .DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | 8 | # Icon must end with two \r 9 | Icon 10 | 11 | 12 | # Thumbnails 13 | ._* 14 | 15 | # Files that might appear in the root of a volume 16 | .DocumentRevisions-V100 17 | .fseventsd 18 | .Spotlight-V100 19 | .TemporaryItems 20 | .Trashes 21 | .VolumeIcon.icns 22 | 23 | # Directories potentially created on remote AFP share 24 | .AppleDB 25 | .AppleDesktop 26 | Network Trash Folder 27 | Temporary Items 28 | .apdisk 29 | 30 | 31 | ### Xcode ### 32 | # Xcode 33 | # 34 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 35 | 36 | ## Build generated 37 | build/ 38 | DerivedData 39 | 40 | ## Various settings 41 | *.pbxuser 42 | !default.pbxuser 43 | *.mode1v3 44 | !default.mode1v3 45 | *.mode2v3 46 | !default.mode2v3 47 | *.perspectivev3 48 | !default.perspectivev3 49 | xcuserdata 50 | 51 | ## Other 52 | *.xccheckout 53 | *.moved-aside 54 | *.xcuserstate 55 | 56 | 57 | ### Objective-C ### 58 | # Xcode 59 | # 60 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 61 | 62 | ## Build generated 63 | build/ 64 | DerivedData 65 | 66 | ## Various settings 67 | *.pbxuser 68 | !default.pbxuser 69 | *.mode1v3 70 | !default.mode1v3 71 | *.mode2v3 72 | !default.mode2v3 73 | *.perspectivev3 74 | !default.perspectivev3 75 | xcuserdata 76 | 77 | ## Other 78 | *.xccheckout 79 | *.moved-aside 80 | *.xcuserstate 81 | *.xcscmblueprint 82 | 83 | ## Obj-C/Swift specific 84 | *.hmap 85 | *.ipa 86 | 87 | # CocoaPods 88 | # 89 | # We recommend against adding the Pods directory to your .gitignore. However 90 | # you should judge for yourself, the pros and cons are mentioned at: 91 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 92 | # 93 | #Pods/ 94 | 95 | # Carthage 96 | # 97 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 98 | # Carthage/Checkouts 99 | 100 | Carthage/Build 101 | 102 | ### Objective-C Patch ### 103 | *.xcscmblueprint 104 | 105 | ### Object UML ### 106 | .ObjcUML -------------------------------------------------------------------------------- /Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Default-568h@2x.png -------------------------------------------------------------------------------- /Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Default.png -------------------------------------------------------------------------------- /Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Default@2x.png -------------------------------------------------------------------------------- /Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Icon-72.png -------------------------------------------------------------------------------- /Icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Icon-72@2x.png -------------------------------------------------------------------------------- /Icon-Small-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Icon-Small-50.png -------------------------------------------------------------------------------- /Icon-Small-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Icon-Small-50@2x.png -------------------------------------------------------------------------------- /Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Icon-Small.png -------------------------------------------------------------------------------- /Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Icon-Small@2x.png -------------------------------------------------------------------------------- /Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Icon.png -------------------------------------------------------------------------------- /Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/Icon@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OpenCV Tutorial/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleBase.h" 11 | #import "SampleFacade.h" 12 | 13 | @interface AppDelegate : UIResponder 14 | { 15 | @public 16 | std::vector allSamples; 17 | } 18 | @property (strong, nonatomic) UIWindow *window; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /OpenCV Tutorial/BaseSampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseSampleViewController.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/20/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "SampleBase.h" 12 | #import "SampleFacade.h" 13 | 14 | typedef void (^SaveImageCompletionHandler)(); 15 | 16 | #define kSaveImageActionTitle @"Save image" 17 | 18 | @interface BaseSampleViewController : UIViewController 19 | 20 | @property (readonly) SampleFacade * currentSample; 21 | 22 | - (void) configureView; 23 | - (void) setSample:(SampleFacade*) sample; 24 | - (void) saveImage:(UIImage*) image withCompletionHandler: (SaveImageCompletionHandler) handler; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenCV Tutorial/BaseSampleViewController.mm: -------------------------------------------------------------------------------- 1 | // 2 | // BaseSampleViewController.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/20/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "BaseSampleViewController.h" 10 | #import "NSString+StdString.h" 11 | #import "UIImage2OpenCV.h" 12 | 13 | @interface BaseSampleViewController () 14 | 15 | @end 16 | 17 | @implementation BaseSampleViewController 18 | @synthesize currentSample = _currentSample; 19 | 20 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 21 | { 22 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 23 | if (self) 24 | { 25 | // Custom initialization 26 | } 27 | return self; 28 | } 29 | 30 | - (void)viewDidLoad 31 | { 32 | [super viewDidLoad]; 33 | // Do any additional setup after loading the view. 34 | } 35 | 36 | - (void)viewDidUnload 37 | { 38 | [super viewDidUnload]; 39 | // Release any retained subviews of the main view. 40 | } 41 | 42 | - (void) setSample:(SampleFacade*) sample 43 | { 44 | _currentSample = sample; 45 | 46 | [self configureView]; 47 | } 48 | 49 | - (void) configureView 50 | { 51 | if (self.currentSample) 52 | { 53 | self.title = [self.currentSample title]; 54 | } 55 | } 56 | 57 | #pragma mark - Image Saving 58 | 59 | - (void) saveImage:(UIImage *) image withCompletionHandler: (SaveImageCompletionHandler) handler 60 | { 61 | UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); 62 | if (handler) 63 | handler(); 64 | } 65 | 66 | - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo 67 | { 68 | if (error != NULL) 69 | { 70 | NSLog(@"Error during saving image: %@", error); 71 | } 72 | } 73 | 74 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 75 | { 76 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 77 | { 78 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 79 | } 80 | else 81 | { 82 | return YES; 83 | } 84 | } 85 | 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /OpenCV Tutorial/BooleanTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // RangeValueTableViewCell.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/8/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleOptions.h" 11 | #import "OptionCell.h" 12 | 13 | @interface BooleanTableViewCell : OptionCell 14 | 15 | - (void) configureWithOption: (BooleanOption*) option; 16 | - (IBAction)switchValueChanged:(id)sender; 17 | 18 | @property BooleanOption * option; 19 | @property (weak, nonatomic) IBOutlet UILabel *label; 20 | @property (weak, nonatomic) IBOutlet UISwitch *switchValue; 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /OpenCV Tutorial/BooleanTableViewCell.mm: -------------------------------------------------------------------------------- 1 | // 2 | // RangeValueTableViewCell.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/8/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "BooleanTableViewCell.h" 10 | #import "NSString+StdString.h" 11 | 12 | @implementation BooleanTableViewCell 13 | @synthesize option; 14 | @synthesize label; 15 | @synthesize switchValue; 16 | 17 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 18 | { 19 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 20 | if (self) 21 | { 22 | NSLog(@"Cell height at startup:%f", self.bounds.size.height); 23 | // Initialization code 24 | } 25 | return self; 26 | } 27 | 28 | 29 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 30 | { 31 | [super setSelected:selected animated:animated]; 32 | 33 | // Configure the view for the selected state 34 | } 35 | 36 | - (void) configureWithOption: (BooleanOption*) opt 37 | { 38 | self.option = opt; 39 | 40 | NSLog(@"BooleanTableViewCell::configureWithOption - %d", (int)opt->getValue()); 41 | 42 | self.label.text = [NSString stringWithStdString:opt->getName()]; 43 | self.switchValue.on = opt->getValue(); 44 | 45 | } 46 | 47 | - (IBAction)switchValueChanged:(id)sender 48 | { 49 | NSLog(@"Switch value changed to %d", (int)(self.switchValue.on)); 50 | bool changed = option->setValue(self.switchValue.on); 51 | 52 | if (changed && self.delegate) 53 | { 54 | [self.delegate optionDidChanged:option]; 55 | } 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /OpenCV Tutorial/CameraCalibrationAlgorithm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | enum PatternType { 9 | CHESSBOARD = 0, 10 | CIRCLES_GRID = 1, 11 | ACIRCLES_GRID = 2 12 | }; 13 | 14 | class CameraCalibrationAlgorithm 15 | { 16 | public: 17 | typedef std::vector VectorOf3DPoints; 18 | typedef std::vector VectorOf2DPoints; 19 | typedef std::vector > VectorOfVectorOf3DPoints; 20 | typedef std::vector > VectorOfVectorOf2DPoints; 21 | typedef std::vector VectorOfMat; 22 | 23 | CameraCalibrationAlgorithm(cv::Size patternSize, PatternType type); 24 | 25 | bool detectCorners(const cv::Mat& frame, VectorOf2DPoints& corners2d) const; 26 | 27 | bool calibrateCamera( 28 | const VectorOfVectorOf2DPoints& gridCorners, 29 | const cv::Size imageSize, 30 | cv::Mat& cameraMatrix, 31 | cv::Mat& distCoeffs 32 | ) const; 33 | 34 | protected: 35 | 36 | 37 | static void calcChessboardCorners 38 | ( 39 | cv::Size boardSize, 40 | float squareSize, 41 | VectorOf3DPoints& corners, 42 | PatternType patternType 43 | ); 44 | 45 | static bool runCalibration 46 | ( 47 | VectorOfVectorOf2DPoints imagePoints, 48 | cv::Size imageSize, 49 | cv::Size boardSize, 50 | PatternType patternType, 51 | float squareSize, 52 | float aspectRatio, 53 | int flags, 54 | cv::Mat& cameraMatrix, 55 | cv::Mat& distCoeffs, 56 | VectorOfMat& rvecs, 57 | VectorOfMat& tvecs, 58 | std::vector& reprojErrs, 59 | double& totalAvgErr 60 | ); 61 | 62 | static double computeReprojectionErrors( 63 | const VectorOfVectorOf3DPoints& objectPoints, 64 | const VectorOfVectorOf2DPoints& imagePoints, 65 | const VectorOfMat& rvecs, 66 | const VectorOfMat& tvecs, 67 | const cv::Mat& cameraMatrix, 68 | const cv::Mat& distCoeffs, 69 | std::vector& perViewErrors 70 | ); 71 | 72 | 73 | private: 74 | cv::Size m_patternSize; 75 | PatternType m_pattern; 76 | }; 77 | -------------------------------------------------------------------------------- /OpenCV Tutorial/CameraCalibrationSample.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CameraCalibrationSample.cpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 1/29/15. 6 | // 7 | // 8 | 9 | #include "CameraCalibrationSample.h" 10 | #include 11 | 12 | CameraCalibrationSample::CameraCalibrationSample() 13 | : mAlg(cv::Size(4, 11), ACIRCLES_GRID) 14 | , frame(0) 15 | { 16 | } 17 | 18 | std::string CameraCalibrationSample::getDescription() const 19 | { 20 | return "CameraCalibrationSample"; 21 | } 22 | 23 | std::string CameraCalibrationSample::getName() const 24 | { 25 | return "Camera Calibration"; 26 | } 27 | 28 | bool CameraCalibrationSample::processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame) 29 | { 30 | frame++; 31 | 32 | if (frame % 50) 33 | return false; 34 | 35 | cv::cvtColor(inputFrame, gray, cv::COLOR_BGR2GRAY); 36 | 37 | CameraCalibrationAlgorithm::VectorOf2DPoints corners2d; 38 | if (mAlg.detectCorners(gray, corners2d)) 39 | { 40 | mCorners.push_back(corners2d); 41 | std::cout << "Detected" << std::endl; 42 | } 43 | 44 | if (mCorners.size() > 10) 45 | { 46 | cv::Mat K, D; 47 | mAlg.calibrateCamera(mCorners, inputFrame.size(), K, D); 48 | std::cout << K << std::endl; 49 | std::cout << D << std::endl; 50 | 51 | mAlg = CameraCalibrationAlgorithm(cv::Size(11, 4), ACIRCLES_GRID); 52 | mCorners.clear(); 53 | } 54 | 55 | return true; 56 | } 57 | -------------------------------------------------------------------------------- /OpenCV Tutorial/CameraCalibrationSample.h: -------------------------------------------------------------------------------- 1 | // 2 | // CameraCalibrationSample.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 1/29/15. 6 | // 7 | // 8 | 9 | #pragma once 10 | 11 | #include "SampleBase.h" 12 | #include "CameraCalibrationAlgorithm.h" 13 | 14 | class CameraCalibrationSample : public SampleBase 15 | { 16 | public: 17 | CameraCalibrationSample(); 18 | 19 | //! Gets a sample name 20 | virtual std::string getName() const; 21 | 22 | //! Returns a detailed sample description 23 | virtual std::string getDescription() const; 24 | 25 | //! Processes a frame and returns output image 26 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 27 | 28 | private: 29 | int frame; 30 | cv::Mat gray; 31 | CameraCalibrationAlgorithm mAlg; 32 | 33 | CameraCalibrationAlgorithm::VectorOfVectorOf2DPoints mCorners; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /OpenCV Tutorial/CartoonFilter.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CartoonFilter.cpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/19/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "CartoonFilter.h" 11 | 12 | CartoonFilter::CartoonFilter() 13 | : sp(15) 14 | , sr(40) 15 | { 16 | registerOption("Spatial window radius", "", &sp, 1, 50); 17 | registerOption("Color window radius", "", &sr, 1, 50); 18 | } 19 | 20 | std::string CartoonFilter::getName() const 21 | { 22 | return "Cartoon filter"; 23 | } 24 | 25 | std::string CartoonFilter::getDescription() const 26 | { 27 | return "This sample performs cartoon-like effect"; 28 | } 29 | 30 | bool CartoonFilter::processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame) 31 | { 32 | cv::cvtColor(inputFrame, bgr, cv::COLOR_BGRA2BGR); 33 | cv::pyrMeanShiftFiltering(bgr.clone(), bgr, sp, sr); 34 | 35 | getGray(bgr, gray); 36 | cv::Canny(gray, edges, 150, 150); 37 | 38 | cv::cvtColor(edges, edgesBgr, cv::COLOR_GRAY2BGR); 39 | 40 | bgr = bgr - edgesBgr; 41 | 42 | cv::cvtColor(bgr, outputFrame, cv::COLOR_BGR2BGRA); 43 | return true; 44 | } -------------------------------------------------------------------------------- /OpenCV Tutorial/CartoonFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // CartoonFilter.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/19/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_CartoonFilter_h 10 | #define OpenCV_Tutorial_CartoonFilter_h 11 | 12 | #include "SampleBase.h" 13 | 14 | class CartoonFilter : public SampleBase 15 | { 16 | public: 17 | CartoonFilter(); 18 | 19 | //! Gets a sample name 20 | virtual std::string getName() const; 21 | 22 | //! Returns a detailed sample description 23 | virtual std::string getDescription() const; 24 | 25 | //! Processes a frame and returns output image 26 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 27 | 28 | private: 29 | float sp; 30 | float sr; 31 | 32 | cv::Mat gray, edges; 33 | cv::Mat hsv; 34 | 35 | cv::Mat bgr, img0; 36 | cv::Mat edgesBgr; 37 | 38 | }; 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ContourDetectionSample.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ContourDetectionSample.cpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "ContourDetectionSample.h" 11 | 12 | //! Gets a sample name 13 | std::string ContourDetectionSample::getName() const 14 | { 15 | return "Contour detection"; 16 | } 17 | 18 | //! Returns a detailed sample description 19 | std::string ContourDetectionSample::getDescription() const 20 | { 21 | return "Image contour detection is fundamental to many image analysis applications, including image segmentation, object recognition and classification."; 22 | } 23 | 24 | std::string ContourDetectionSample::getSampleIcon() const 25 | { 26 | return "ContourDetectionSampleIcon.png"; 27 | } 28 | 29 | //! Processes a frame and returns output image 30 | bool ContourDetectionSample::processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame) 31 | { 32 | getGray(inputFrame, gray); 33 | 34 | cv::Mat edges; 35 | cv::Canny(gray, edges, 50, 150); 36 | 37 | std::vector< std::vector > c; 38 | 39 | cv::findContours(edges, c, cv::RETR_LIST, cv::CHAIN_APPROX_NONE); 40 | 41 | inputFrame.copyTo(outputFrame); 42 | cv::drawContours(outputFrame, c, -1, cv::Scalar(0,200,0)); 43 | 44 | return true; 45 | } -------------------------------------------------------------------------------- /OpenCV Tutorial/ContourDetectionSample.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContourDetectionSample.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_ContourDetectionSample_h 10 | #define OpenCV_Tutorial_ContourDetectionSample_h 11 | 12 | #include "SampleBase.h" 13 | 14 | class ContourDetectionSample : public SampleBase 15 | { 16 | //! Gets a sample name 17 | virtual std::string getName() const; 18 | 19 | virtual std::string getSampleIcon() const; 20 | 21 | //! Returns a detailed sample description 22 | virtual std::string getDescription() const; 23 | 24 | //! Processes a frame and returns output image 25 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 26 | 27 | private: 28 | cv::Mat gray, edges; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ContourDetectionSampleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/ContourDetectionSampleIcon.png -------------------------------------------------------------------------------- /OpenCV Tutorial/ContourDetectionSampleIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/ContourDetectionSampleIcon@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/DefaultSampleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/DefaultSampleIcon.png -------------------------------------------------------------------------------- /OpenCV Tutorial/DefaultSampleIcon~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/DefaultSampleIcon~ipad.png -------------------------------------------------------------------------------- /OpenCV Tutorial/DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleFacade.h" 11 | 12 | @interface DetailViewController : UIViewController 13 | { 14 | SampleFacade* currentSample; 15 | UIImagePickerController * imagePicker; 16 | } 17 | 18 | @property (weak, nonatomic) IBOutlet UIImageView *sampleIconView; 19 | @property (weak, nonatomic) IBOutlet UITextView *sampleDescriptionTextView; 20 | @property (weak, nonatomic) IBOutlet UIButton *runOnImageButton; 21 | @property (weak, nonatomic) IBOutlet UIButton *runOnVideoButton; 22 | 23 | - (void) setDetailItem:(SampleFacade*) sample; 24 | - (void) configureView; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenCV Tutorial/DoubleTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DoubleTableViewCell.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/30/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleOptions.h" 11 | #import "OptionCell.h" 12 | 13 | @interface DoubleTableViewCell : OptionCell 14 | 15 | @property (weak, nonatomic) IBOutlet UILabel *label; 16 | @property (weak, nonatomic) IBOutlet UILabel *currentValue; 17 | @property (weak, nonatomic) IBOutlet UISlider *sliderValue; 18 | 19 | @property DoubleOption * option; 20 | 21 | - (IBAction)sliderValueChanged:(id)sender; 22 | 23 | - (void) configureWithOption: (DoubleOption*) option; 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenCV Tutorial/DoubleTableViewCell.mm: -------------------------------------------------------------------------------- 1 | // 2 | // DoubleTableViewCell.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/30/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "DoubleTableViewCell.h" 10 | #import "NSString+StdString.h" 11 | 12 | @implementation DoubleTableViewCell 13 | 14 | @synthesize label; 15 | @synthesize currentValue; 16 | @synthesize sliderValue; 17 | @synthesize option; 18 | 19 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 20 | { 21 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 22 | if (self) { 23 | // Initialization code 24 | } 25 | return self; 26 | } 27 | 28 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 29 | { 30 | [super setSelected:selected animated:animated]; 31 | 32 | // Configure the view for the selected state 33 | } 34 | 35 | - (void) configureWithOption: (DoubleOption*) opt 36 | { 37 | self.option = opt; 38 | 39 | label.text = [NSString stringWithStdString: option->getName()]; 40 | 41 | sliderValue.maximumValue = self.option->getMaxValue(); 42 | sliderValue.minimumValue = self.option->getMinValue(); 43 | sliderValue.value = self.option->getValue(); 44 | 45 | [self sliderValueChanged:self]; 46 | } 47 | 48 | - (IBAction)sliderValueChanged:(id)sender 49 | { 50 | currentValue.text = [NSString stringWithFormat:@"%f", sliderValue.value]; 51 | 52 | bool changed = option->setValue(sliderValue.value); 53 | if (changed && self.delegate) 54 | { 55 | [self.delegate optionDidChanged:option]; 56 | } 57 | 58 | } 59 | @end 60 | -------------------------------------------------------------------------------- /OpenCV Tutorial/DrawingCanvas.h: -------------------------------------------------------------------------------- 1 | // 2 | // DrawingCanvas.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 9/4/12. 6 | // 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_DrawingCanvas_h 10 | #define OpenCV_Tutorial_DrawingCanvas_h 11 | 12 | #include "SampleBase.h" 13 | 14 | class DrawingCanvasSample : public SampleBase 15 | { 16 | public: 17 | DrawingCanvasSample(); 18 | 19 | //! Gets a sample name 20 | virtual std::string getName() const; 21 | 22 | //! Returns a detailed sample description 23 | virtual std::string getDescription() const; 24 | 25 | //! Processes a frame and returns output image 26 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 27 | 28 | private: 29 | std::string m_currentView; 30 | 31 | cv::Mat m_grayImage; 32 | cv::Mat m_filtered; 33 | 34 | cv::Mat bgColor, fgColor; 35 | cv::Mat bgMask3channels; 36 | cv::Mat fgMask3channels; 37 | cv::Mat bgMask; 38 | 39 | float m_bilateralSigmaThreshold; 40 | float m_bilateralColorThreshold; 41 | float m_bilateralD; 42 | 43 | int m_thresholdBlockSize; 44 | float m_thresholdC; 45 | }; 46 | 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /OpenCV Tutorial/EdgeDetectionSample.h: -------------------------------------------------------------------------------- 1 | // 2 | // EdgeDetectionSample.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/24/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_EdgeDetectionSample_h 10 | #define OpenCV_Tutorial_EdgeDetectionSample_h 11 | 12 | 13 | #include "SampleBase.h" 14 | 15 | class EdgeDetectionSample : public SampleBase 16 | { 17 | public: 18 | EdgeDetectionSample(); 19 | 20 | //! Gets a sample name 21 | virtual std::string getName() const; 22 | 23 | //virtual std::string getSampleIcon() const; 24 | 25 | //! Returns a detailed sample description 26 | virtual std::string getDescription() const; 27 | 28 | //! Processes a frame and returns output image 29 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 30 | 31 | private: 32 | cv::Mat grayImage; 33 | cv::Mat edges; 34 | 35 | cv::Mat grad_x, grad_y; 36 | cv::Mat abs_grad_x, abs_grad_y; 37 | 38 | cv::Mat dst; 39 | cv::Mat dst_norm, dst_norm_scaled; 40 | 41 | bool m_showOnlyEdges; 42 | std::string m_algorithmName; 43 | 44 | // Canny detector options: 45 | int m_cannyLoThreshold; 46 | int m_cannyHiThreshold; 47 | int m_cannyAperture; 48 | 49 | // Harris detector options: 50 | int m_harrisBlockSize; 51 | int m_harrisapertureSize; 52 | double m_harrisK; 53 | int m_harrisThreshold; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /OpenCV Tutorial/EdgeDetectionSampleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/EdgeDetectionSampleIcon.png -------------------------------------------------------------------------------- /OpenCV Tutorial/EdgeDetectionSampleIcon~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/EdgeDetectionSampleIcon~ipad.png -------------------------------------------------------------------------------- /OpenCV Tutorial/EnumTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // EnumTableViewCell.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleOptions.h" 11 | #import "OptionCell.h" 12 | 13 | @interface EnumTableViewCell : OptionCell 14 | 15 | @property StringEnumOption * option; 16 | 17 | - (void) configureWithOption: (StringEnumOption*) option; 18 | 19 | @property (weak, nonatomic) IBOutlet UILabel *label; 20 | @property (weak, nonatomic) IBOutlet UISegmentedControl *segmentedControl; 21 | 22 | - (IBAction)segmentedControlChanged:(id)sender; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /OpenCV Tutorial/EnumTableViewCell.mm: -------------------------------------------------------------------------------- 1 | // 2 | // EnumTableViewCell.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "EnumTableViewCell.h" 10 | #import "NSString+StdString.h" 11 | 12 | @implementation EnumTableViewCell 13 | @synthesize label; 14 | @synthesize segmentedControl; 15 | @synthesize option; 16 | 17 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 18 | { 19 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 20 | if (self) { 21 | // Initialization code 22 | } 23 | return self; 24 | } 25 | 26 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 27 | { 28 | [super setSelected:selected animated:animated]; 29 | 30 | // Configure the view for the selected state 31 | } 32 | 33 | 34 | 35 | - (void) configureWithOption: (StringEnumOption*) opt 36 | { 37 | self.option = opt; 38 | self.label.text = [NSString stringWithStdString:self.option->getName()]; 39 | 40 | [self.segmentedControl removeAllSegments]; 41 | 42 | size_t numberOfItems = self.option->getEnums().size(); 43 | 44 | for (size_t i=0; i < numberOfItems; i++) 45 | { 46 | NSString * title = [NSString stringWithStdString:self.option->getEnums()[i]]; 47 | [self.segmentedControl insertSegmentWithTitle:title atIndex:i animated:NO]; 48 | } 49 | 50 | [self.segmentedControl setSelectedSegmentIndex:self.option->getValueIndex()]; 51 | } 52 | 53 | - (IBAction)segmentedControlChanged:(id)sender 54 | { 55 | bool changed = self.option->setValue(self.segmentedControl.selectedSegmentIndex); 56 | 57 | if (changed && self.delegate) 58 | { 59 | [self.delegate optionDidChanged:option]; 60 | } 61 | 62 | } 63 | @end 64 | -------------------------------------------------------------------------------- /OpenCV Tutorial/FPSCalculator.h: -------------------------------------------------------------------------------- 1 | // 2 | // FPSCalculator.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/4/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FPSCalculator : NSObject 12 | 13 | - (void) putTimeMark; 14 | 15 | - (float) getFPS; 16 | 17 | - (NSString*) getFPSAsText; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /OpenCV Tutorial/FPSCalculator.mm: -------------------------------------------------------------------------------- 1 | // 2 | // FPSCalculator.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/4/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "FPSCalculator.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | @interface FPSCalculator() 16 | { 17 | bool initialized; 18 | uint64_t past; 19 | 20 | uint64_t elapsedNano; 21 | int elapsedMarks; 22 | 23 | float currentFps; 24 | 25 | mach_timebase_info_data_t sTimebaseInfo; 26 | } 27 | @end 28 | 29 | @implementation FPSCalculator 30 | 31 | - (id) init 32 | { 33 | if (self = [super init]) 34 | { 35 | mach_timebase_info(&sTimebaseInfo); 36 | } 37 | 38 | return self; 39 | } 40 | 41 | - (void) putTimeMark 42 | { 43 | uint64_t now = mach_absolute_time(); 44 | elapsedMarks++; 45 | 46 | if (initialized) 47 | { 48 | uint64_t elapsed = now - past; 49 | 50 | elapsedNano += elapsed * sTimebaseInfo.numer / sTimebaseInfo.denom; 51 | } 52 | 53 | initialized = true; 54 | past = now; 55 | } 56 | 57 | - (float) getFPS 58 | { 59 | if (elapsedNano > 1000000000) 60 | { 61 | currentFps = (float)elapsedMarks / (1.0e-9 * elapsedNano); 62 | elapsedMarks = 0; 63 | elapsedNano = 0; 64 | } 65 | 66 | return currentFps; 67 | } 68 | 69 | - (NSString*) getFPSAsText 70 | { 71 | int fps = static_cast([self getFPS] + 0.5f); 72 | 73 | return [NSString stringWithFormat:@"%d FPS", fps]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /OpenCV Tutorial/FeatureDetectionSample.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // FeatureDetection.cpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by Anton Belodedenko on 25/07/2012. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "FeatureDetectionSample.h" 11 | 12 | #define kDetectorORB "ORB" 13 | #define kDetectorAKAZE "AKAZE" 14 | #define kDetectorFAST "FAST" 15 | 16 | FeatureDetectionSample::FeatureDetectionSample() 17 | : m_maxFeatures(100) 18 | , m_fastThreshold(10) 19 | { 20 | // feature extraction options 21 | m_alorithms.push_back( kDetectorORB ); 22 | m_alorithms.push_back( kDetectorFAST ); 23 | m_alorithms.push_back( kDetectorAKAZE ); 24 | 25 | m_ORB = cv::ORB::create(); 26 | m_FAST = cv::FastFeatureDetector::create(); 27 | m_AKAZE = cv::AKAZE::create(); 28 | 29 | registerOption("Detection algorithm", "", &m_detectorName, m_alorithms); 30 | registerOption("Max features", "", &m_maxFeatures, 1, 100); 31 | 32 | 33 | registerOption("Threshold", "FAST", &m_fastThreshold, 1, 100); 34 | } 35 | 36 | //! Gets a sample name 37 | std::string FeatureDetectionSample::getName() const 38 | { 39 | return "Feature detection"; 40 | } 41 | 42 | std::string FeatureDetectionSample::getSampleIcon() const 43 | { 44 | return "FeatureDetectionSampleIcon.png"; 45 | } 46 | 47 | //! Returns a detailed sample description 48 | std::string FeatureDetectionSample::getDescription() const 49 | { 50 | return "Feature detection sample."; 51 | } 52 | 53 | static bool keypoint_score_greater(const cv::KeyPoint& kp1, const cv::KeyPoint& kp2) 54 | { 55 | return kp1.response > kp2.response; 56 | } 57 | 58 | //! Processes a frame and returns output image 59 | bool FeatureDetectionSample::processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame) 60 | { 61 | // convert input frame to gray scale 62 | getGray(inputFrame, grayImage); 63 | 64 | 65 | if (m_detectorName == kDetectorORB) 66 | { 67 | m_ORB->detect(grayImage, objectKeypoints); 68 | } 69 | else if (m_detectorName == kDetectorFAST) 70 | { 71 | m_FAST->detect(grayImage, objectKeypoints); 72 | } 73 | else if (m_detectorName == kDetectorAKAZE) 74 | { 75 | m_AKAZE->detect(grayImage, objectKeypoints); 76 | } 77 | 78 | cv::KeyPointsFilter::retainBest(objectKeypoints, m_maxFeatures); 79 | 80 | if (objectKeypoints.size() > m_maxFeatures) 81 | { 82 | std::sort(objectKeypoints.begin(), objectKeypoints.end(), keypoint_score_greater); 83 | objectKeypoints.resize(m_maxFeatures); 84 | } 85 | 86 | cv::Mat t; 87 | cv::cvtColor(inputFrame, t, cv::COLOR_BGRA2BGR); 88 | cv::drawKeypoints(t, objectKeypoints, t, cv::Scalar::all(-1), cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS); 89 | 90 | cv::cvtColor(t, outputFrame, cv::COLOR_BGR2BGRA); 91 | return true; 92 | } -------------------------------------------------------------------------------- /OpenCV Tutorial/FeatureDetectionSample.h: -------------------------------------------------------------------------------- 1 | // 2 | // FeatureDetection.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by Anton Belodedenko on 25/07/2012. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_FeatureDetection_h 10 | #define OpenCV_Tutorial_FeatureDetection_h 11 | 12 | #include "SampleBase.h" 13 | 14 | class FeatureDetectionSample : public SampleBase 15 | { 16 | public: 17 | FeatureDetectionSample(); 18 | 19 | //! Gets a sample name 20 | virtual std::string getName() const; 21 | 22 | virtual std::string getSampleIcon() const; 23 | 24 | //! Returns a detailed sample description 25 | virtual std::string getDescription() const; 26 | 27 | //! Processes a frame and returns output image 28 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 29 | 30 | private: 31 | cv::Mat grayImage; 32 | 33 | std::vector objectKeypoints; 34 | 35 | std::string m_detectorName; 36 | std::vector m_alorithms; 37 | 38 | cv::Ptr m_ORB; 39 | cv::Ptr m_AKAZE; 40 | cv::Ptr m_FAST; 41 | 42 | int m_maxFeatures; 43 | int m_fastThreshold; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /OpenCV Tutorial/FeatureDetectionSampleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/FeatureDetectionSampleIcon.png -------------------------------------------------------------------------------- /OpenCV Tutorial/FloatTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // FloatTableViewCell.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleOptions.h" 11 | #import "OptionCell.h" 12 | 13 | @interface FloatTableViewCell : OptionCell 14 | 15 | @property (weak, nonatomic) IBOutlet UILabel *label; 16 | @property (weak, nonatomic) IBOutlet UILabel *currentValue; 17 | @property (weak, nonatomic) IBOutlet UISlider *sliderValue; 18 | 19 | @property FloatOption * option; 20 | 21 | - (IBAction)sliderValueChanged:(id)sender; 22 | 23 | - (void) configureWithOption: (FloatOption*) option; 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenCV Tutorial/FloatTableViewCell.mm: -------------------------------------------------------------------------------- 1 | // 2 | // FloatTableViewCell.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "FloatTableViewCell.h" 10 | #import "NSString+StdString.h" 11 | 12 | @implementation FloatTableViewCell 13 | @synthesize label; 14 | @synthesize currentValue; 15 | @synthesize sliderValue; 16 | @synthesize option; 17 | 18 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 19 | { 20 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 21 | if (self) { 22 | // Initialization code 23 | } 24 | return self; 25 | } 26 | 27 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 28 | { 29 | [super setSelected:selected animated:animated]; 30 | 31 | // Configure the view for the selected state 32 | } 33 | 34 | - (void) configureWithOption: (FloatOption*) opt 35 | { 36 | self.option = opt; 37 | 38 | label.text = [NSString stringWithStdString: option->getName()]; 39 | 40 | sliderValue.maximumValue = self.option->getMaxValue(); 41 | sliderValue.minimumValue = self.option->getMinValue(); 42 | sliderValue.value = self.option->getValue(); 43 | 44 | [self sliderValueChanged:self]; 45 | } 46 | 47 | - (IBAction)sliderValueChanged:(id)sender 48 | { 49 | currentValue.text = [NSString stringWithFormat:@"%f", sliderValue.value]; 50 | 51 | bool changed = option->setValue(sliderValue.value); 52 | if (changed && self.delegate) 53 | { 54 | [self.delegate optionDidChanged:option]; 55 | } 56 | 57 | } 58 | @end 59 | -------------------------------------------------------------------------------- /OpenCV Tutorial/Globals.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Globals.cpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by Anton Belodedenko on 26/07/2012. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | // control flags 12 | bool computeObject = false; 13 | bool detectObject = false; 14 | bool trackObject = false; 15 | -------------------------------------------------------------------------------- /OpenCV Tutorial/Globals.h: -------------------------------------------------------------------------------- 1 | // 2 | // Globals.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by Anton Belodedenko on 26/07/2012. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_Globals_h 10 | #define OpenCV_Tutorial_Globals_h 11 | 12 | // control flags 13 | extern bool computeObject; 14 | extern bool detectObject; 15 | extern bool trackObject; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ImageFiltersSample.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFiltersSample.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/8/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_ImageFiltersSample_h 10 | #define OpenCV_Tutorial_ImageFiltersSample_h 11 | 12 | #include "SampleBase.h" 13 | 14 | class ImageFiltersSample : public SampleBase 15 | { 16 | public: 17 | ImageFiltersSample(); 18 | 19 | //! Gets a sample name 20 | virtual std::string getName() const; 21 | 22 | virtual std::string getUserFriendlyName() const; 23 | 24 | //! Returns a detailed sample description 25 | virtual std::string getDescription() const; 26 | 27 | //! Processes a frame and returns output image 28 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 29 | 30 | private: 31 | void sepia(const cv::Mat& inputFrame, cv::Mat& outputFrame); 32 | 33 | void negative(const cv::Mat& inputFrame, cv::Mat& outputFrame); 34 | 35 | void contrastAndBrightnessAdjust(const cv::Mat& inputFrame, cv::Mat& outputFrame); 36 | 37 | private: 38 | std::string m_currentEffect; 39 | 40 | cv::Mat_ m_sepiaKernel; 41 | cv::Mat_ m_sepiaKernelT; 42 | 43 | float m_alpha; 44 | int m_bias; 45 | 46 | cv::Mat_ m_contrastKernel; 47 | cv::Mat_ m_contrastKernelT; 48 | 49 | bool useNeonOptimized; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ImageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageViewController.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/4/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleBase.h" 11 | #import "OptionsTableView.h" 12 | #import "OptionCell.h" 13 | #import "BaseSampleViewController.h" 14 | 15 | 16 | @interface ImageViewController : BaseSampleViewController 17 | 18 | - (void) setImage:(UIImage*) image; 19 | 20 | @property (nonatomic, strong) UIImageView *imageView; 21 | @property (nonatomic, strong) OptionsTableView *optionsView; 22 | @property (nonatomic, strong) UIPopoverController * optionsPopover; 23 | @property (nonatomic, strong) UIViewController * optionsViewController; 24 | @property (nonatomic, strong) UIAlertController * actionSheet; 25 | 26 | @property (weak, nonatomic) IBOutlet UIView *containerView; 27 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *takePhotoButton; 28 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *optionsBarButton; 29 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *actionButton; 30 | 31 | - (IBAction) presentOptionsView:(id)sender; 32 | - (IBAction) selectPictureForProcessing:(id) sender; 33 | - (IBAction) selectAction:(id)sender; 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /OpenCV Tutorial/Int32TableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // Int32TableViewCell.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleOptions.h" 11 | #import "OptionCell.h" 12 | 13 | @interface Int32TableViewCell : OptionCell 14 | 15 | @property (weak, nonatomic) IBOutlet UILabel *label; 16 | @property (weak, nonatomic) IBOutlet UILabel *currentValue; 17 | @property (weak, nonatomic) IBOutlet UISlider *sliderValue; 18 | 19 | @property Int32Option * option; 20 | 21 | - (IBAction)sliderValueChanged:(id)sender; 22 | 23 | - (void) configureWithOption: (Int32Option*) option; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /OpenCV Tutorial/Int32TableViewCell.mm: -------------------------------------------------------------------------------- 1 | // 2 | // Int32TableViewCell.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "Int32TableViewCell.h" 10 | #import "NSString+StdString.h" 11 | 12 | @implementation Int32TableViewCell 13 | @synthesize option; 14 | @synthesize label; 15 | @synthesize sliderValue; 16 | @synthesize currentValue; 17 | 18 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 19 | { 20 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 21 | if (self) { 22 | // Initialization code 23 | } 24 | return self; 25 | } 26 | 27 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 28 | { 29 | [super setSelected:selected animated:animated]; 30 | 31 | // Configure the view for the selected state 32 | } 33 | 34 | - (void) configureWithOption: (Int32Option*) opt 35 | { 36 | self.option = opt; 37 | 38 | label.text = [NSString stringWithStdString: option->getName()]; 39 | 40 | sliderValue.maximumValue = self.option->getMaxValue(); 41 | sliderValue.minimumValue = self.option->getMinValue(); 42 | sliderValue.value = self.option->getValue(); 43 | 44 | [self sliderValueChanged:self]; 45 | } 46 | 47 | - (IBAction)sliderValueChanged:(id)sender 48 | { 49 | currentValue.text = [NSString stringWithFormat:@"%d", (int)sliderValue.value]; 50 | 51 | bool changed = option->setValue( (int)sliderValue.value); 52 | if (changed && self.delegate) 53 | { 54 | [self.delegate optionDidChanged:option]; 55 | } 56 | } 57 | 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /OpenCV Tutorial/Mandrill512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/Mandrill512x512.png -------------------------------------------------------------------------------- /OpenCV Tutorial/MasterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DetailViewController; 12 | 13 | @interface MasterViewController : UITableViewController 14 | 15 | @property (strong, nonatomic) DetailViewController *detailViewController; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenCV Tutorial/NSString+StdString.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+StdString.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (StdString) 12 | 13 | + (NSString*) stringWithStdString: (const std::string&) str; 14 | 15 | //- (std::string) toStdString; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /OpenCV Tutorial/NSString+StdString.mm: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+StdString.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "NSString+StdString.h" 10 | 11 | @implementation NSString (StdString) 12 | 13 | + (NSString*) stringWithStdString: (const std::string&) str 14 | { 15 | return [[NSString alloc] initWithCString:str.c_str() encoding:NSASCIIStringEncoding]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ObjectTrackingClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectTrackingClass.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by Anton Belodedenko on 26/07/2012. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_ObjectTrackingClass_h 10 | #define OpenCV_Tutorial_ObjectTrackingClass_h 11 | 12 | class ObjectTrackingClass 13 | { 14 | private: 15 | int maxCorners; 16 | double qualityLevel; 17 | double minDistance; 18 | int blockSize; 19 | bool useHarrisDetector; 20 | double k; 21 | cv::Size subPixWinSize, winSize; 22 | cv::TermCriteria termcrit; 23 | int maxLevel; 24 | int flags; 25 | double minEigThreshold; 26 | 27 | public: 28 | ObjectTrackingClass() 29 | : maxCorners(200) 30 | , qualityLevel(0.01) 31 | , minDistance(10) 32 | , blockSize(3) 33 | , useHarrisDetector(false) 34 | , subPixWinSize(10,10) 35 | , winSize(31,31) 36 | , termcrit(cv::TermCriteria::MAX_ITER | cv::TermCriteria::EPS,20,0.03) 37 | , maxLevel(3) 38 | , flags(0) 39 | , minEigThreshold(0.001) 40 | 41 | { 42 | // nothing to do for now 43 | } 44 | 45 | // set maxcorners 46 | void setMaxCorners(int maxCorners); 47 | 48 | // initialise tracker 49 | void init(cv::Mat& image, // output image 50 | cv::Mat& image1, // source image 51 | std::vector& points1); // points array 52 | 53 | // track optical flow 54 | void track(cv::Mat& image, // output image 55 | cv::Mat& image1, // input image 1 56 | cv::Mat& image2, // input image 2 57 | std::vector& points1, // points array 1 58 | std::vector& points2, // points array 2 59 | std::vector& status, // status array 60 | std::vector& err); // error array 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ObjectTrackingSample.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectTrackingSample.cpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by Anton Belodedenko on 26/07/2012. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #include 10 | #include "ObjectTrackingClass.h" 11 | #include "ObjectTrackingSample.h" 12 | #include "Globals.h" 13 | 14 | ObjectTrackingSample::ObjectTrackingSample() 15 | : m_algorithmName("LKT") 16 | , m_maxCorners(200) 17 | { 18 | std::vector algos; 19 | algos.push_back("LKT"); 20 | registerOption("Algorithm", "", &m_algorithmName, algos); 21 | 22 | // object tracking options 23 | registerOption("m_maxCorners", "Tracking", &m_maxCorners, 0, 1000); 24 | } 25 | 26 | //! Gets a sample name 27 | std::string ObjectTrackingSample::getName() const 28 | { 29 | return "Object tracking"; 30 | } 31 | 32 | std::string ObjectTrackingSample::getSampleIcon() const 33 | { 34 | return "ObjectTrackingSampleIcon.png"; 35 | } 36 | 37 | //! Returns a detailed sample description 38 | std::string ObjectTrackingSample::getDescription() const 39 | { 40 | return "Object tracking sample."; 41 | } 42 | 43 | //! Returns true if this sample requires setting a reference image for latter use 44 | bool ObjectTrackingSample::isReferenceFrameRequired() const 45 | { 46 | return true; 47 | } 48 | 49 | //! Sets the reference frame for latter processing 50 | void ObjectTrackingSample::setReferenceFrame(const cv::Mat& reference) 51 | { 52 | getGray(reference, imagePrev); 53 | computeObject = true; 54 | } 55 | 56 | // Reset object keypoints and descriptors 57 | void ObjectTrackingSample::resetReferenceFrame() const 58 | { 59 | trackObject = false; 60 | computeObject = false; 61 | } 62 | 63 | //! Processes a frame and returns output image 64 | bool ObjectTrackingSample::processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame) 65 | { 66 | // display the frame 67 | inputFrame.copyTo(outputFrame); 68 | 69 | // convert input frame to gray scale 70 | getGray(inputFrame, imageNext); 71 | 72 | // prepare the tracking class 73 | ObjectTrackingClass ot; 74 | ot.setMaxCorners(m_maxCorners); 75 | 76 | // begin tracking object 77 | if ( trackObject ) { 78 | ot.track(outputFrame, 79 | imagePrev, 80 | imageNext, 81 | pointsPrev, 82 | pointsNext, 83 | status, 84 | err); 85 | 86 | // check if the next points array isn't empty 87 | if ( pointsNext.empty() ) 88 | trackObject = false; 89 | } 90 | 91 | // store the reference frame as the object to track 92 | if ( computeObject ) { 93 | ot.init(outputFrame, imagePrev, pointsNext); 94 | trackObject = true; 95 | computeObject = false; 96 | } 97 | 98 | // backup previous frame 99 | imageNext.copyTo(imagePrev); 100 | 101 | // backup points array 102 | std::swap(pointsNext, pointsPrev); 103 | 104 | return true; 105 | } 106 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ObjectTrackingSample.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectTrackingSample.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by Anton Belodedenko on 26/07/2012. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_ObjectTrackingSample_h 10 | #define OpenCV_Tutorial_ObjectTrackingSample_h 11 | 12 | #include "SampleBase.h" 13 | 14 | class ObjectTrackingSample : public SampleBase 15 | { 16 | public: 17 | ObjectTrackingSample(); 18 | 19 | //! Gets a sample name 20 | virtual std::string getName() const; 21 | 22 | virtual std::string getSampleIcon() const; 23 | 24 | //! Returns a detailed sample description 25 | virtual std::string getDescription() const; 26 | 27 | //! Returns true if this sample requires setting a reference image for latter use 28 | virtual bool isReferenceFrameRequired() const; 29 | 30 | //! Sets the reference frame for latter processing 31 | virtual void setReferenceFrame(const cv::Mat& reference); 32 | 33 | // clears reference frame parameters 34 | virtual void resetReferenceFrame() const; 35 | 36 | //! Processes a frame and returns output image 37 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 38 | 39 | private: 40 | cv::Mat imageNext, imagePrev; 41 | 42 | std::vector status; 43 | 44 | std::vector err; 45 | 46 | std::string m_algorithmName; 47 | 48 | std::vector pointsPrev, pointsNext; 49 | 50 | // optical flow options 51 | int m_maxCorners; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ObjectTrackingSampleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/ObjectTrackingSampleIcon.png -------------------------------------------------------------------------------- /OpenCV Tutorial/OpenCV Tutorial-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Machine Eye 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIcons 12 | 13 | CFBundlePrimaryIcon 14 | 15 | CFBundleIconFiles 16 | 17 | Icon.png 18 | Icon@2x.png 19 | Icon-72.png 20 | Icon-72@2x.png 21 | Default.png 22 | Default@2x.png 23 | Default-Portrait~ipad.png 24 | Default-Portrait@2x~ipad.png 25 | Default-Landscape@2x~ipad.png 26 | Default-Landscape~ipad.png 27 | 28 | UIPrerenderedIcon 29 | 30 | 31 | 32 | CFBundleIdentifier 33 | $(PRODUCT_BUNDLE_IDENTIFIER) 34 | CFBundleInfoDictionaryVersion 35 | 6.0 36 | CFBundleName 37 | ${PRODUCT_NAME} 38 | CFBundlePackageType 39 | APPL 40 | CFBundleShortVersionString 41 | 1.0 42 | CFBundleSignature 43 | ???? 44 | CFBundleVersion 45 | 1.0 46 | LSRequiresIPhoneOS 47 | 48 | UIMainStoryboardFile 49 | MainStoryboard_iPhone 50 | UIMainStoryboardFile~ipad 51 | MainStoryboard_iPad 52 | UIPrerenderedIcon 53 | 54 | UIRequiredDeviceCapabilities 55 | 56 | armv7 57 | 58 | UISupportedInterfaceOrientations 59 | 60 | UIInterfaceOrientationPortrait 61 | UIInterfaceOrientationLandscapeLeft 62 | UIInterfaceOrientationLandscapeRight 63 | 64 | UISupportedInterfaceOrientations~ipad 65 | 66 | UIInterfaceOrientationPortrait 67 | UIInterfaceOrientationPortraitUpsideDown 68 | UIInterfaceOrientationLandscapeLeft 69 | UIInterfaceOrientationLandscapeRight 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /OpenCV Tutorial/OpenCV Tutorial-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OpenCV Tutorial' target in the 'OpenCV Tutorial' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __cplusplus 12 | #include 13 | #endif 14 | 15 | #ifdef __OBJC__ 16 | #import 17 | #import 18 | #import 19 | #endif 20 | 21 | #include "TargetConditionals.h" 22 | 23 | -------------------------------------------------------------------------------- /OpenCV Tutorial/OptionCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // OptionCell.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/11/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleOptions.h" 11 | 12 | @protocol OptionCellDelegate 13 | 14 | - (void) optionDidChanged:(SampleOption*) option; 15 | 16 | @end 17 | 18 | 19 | @interface OptionCell : UITableViewCell 20 | 21 | @property (readonly) float cellHeight; 22 | @property id delegate; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /OpenCV Tutorial/OptionCell.mm: -------------------------------------------------------------------------------- 1 | // 2 | // OptionCell.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/11/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "OptionCell.h" 10 | 11 | @implementation OptionCell 12 | @synthesize delegate; 13 | @synthesize cellHeight = _cellHeight; 14 | 15 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 16 | { 17 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 18 | if (self) { 19 | // Initialization code 20 | } 21 | return self; 22 | } 23 | 24 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 25 | { 26 | [super setSelected:selected animated:animated]; 27 | 28 | // Configure the view for the selected state 29 | } 30 | 31 | - (void) awakeFromNib 32 | { 33 | [super awakeFromNib]; 34 | _cellHeight = self.bounds.size.height; 35 | } 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /OpenCV Tutorial/OptionsTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OptionsTableView.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/11/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleFacade.h" 11 | #import "OptionCell.h" 12 | 13 | @interface OptionsTableView : UITableView 14 | 15 | - (id) initWithFrame:(CGRect)frame 16 | style:(UITableViewStyle)style 17 | sample:(SampleFacade*) sample 18 | notificationsDelegate:(id) delegate; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /OpenCV Tutorial/OptionsTableView.mm: -------------------------------------------------------------------------------- 1 | // 2 | // OptionsTableView.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/11/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import "OptionsTableView.h" 10 | #import "SampleOptionsTableViewDelegate.h" 11 | 12 | @interface OptionsTableView () 13 | @property (nonatomic, strong) SampleOptionsTableViewDelegate * optionsFacade; 14 | @end 15 | 16 | @implementation OptionsTableView 17 | @synthesize optionsFacade; 18 | 19 | - (id) initWithFrame:(CGRect)frame 20 | style:(UITableViewStyle)style 21 | sample:(SampleFacade*) sample 22 | notificationsDelegate:(id) delegate 23 | { 24 | if (self = [super initWithFrame:frame style:style]) 25 | { 26 | [self registerNib:[UINib nibWithNibName:@"BooleanTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"BooleanTableViewCell"]; 27 | [self registerNib:[UINib nibWithNibName:@"Int32TableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"Int32TableViewCell"]; 28 | [self registerNib:[UINib nibWithNibName:@"FloatTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"FloatTableViewCell"]; 29 | [self registerNib:[UINib nibWithNibName:@"EnumTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"EnumTableViewCell"]; 30 | [self registerNib:[UINib nibWithNibName:@"DoubleTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"DoubleTableViewCell"]; 31 | 32 | [self setAutoresizingMask: (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight) ]; 33 | self.optionsFacade = [[SampleOptionsTableViewDelegate alloc] initWithSample:sample notificationsDelegate:delegate]; 34 | self.delegate = self.optionsFacade; 35 | self.dataSource = self.optionsFacade; 36 | } 37 | 38 | return self; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ROFSample.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ROFSample.cpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by Emmanuel d'Angelo on 20.07.12. 6 | // Copyright (c) 2012 EPFL/STI/IEL/LTS2. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | #include "totalvariation.h" 12 | #include "ROFSample.h" 13 | 14 | //! Init and create options 15 | ROFSample::ROFSample() : m_iterations(10), m_lambdaExponent(0), m_lambda(1.0) 16 | { 17 | registerOption("Iterations", "", &m_iterations, 1, 100); 18 | registerOption("Data weight exponent", "", &m_lambdaExponent, -4, 4); 19 | registerOption("Process color", "", &m_processColor); 20 | } 21 | 22 | //! Gets a sample name 23 | std::string ROFSample::getName() const 24 | { 25 | return "Rudin-Osher-Fatemi (TV)"; 26 | } 27 | 28 | //! Returns a detailed sample description 29 | std::string ROFSample::getDescription() const 30 | { 31 | return "The Rudin-Osher-Fatemi functional aims at minimizing the Total Variation of an image. It is an anisotropic diffusion algorithm, where (unlike heat diffusion) grey levels hardly diffuse through image edges, hence preserving piecewise flat areas and avoiding undesired blur.\nThe ROF functional is solved here using the FISTA fast algorithm by Beck and Teboulle (2009)."; 32 | } 33 | 34 | std::string ROFSample::getSampleIcon() const 35 | { 36 | return "ROFSampleIcon.png"; 37 | } 38 | 39 | //! Processes a frame and returns output image 40 | bool ROFSample::processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame) 41 | { 42 | m_lambda = std::pow(10.0, m_lambdaExponent); 43 | 44 | std::vector inChannels; 45 | if (m_processColor) 46 | cv::split(inputFrame, inChannels); 47 | else { 48 | inChannels.resize(1); 49 | getGray(inputFrame, inChannels[0]); 50 | } 51 | 52 | std::vector outChannels(inChannels.size()); 53 | cv::Mat tmp32f_in, tmp32f_out; 54 | 55 | for (int i = 0; i < MIN(3, inChannels.size()); ++i) { 56 | if (inChannels[i].type() != CV_32F) 57 | inChannels[i].convertTo(tmp32f_in, CV_32F, 1.0/255.0); 58 | else 59 | tmp32f_in = inChannels[i]; 60 | 61 | tvdn_fista(tmp32f_in, m_lambda, m_iterations, tmp32f_out); 62 | tmp32f_out.convertTo(outChannels[i], CV_8U, 255.0); 63 | } 64 | 65 | if (m_processColor) { 66 | outChannels[3] = inChannels[3]; 67 | cv::merge(outChannels, outputFrame); 68 | } 69 | else cv::cvtColor(outChannels[0], outputFrame, cv::COLOR_GRAY2BGRA); 70 | 71 | return true; 72 | } -------------------------------------------------------------------------------- /OpenCV Tutorial/ROFSample.h: -------------------------------------------------------------------------------- 1 | // 2 | // ROFSample.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by Emmanuel d'Angelo on 20.07.12. 6 | // Copyright (c) 2012 EPFL/STI/IEL/LTS2. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_ROFSample_h 10 | #define OpenCV_Tutorial_ROFSample_h 11 | 12 | #include "SampleBase.h" 13 | 14 | class ROFSample : public SampleBase 15 | { 16 | public: 17 | ROFSample(); 18 | 19 | //! Gets a sample name 20 | virtual std::string getName() const; 21 | 22 | virtual std::string getSampleIcon() const; 23 | 24 | //! Returns a detailed sample description 25 | virtual std::string getDescription() const; 26 | 27 | //! Processes a frame and returns output image 28 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 29 | 30 | private: 31 | cv::Mat grayImage; 32 | 33 | // Diffusion options 34 | float m_lambda; 35 | int m_iterations; 36 | int m_lambdaExponent; 37 | bool m_processColor; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ROFSampleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/ROFSampleIcon.png -------------------------------------------------------------------------------- /OpenCV Tutorial/SampleBase.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // SampleBase.cpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #include "SampleBase.h" 10 | #include 11 | #include "cvneon.h" 12 | 13 | std::string SampleBase::getUserFriendlyName() const 14 | { 15 | return getName(); 16 | } 17 | 18 | std::string SampleBase::getSampleIcon() const 19 | { 20 | return ""; 21 | } 22 | 23 | const SampleBase::OptionsMap& SampleBase::getOptions() const 24 | { 25 | return m_optionsWithSections; 26 | } 27 | 28 | void SampleBase::registerOption(std::string name, std::string section, bool * value) 29 | { 30 | SampleOption * opt = new BooleanOption(name, section, value); 31 | m_optionsWithSections[section].push_back(opt); 32 | } 33 | 34 | void SampleBase::registerOption(std::string name, std::string section, int * value, int min, int max) 35 | { 36 | SampleOption * opt = new Int32Option(name, section, value, min, max); 37 | m_optionsWithSections[section].push_back(opt); 38 | 39 | *value = std::max(min, std::max(min, *value)); 40 | } 41 | 42 | void SampleBase::registerOption(std::string name, std::string section, float * value, float min, float max) 43 | { 44 | SampleOption * opt = new FloatOption(name, section, value, min, max); 45 | m_optionsWithSections[section].push_back(opt); 46 | 47 | *value = std::max(min, std::max(min, *value)); 48 | } 49 | 50 | void SampleBase::registerOption(std::string name, std::string section, double * value, double min, double max) 51 | { 52 | SampleOption * opt = new DoubleOption(name, section, value, min, max); 53 | m_optionsWithSections[section].push_back(opt); 54 | 55 | *value = std::max(min, std::max(min, *value)); 56 | } 57 | 58 | void SampleBase::registerOption(std::string name, std::string section, std::string* value, std::vector stringEnums, int defaultValue) 59 | { 60 | SampleOption * opt = new StringEnumOption(name, section, value, stringEnums, defaultValue); 61 | m_optionsWithSections[section].push_back(opt); 62 | 63 | *value = stringEnums[defaultValue]; // Assign default value just in case 64 | } 65 | 66 | 67 | bool SampleBase::hasIcon() const 68 | { 69 | return false == getSampleIcon().empty(); 70 | } 71 | 72 | 73 | 74 | void SampleBase::getGray(const cv::Mat& input, cv::Mat& gray) 75 | { 76 | const int numChannes = input.channels(); 77 | 78 | if (numChannes == 4) 79 | { 80 | #if TARGET_IPHONE_SIMULATOR 81 | cv::cvtColor(input, gray, cv::COLOR_BGRA2GRAY); 82 | #else 83 | cv::neon_cvtColorBGRA2GRAY(input, gray); 84 | #endif 85 | 86 | } 87 | else if (numChannes == 3) 88 | { 89 | cv::cvtColor(input, gray, cv::COLOR_BGR2GRAY); 90 | } 91 | else if (numChannes == 1) 92 | { 93 | gray = input; 94 | } 95 | } 96 | 97 | //! Returns true if this sample requires setting a reference image for latter use 98 | bool SampleBase::isReferenceFrameRequired() const 99 | { 100 | return false; 101 | } 102 | 103 | //! Sets the reference frame for latter processing 104 | void SampleBase::setReferenceFrame(const cv::Mat& reference) 105 | { 106 | // Does nothing. Override this method if you need to 107 | } 108 | 109 | // Resets the reference frame 110 | void SampleBase::resetReferenceFrame() const 111 | { 112 | // Does nothing. Override this method if you need to 113 | } 114 | -------------------------------------------------------------------------------- /OpenCV Tutorial/SampleBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // SampleBase.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_SampleBase_h 10 | #define OpenCV_Tutorial_SampleBase_h 11 | 12 | #include "SampleOptions.h" 13 | #include 14 | #include 15 | 16 | //! Base class for all samples 17 | class SampleBase 18 | { 19 | public: 20 | //! Gets a sample name 21 | virtual std::string getName() const = 0; 22 | 23 | //! Returns a user-friendly name for displaying as description 24 | virtual std::string getUserFriendlyName() const; 25 | 26 | //! Returns a detailed sample description 27 | virtual std::string getDescription() const = 0; 28 | 29 | //! Returns a icon for this sample. The default implementation returns empty string 30 | virtual std::string getSampleIcon() const; 31 | 32 | //! Returns true if this sample requires setting a reference image for latter use 33 | virtual bool isReferenceFrameRequired() const; 34 | 35 | //! Sets the reference frame for latter processing 36 | virtual void setReferenceFrame(const cv::Mat& reference); 37 | 38 | // Resets the reference frame 39 | virtual void resetReferenceFrame() const; 40 | 41 | //! Processes a frame and returns output image 42 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame) = 0; 43 | 44 | bool hasIcon() const; 45 | 46 | typedef std::vector OptionsSection; 47 | typedef std::map OptionsMap; 48 | 49 | const OptionsMap& getOptions() const; 50 | 51 | protected: 52 | void registerOption(std::string name, std::string section, bool * value); 53 | void registerOption(std::string name, std::string section, int * value, int min, int max); 54 | void registerOption(std::string name, std::string section, float * value, float min, float max); 55 | void registerOption(std::string name, std::string section, double * value, double min, double max); 56 | void registerOption(std::string name, std::string section, std::string* value, std::vector stringEnums, int defaultValue = 0); 57 | 58 | static void getGray(const cv::Mat& input, cv::Mat& gray); 59 | 60 | private: 61 | OptionsMap m_optionsWithSections; 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /OpenCV Tutorial/SampleFacade.h: -------------------------------------------------------------------------------- 1 | // 2 | // SampleFacade.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 8/14/12. 6 | // 7 | // 8 | 9 | #import 10 | #import "SampleBase.h" 11 | 12 | typedef std::vector OptionsSection; 13 | typedef std::map OptionsMap; 14 | 15 | @interface SampleFacade : NSObject 16 | 17 | - (id) initWithSample:(SampleBase*) sample; 18 | 19 | //@property (readonly) SampleBase * sample; 20 | 21 | - (NSString *) title; 22 | - (NSString *) description; 23 | - (NSString *) friendlyName; 24 | 25 | - (UIImage*) smallIcon; 26 | - (UIImage*) largeIcon; 27 | 28 | - (bool) processFrame:(const cv::Mat&) inputFrame into:(cv::Mat&) outputFrame; 29 | 30 | - (UIImage*) processFrame:(UIImage*) source; 31 | 32 | - (OptionsMap) getOptions; 33 | 34 | @property (getter = getIsReferenceFrameRequired, readonly) bool isReferenceFrameRequired; 35 | 36 | - (void) setReferenceFrame:(cv::Mat&) referenceFrame; 37 | - (void) resetReferenceFrame; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /OpenCV Tutorial/SampleFacade.mm: -------------------------------------------------------------------------------- 1 | // 2 | // SampleFacade.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 8/14/12. 6 | // 7 | // 8 | 9 | #import "SampleFacade.h" 10 | #import "NSString+StdString.h" 11 | #import "UIImage2OpenCV.h" 12 | 13 | @interface SampleFacade() 14 | { 15 | NSString * m_title; 16 | NSString * m_description; 17 | UIImage * m_smallIcon; 18 | UIImage * m_largeIcon; 19 | 20 | SampleBase * _sample; 21 | } 22 | 23 | @end 24 | 25 | 26 | @implementation SampleFacade 27 | //@synthesize sample = _sample; 28 | 29 | - (id) initWithSample:(SampleBase*) s 30 | { 31 | assert(s); 32 | 33 | if (self = [super init]) 34 | { 35 | _sample = s; 36 | } 37 | 38 | return self; 39 | } 40 | 41 | - (NSString *) title 42 | { 43 | if (!m_title) 44 | { 45 | m_title = [NSString stringWithCString:_sample->getName().c_str() encoding:NSASCIIStringEncoding]; 46 | } 47 | 48 | return m_title; 49 | } 50 | 51 | - (NSString *) description 52 | { 53 | if (!m_description) 54 | { 55 | m_description = [NSString stringWithCString:_sample->getDescription().c_str() encoding:NSASCIIStringEncoding]; 56 | } 57 | 58 | return m_description; 59 | } 60 | 61 | 62 | - (UIImage*) smallIcon 63 | { 64 | if (!m_smallIcon) 65 | { 66 | if (_sample->hasIcon()) 67 | { 68 | NSString * iconStr = [NSString stringWithStdString:_sample->getSampleIcon()]; 69 | m_smallIcon = [[UIImage imageNamed:iconStr] thumbnailWithSize:80]; 70 | } 71 | else 72 | { 73 | UIImage * srcImage = [UIImage imageNamed:@"DefaultSampleIcon.png"]; 74 | m_smallIcon = [self processFrame:[srcImage thumbnailWithSize:80]]; 75 | } 76 | } 77 | 78 | return m_smallIcon; 79 | } 80 | 81 | - (UIImage*) largeIcon 82 | { 83 | if (!m_largeIcon) 84 | { 85 | if (_sample->hasIcon()) 86 | { 87 | NSString * iconStr = [NSString stringWithStdString:_sample->getSampleIcon()]; 88 | m_largeIcon = [UIImage imageNamed:iconStr]; 89 | } 90 | else 91 | { 92 | UIImage * src = [UIImage imageNamed:@"DefaultSampleIcon.png"]; 93 | assert(src); 94 | 95 | m_largeIcon = [self processFrame:src]; 96 | } 97 | } 98 | 99 | return m_largeIcon; 100 | } 101 | 102 | - (bool) processFrame:(const cv::Mat&) inputFrame into:(cv::Mat&) outputFrame 103 | { 104 | return _sample->processFrame(inputFrame, outputFrame); 105 | } 106 | 107 | - (UIImage*) processFrame:(UIImage*) source 108 | { 109 | cv::Mat inputImage = [source toMat]; 110 | cv::Mat outputImage; 111 | 112 | _sample->processFrame(inputImage, outputImage); 113 | UIImage * result = [UIImage imageWithMat:outputImage andImageOrientation:[source imageOrientation]]; 114 | return result; 115 | } 116 | 117 | - (NSString *) friendlyName 118 | { 119 | return [NSString stringWithCString:_sample->getUserFriendlyName().c_str() encoding:NSASCIIStringEncoding]; 120 | } 121 | 122 | - (bool) getIsReferenceFrameRequired 123 | { 124 | return _sample->isReferenceFrameRequired(); 125 | } 126 | 127 | - (void) setReferenceFrame:(cv::Mat&) referenceFrame 128 | { 129 | _sample->setReferenceFrame(referenceFrame); 130 | 131 | } 132 | 133 | - (void) resetReferenceFrame 134 | { 135 | _sample->resetReferenceFrame(); 136 | } 137 | 138 | - (OptionsMap) getOptions 139 | { 140 | return _sample->getOptions(); 141 | } 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /OpenCV Tutorial/SampleOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // SampleOptions.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_SampleOptions_h 10 | #define OpenCV_Tutorial_SampleOptions_h 11 | 12 | #include 13 | 14 | typedef enum { OptionKindBoolean, OptionKindInt32, OptionKindFloat, OptionKindDouble, OptionKindStringEnum } OptionKind; 15 | 16 | class SampleOption 17 | { 18 | public: 19 | const std::string getName() const { return m_name; } 20 | 21 | virtual OptionKind getKind() = 0; 22 | 23 | protected: 24 | SampleOption(const std::string& name, const std::string& section); 25 | 26 | std::string m_name; 27 | std::string m_section; 28 | }; 29 | 30 | class Int32Option : public SampleOption 31 | { 32 | public: 33 | Int32Option(const std::string& name, const std::string& section, int* value, int min, int max); 34 | 35 | virtual OptionKind getKind() override; 36 | 37 | int getValue() const; 38 | bool setValue(int v); 39 | 40 | int getMaxValue() const; 41 | int getMinValue() const; 42 | 43 | private: 44 | int * m_value; 45 | int m_min; 46 | int m_max; 47 | int m_default; 48 | }; 49 | 50 | class FloatOption : public SampleOption 51 | { 52 | public: 53 | FloatOption(const std::string& name, const std::string& section, float* value, float min, float max); 54 | 55 | virtual OptionKind getKind() override; 56 | 57 | float getValue() const; 58 | bool setValue(float v); 59 | 60 | float getMaxValue() const; 61 | float getMinValue() const; 62 | 63 | private: 64 | float * m_value; 65 | float m_min; 66 | float m_max; 67 | float m_default; 68 | }; 69 | 70 | class DoubleOption : public SampleOption 71 | { 72 | public: 73 | DoubleOption(const std::string& name, const std::string& section, double* value, double min, double max); 74 | 75 | virtual OptionKind getKind() override; 76 | 77 | double getValue() const; 78 | bool setValue(double v); 79 | 80 | double getMaxValue() const; 81 | double getMinValue() const; 82 | 83 | private: 84 | double * m_value; 85 | double m_min; 86 | double m_max; 87 | double m_default; 88 | }; 89 | 90 | class BooleanOption : public SampleOption 91 | { 92 | public: 93 | BooleanOption(const std::string& name, const std::string& section, bool* value); 94 | 95 | virtual OptionKind getKind() override; 96 | 97 | bool getValue() const; 98 | bool setValue(bool value); 99 | 100 | private: 101 | bool * m_value; 102 | bool m_default; 103 | }; 104 | 105 | class StringEnumOption : public SampleOption 106 | { 107 | public: 108 | StringEnumOption(const std::string& name, 109 | const std::string& section, 110 | std::string* value, 111 | std::vector stringEnums, 112 | size_t defaultValue = 0); 113 | 114 | virtual OptionKind getKind() override; 115 | 116 | size_t getValueIndex() const; 117 | std::string getValue() const; 118 | bool setValue(size_t newIndex); 119 | 120 | const std::vector& getEnums() const { return m_stringEnums; } 121 | 122 | private: 123 | size_t m_index; 124 | 125 | std::string* m_value; 126 | std::vector m_stringEnums; 127 | size_t m_defaultValue; 128 | 129 | }; 130 | 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /OpenCV Tutorial/SampleOptionsTableViewDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SampleOptionsTableViewDelegate.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/9/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "SampleFacade.h" 12 | #import "OptionCell.h" 13 | 14 | @interface SampleOptionsTableViewDelegate : NSObject 15 | 16 | @property (readonly) SampleFacade * sample; 17 | @property (readonly) id delegate; 18 | 19 | - (id) initWithSample:(SampleFacade*) sample notificationsDelegate:(id) delegate; 20 | 21 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; 22 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; 23 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; 24 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section; 25 | 26 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath; 27 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath; 28 | 29 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; 30 | - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /OpenCV Tutorial/UIImage2OpenCV.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage_UIImage2OpenCV.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/25/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | 10 | // This interface extension allows convert UIImage to cv::Mat representation and 11 | // vice versa using full data copy in both directions. 12 | @interface UIImage (OpenCV) 13 | 14 | -(cv::Mat) toMat; 15 | 16 | +(UIImage*) imageWithMat:(const cv::Mat&) image andImageOrientation: (UIImageOrientation) orientation; 17 | +(UIImage*) imageWithMat:(const cv::Mat&) image andDeviceOrientation: (UIDeviceOrientation) orientation; 18 | 19 | - (UIImage *)thumbnailWithSize:(int)thumbSize; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /OpenCV Tutorial/VideoTracking.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // VideoTracking.hpp 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 7/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_VideoTracking_hpp 10 | #define OpenCV_Tutorial_VideoTracking_hpp 11 | 12 | #include "SampleBase.h" 13 | 14 | class VideoTrackingSample : public SampleBase 15 | { 16 | public: 17 | VideoTrackingSample(); 18 | 19 | //! Gets a sample name 20 | virtual std::string getName() const; 21 | 22 | //! Returns a user-friendly name for displaying as description 23 | virtual std::string getUserFriendlyName() const; 24 | 25 | //! Returns a detailed sample description 26 | virtual std::string getDescription() const; 27 | 28 | //! Processes a frame and returns output image 29 | virtual bool processFrame(const cv::Mat& inputFrame, cv::Mat& outputFrame); 30 | 31 | virtual std::string getSampleIcon() const; 32 | private: 33 | int m_maxNumberOfPoints; 34 | 35 | cv::Mat m_prevImg; 36 | cv::Mat m_nextImg; 37 | cv::Mat m_mask; 38 | 39 | std::vector m_prevPts; 40 | std::vector m_nextPts; 41 | 42 | std::vector m_prevKeypoints; 43 | std::vector m_nextKeypoints; 44 | 45 | cv::Mat m_prevDescriptors; 46 | cv::Mat m_nextDescriptors; 47 | 48 | std::vector m_status; 49 | std::vector m_error; 50 | 51 | cv::Ptr m_orbFeatureEngine; 52 | cv::BFMatcher m_orbMatcher; 53 | 54 | cv::Ptr m_fastDetector; 55 | cv::Ptr m_briefExtractor; 56 | cv::BFMatcher m_briefMatcher; 57 | 58 | std::string m_activeTrackingAlgorithm; 59 | }; 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /OpenCV Tutorial/VideoTrackingSampleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/VideoTrackingSampleIcon.png -------------------------------------------------------------------------------- /OpenCV Tutorial/VideoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // VideoViewController.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/26/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SampleBase.h" 11 | #import "BaseSampleViewController.h" 12 | 13 | @interface VideoViewController : BaseSampleViewController 14 | 15 | @property (weak, nonatomic) IBOutlet UIImageView *containerView; 16 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *toggleCameraButton; 17 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *options; 18 | 19 | @property (nonatomic, strong) UITableView * optionsView; 20 | @property (nonatomic, strong) UIPopoverController * optionsPopover; 21 | @property (nonatomic, strong) UIViewController * optionsViewController; 22 | 23 | @property (nonatomic, strong) UIAlertController * actionSheet; 24 | 25 | - (IBAction)toggleCameraPressed:(id)sender; 26 | - (IBAction)showOptions:(id)sender; 27 | - (IBAction)captureReferenceFrame:(id)sender; 28 | - (IBAction)clearReferenceFrame:(id)sender; 29 | 30 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *actionSheetButton; 31 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *captureReferenceFrameButton; 32 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *clearReferenceFrameButton; 33 | 34 | - (IBAction)showActionSheet:(id)sender; 35 | 36 | @end 37 | 38 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /OpenCV Tutorial/ViewController.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)viewDidUnload 24 | { 25 | [super viewDidUnload]; 26 | // Release any retained subviews of the main view. 27 | } 28 | 29 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 30 | { 31 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 32 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 33 | } else { 34 | return YES; 35 | } 36 | } 37 | 38 | 39 | #pragma mark - UITableViewDataSource 40 | 41 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 42 | { 43 | return nil; 44 | } 45 | 46 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 47 | { 48 | return 0; 49 | } 50 | 51 | #pragma mark - UITableViewDelegate 52 | 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /OpenCV Tutorial/cog_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/cog_01.png -------------------------------------------------------------------------------- /OpenCV Tutorial/cog_01@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/cog_01@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/cog_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/cog_02.png -------------------------------------------------------------------------------- /OpenCV Tutorial/cog_02@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/cog_02@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/cvneon.h: -------------------------------------------------------------------------------- 1 | // 2 | // cvneon.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 8/12/12. 6 | // 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_cvneon_h 10 | #define OpenCV_Tutorial_cvneon_h 11 | 12 | namespace cv 13 | { 14 | //! Return new matrix identical to the input but 16-bytes aligned 15 | cv::Mat align16(const cv::Mat& m); 16 | 17 | //! Return true if input matrix has 16 bytes aligned rows 18 | bool isAligned(const cv::Mat& m); 19 | 20 | //! 21 | void neon_cvtColorBGRA2GRAY(const cv::Mat& input, cv::Mat& gray); 22 | 23 | //! 24 | void neon_transform_bgra(const cv::Mat& input, cv::Mat& result, const cv::Mat_& m_transposed); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /OpenCV Tutorial/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OpenCV Tutorial/en.lproj/switchCamera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/en.lproj/switchCamera.png -------------------------------------------------------------------------------- /OpenCV Tutorial/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 __MyCompanyName__. 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 | -------------------------------------------------------------------------------- /OpenCV Tutorial/main.mm: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OpenCV Tutorial 4 | // 5 | // Created by BloodAxe on 6/23/12. 6 | // Copyright (c) 2012 computer-vision-talks.com. 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 | -------------------------------------------------------------------------------- /OpenCV Tutorial/photos_polaroid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/photos_polaroid.png -------------------------------------------------------------------------------- /OpenCV Tutorial/photos_polaroid@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/photos_polaroid@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/record.png -------------------------------------------------------------------------------- /OpenCV Tutorial/record@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/record@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/refresh.png -------------------------------------------------------------------------------- /OpenCV Tutorial/refresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/refresh@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/refresh_straight_arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/refresh_straight_arrows.png -------------------------------------------------------------------------------- /OpenCV Tutorial/refresh_straight_arrows@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/refresh_straight_arrows@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/repeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/repeat.png -------------------------------------------------------------------------------- /OpenCV Tutorial/repeat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/repeat@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/switchCamera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/switchCamera.png -------------------------------------------------------------------------------- /OpenCV Tutorial/switchCamera@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/OpenCV Tutorial/switchCamera@2x.png -------------------------------------------------------------------------------- /OpenCV Tutorial/totalvariation.h: -------------------------------------------------------------------------------- 1 | // 2 | // totalvariation.h 3 | // OpenCV Tutorial 4 | // 5 | // Created by Emmanuel d'Angelo on 01.08.12. 6 | // 7 | // 8 | 9 | #ifndef OpenCV_Tutorial_totalvariation_h 10 | #define OpenCV_Tutorial_totalvariation_h 11 | 12 | //! Horizontal gradient with forward scheme 13 | void horizontal_gradient_forward(cv::Mat const &X, cv::Mat &Dx); 14 | //! Horizontal gradient with backward scheme 15 | void horizontal_gradient_backward(cv::Mat const &X, cv::Mat &Dx); 16 | 17 | //! Vertical gradient with forward scheme 18 | void vertical_gradient_forward(cv::Mat const &X, cv::Mat &Dx); 19 | //! Vertical gradient with backward scheme 20 | void vertical_gradient_backward(cv::Mat const &X, cv::Mat &Dx); 21 | 22 | //! 2D field (X1,X2) divergence with backward scheme 23 | void divergence_backward(cv::Mat const &X1, cv::Mat const &X2, cv::Mat &divX); 24 | 25 | //! Total-Variation DeNoising using [FISTA] 26 | void tvdn_fista(cv::Mat const &input, float lambda, int iterations, cv::Mat &result); 27 | 28 | 29 | //------------------------------// 30 | // References // 31 | //------------------------------// 32 | 33 | // [FISTA] 34 | // Beck, A., & Teboulle, M. (2009). 35 | // Fast Gradient-Based Algorithms for Constrained Total Variation Image Denoising and Deblurring Problems. 36 | // Image Processing, IEEE Transactions on, 18(11), 2419–2434. doi:10.1109/TIP.2009.2028250 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OpenCV Tutorial 2 | ========================== 3 | 4 | This repository contains source code of OpenCV Tutorial application. 5 | 6 | Samples list (done) 7 | ========================== 8 | * Edge detection (Canny, Sobel, Schaar) 9 | * Image transformations (Sepia, negative, contrast and brightness adjustments) 10 | * Feature Detection (SURF, ORB, FREAK) 11 | * Video tracking (KLT, BRIEF, ORB) 12 | 13 | Samples list (plans) 14 | ========================== 15 | * PTAM 16 | 17 | Step by step tutorials 18 | ========================== 19 | * [Part 1](http://computer-vision-talks.com/2012-06-23-opencv-tutorial-part-1/) 20 | * [Part 2](http://computer-vision-talks.com/2012-06-24-opencv-tutorial-part-2/) 21 | * [Part 3](http://computer-vision-talks.com/2012-06-27-opencv-tutorial-part-3/) 22 | * [Part 4](http://computer-vision-talks.com/2012-07-07-opencv-tutorial-part-4/) 23 | * [Part 5](http://computer-vision-talks.com/2012-07-14-opencv-tutorial-part-5/) 24 | * [Part 6](http://computer-vision-talks.com/2012-07-22-opencv-tutorial-part-6/) 25 | * [Part 7](http://computer-vision-talks.com/2012-10-22-opencv-tutorial-part-7/) 26 | 27 | Roadmap 28 | ========================== 29 | http://computer-vision-talks.com/opencv-tutorial-roadmap/ 30 | 31 | Copyright 32 | ========================== 33 | Idea and development by Eugene Khvedchenya 34 | 35 | http://computer-vision-talks.com 36 | 37 | This application is provided via BSD licence, it is free for both academic and commercial use. 38 | 39 | This application is provided as-is, with no warranty expressed or implied. Use this application at your own risk. 40 | The author assumes no liability for any loss associated with the use of this application. 41 | If you do not agree with the terms of this license, do not install this application. 42 | 43 | Contributors 44 | ========================== 45 | * Anton Belodedenko 46 | * Emmanuel d'Angelo 47 | * Daniel J. Pinter 48 | -------------------------------------------------------------------------------- /iTunesArtwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/iTunesArtwork.png -------------------------------------------------------------------------------- /iTunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/iTunesArtwork@2x.png -------------------------------------------------------------------------------- /opencv2.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /opencv2.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/calib3d/calib3d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/calib3d.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/bufferpool.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved. 6 | 7 | #ifndef __OPENCV_CORE_BUFFER_POOL_HPP__ 8 | #define __OPENCV_CORE_BUFFER_POOL_HPP__ 9 | 10 | namespace cv 11 | { 12 | 13 | class BufferPoolController 14 | { 15 | protected: 16 | ~BufferPoolController() { } 17 | public: 18 | virtual size_t getReservedSize() const = 0; 19 | virtual size_t getMaxReservedSize() const = 0; 20 | virtual void setMaxReservedSize(size_t size) = 0; 21 | virtual void freeAllReservedBuffers() = 0; 22 | }; 23 | 24 | } 25 | 26 | #endif // __OPENCV_CORE_BUFFER_POOL_HPP__ 27 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/core.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/core.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/cuda_stream_accessor.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP__ 44 | #define __OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP__ 45 | 46 | #ifndef __cplusplus 47 | # error cuda_stream_accessor.hpp header must be compiled as C++ 48 | #endif 49 | 50 | // This is only header file that depends on Cuda. All other headers are independent. 51 | // So if you use OpenCV binaries you do noot need to install Cuda Toolkit. 52 | // But of you wanna use CUDA by yourself, may get cuda stream instance using the class below. 53 | // In this case you have to install Cuda Toolkit. 54 | 55 | #include 56 | #include "opencv2/core/cvdef.h" 57 | 58 | namespace cv 59 | { 60 | namespace cuda 61 | { 62 | class Stream; 63 | class Event; 64 | 65 | struct StreamAccessor 66 | { 67 | CV_EXPORTS static cudaStream_t getStream(const Stream& stream); 68 | }; 69 | 70 | struct EventAccessor 71 | { 72 | CV_EXPORTS static cudaEvent_t getEvent(const Event& event); 73 | }; 74 | } 75 | } 76 | 77 | #endif /* __OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP__ */ 78 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/ippasync.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCV_CORE_IPPASYNC_HPP__ 2 | #define __OPENCV_CORE_IPPASYNC_HPP__ 3 | 4 | #ifdef HAVE_IPP_A 5 | 6 | #include "opencv2/core.hpp" 7 | #include 8 | #include 9 | 10 | namespace cv 11 | { 12 | 13 | namespace hpp 14 | { 15 | //convert OpenCV data type to hppDataType 16 | inline int toHppType(const int cvType) 17 | { 18 | int depth = CV_MAT_DEPTH(cvType); 19 | int hppType = depth == CV_8U ? HPP_DATA_TYPE_8U : 20 | depth == CV_16U ? HPP_DATA_TYPE_16U : 21 | depth == CV_16S ? HPP_DATA_TYPE_16S : 22 | depth == CV_32S ? HPP_DATA_TYPE_32S : 23 | depth == CV_32F ? HPP_DATA_TYPE_32F : 24 | depth == CV_64F ? HPP_DATA_TYPE_64F : -1; 25 | CV_Assert( hppType >= 0 ); 26 | return hppType; 27 | } 28 | 29 | //convert hppDataType to OpenCV data type 30 | inline int toCvType(const int hppType) 31 | { 32 | int cvType = hppType == HPP_DATA_TYPE_8U ? CV_8U : 33 | hppType == HPP_DATA_TYPE_16U ? CV_16U : 34 | hppType == HPP_DATA_TYPE_16S ? CV_16S : 35 | hppType == HPP_DATA_TYPE_32S ? CV_32S : 36 | hppType == HPP_DATA_TYPE_32F ? CV_32F : 37 | hppType == HPP_DATA_TYPE_64F ? CV_64F : -1; 38 | CV_Assert( cvType >= 0 ); 39 | return cvType; 40 | } 41 | 42 | inline void copyHppToMat(hppiMatrix* src, Mat& dst, hppAccel accel, int cn) 43 | { 44 | hppDataType type; 45 | hpp32u width, height; 46 | hppStatus sts; 47 | 48 | if (src == NULL) 49 | return dst.release(); 50 | 51 | sts = hppiInquireMatrix(src, &type, &width, &height); 52 | 53 | CV_Assert( sts == HPP_STATUS_NO_ERROR); 54 | 55 | int matType = CV_MAKETYPE(toCvType(type), cn); 56 | 57 | CV_Assert(width%cn == 0); 58 | 59 | width /= cn; 60 | 61 | dst.create((int)height, (int)width, (int)matType); 62 | 63 | size_t newSize = (size_t)(height*(hpp32u)(dst.step)); 64 | 65 | sts = hppiGetMatrixData(accel,src,(hpp32u)(dst.step),dst.data,&newSize); 66 | 67 | CV_Assert( sts == HPP_STATUS_NO_ERROR); 68 | } 69 | 70 | //create cv::Mat from hppiMatrix 71 | inline Mat getMat(hppiMatrix* src, hppAccel accel, int cn) 72 | { 73 | Mat dst; 74 | copyHppToMat(src, dst, accel, cn); 75 | return dst; 76 | } 77 | 78 | //create hppiMatrix from cv::Mat 79 | inline hppiMatrix* getHpp(const Mat& src, hppAccel accel) 80 | { 81 | int htype = toHppType(src.type()); 82 | int cn = src.channels(); 83 | 84 | CV_Assert(src.data); 85 | hppAccelType accelType = hppQueryAccelType(accel); 86 | 87 | if (accelType!=HPP_ACCEL_TYPE_CPU) 88 | { 89 | hpp32u pitch, size; 90 | hppQueryMatrixAllocParams(accel, src.cols*cn, src.rows, htype, &pitch, &size); 91 | if (pitch!=0 && size!=0) 92 | if ((int)(src.data)%4096==0 && pitch==(hpp32u)(src.step)) 93 | { 94 | return hppiCreateSharedMatrix(htype, src.cols*cn, src.rows, src.data, pitch, size); 95 | } 96 | } 97 | 98 | return hppiCreateMatrix(htype, src.cols*cn, src.rows, src.data, (hpp32s)(src.step));; 99 | } 100 | 101 | }} 102 | 103 | #endif 104 | 105 | #endif -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/ocl_genbase.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OPENCL_GENBASE_HPP__ 43 | #define __OPENCV_OPENCL_GENBASE_HPP__ 44 | 45 | namespace cv 46 | { 47 | namespace ocl 48 | { 49 | 50 | struct ProgramEntry 51 | { 52 | const char* name; 53 | const char* programStr; 54 | const char* programHash; 55 | }; 56 | 57 | } 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/version.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright( C) 2000, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2011-2013, NVIDIA Corporation, all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of Intel Corporation may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | //(including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort(including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | /* 44 | definition of the current version of OpenCV 45 | Usefull to test in user programs 46 | */ 47 | 48 | #ifndef __OPENCV_VERSION_HPP__ 49 | #define __OPENCV_VERSION_HPP__ 50 | 51 | #define CV_VERSION_MAJOR 3 52 | #define CV_VERSION_MINOR 0 53 | #define CV_VERSION_REVISION 0 54 | #define CV_VERSION_STATUS "-beta" 55 | 56 | #define CVAUX_STR_EXP(__A) #__A 57 | #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) 58 | 59 | #define CVAUX_STRW_EXP(__A) L#__A 60 | #define CVAUX_STRW(__A) CVAUX_STRW_EXP(__A) 61 | 62 | #define CV_VERSION CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) CV_VERSION_STATUS 63 | 64 | /* old style version constants*/ 65 | #define CV_MAJOR_VERSION CV_VERSION_MAJOR 66 | #define CV_MINOR_VERSION CV_VERSION_MINOR 67 | #define CV_SUBMINOR_VERSION CV_VERSION_REVISION 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/features2d/features2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/features2d.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/config.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_CONFIG_H_ 31 | #define OPENCV_FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "1.6.10" 37 | 38 | #endif /* OPENCV_FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENCV_FLANN_DUMMY_H_ 3 | #define OPENCV_FLANN_DUMMY_H_ 4 | 5 | namespace cvflann 6 | { 7 | 8 | #if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS 9 | __declspec(dllexport) 10 | #endif 11 | void dummyfunc(); 12 | 13 | } 14 | 15 | 16 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 17 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/flann.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/flann.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/general.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GENERAL_H_ 32 | #define OPENCV_FLANN_GENERAL_H_ 33 | 34 | #include "opencv2/core.hpp" 35 | 36 | namespace cvflann 37 | { 38 | 39 | class FLANNException : public cv::Exception 40 | { 41 | public: 42 | FLANNException(const char* message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } 43 | 44 | FLANNException(const cv::String& message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } 45 | }; 46 | 47 | } 48 | 49 | 50 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 51 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/ground_truth.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GROUND_TRUTH_H_ 32 | #define OPENCV_FLANN_GROUND_TRUTH_H_ 33 | 34 | #include "dist.h" 35 | #include "matrix.h" 36 | 37 | 38 | namespace cvflann 39 | { 40 | 41 | template 42 | void find_nearest(const Matrix& dataset, typename Distance::ElementType* query, int* matches, int nn, 43 | int skip = 0, Distance distance = Distance()) 44 | { 45 | typedef typename Distance::ResultType DistanceType; 46 | int n = nn + skip; 47 | 48 | std::vector match(n); 49 | std::vector dists(n); 50 | 51 | dists[0] = distance(dataset[0], query, dataset.cols); 52 | match[0] = 0; 53 | int dcnt = 1; 54 | 55 | for (size_t i=1; i=1 && dists[j] 83 | void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, 84 | int skip=0, Distance d = Distance()) 85 | { 86 | for (size_t i=0; i(dataset, testset[i], matches[i], (int)matches.cols, skip, d); 88 | } 89 | } 90 | 91 | 92 | } 93 | 94 | #endif //OPENCV_FLANN_GROUND_TRUTH_H_ 95 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/object_factory.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_OBJECT_FACTORY_H_ 32 | #define OPENCV_FLANN_OBJECT_FACTORY_H_ 33 | 34 | #include 35 | 36 | namespace cvflann 37 | { 38 | 39 | class CreatorNotFound 40 | { 41 | }; 42 | 43 | template 46 | class ObjectFactory 47 | { 48 | typedef ObjectFactory ThisClass; 49 | typedef std::map ObjectRegistry; 50 | 51 | // singleton class, private constructor 52 | ObjectFactory() {} 53 | 54 | public: 55 | 56 | bool subscribe(UniqueIdType id, ObjectCreator creator) 57 | { 58 | if (object_registry.find(id) != object_registry.end()) return false; 59 | 60 | object_registry[id] = creator; 61 | return true; 62 | } 63 | 64 | bool unregister(UniqueIdType id) 65 | { 66 | return object_registry.erase(id) == 1; 67 | } 68 | 69 | ObjectCreator create(UniqueIdType id) 70 | { 71 | typename ObjectRegistry::const_iterator iter = object_registry.find(id); 72 | 73 | if (iter == object_registry.end()) { 74 | throw CreatorNotFound(); 75 | } 76 | 77 | return iter->second; 78 | } 79 | 80 | static ThisClass& instance() 81 | { 82 | static ThisClass the_factory; 83 | return the_factory; 84 | } 85 | private: 86 | ObjectRegistry object_registry; 87 | }; 88 | 89 | } 90 | 91 | #endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */ 92 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/params.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_PARAMS_H_ 31 | #define OPENCV_FLANN_PARAMS_H_ 32 | 33 | #include "any.h" 34 | #include "general.h" 35 | #include 36 | #include 37 | 38 | 39 | namespace cvflann 40 | { 41 | 42 | typedef std::map IndexParams; 43 | 44 | struct SearchParams : public IndexParams 45 | { 46 | SearchParams(int checks = 32, float eps = 0, bool sorted = true ) 47 | { 48 | // how many leafs to visit when searching for neighbours (-1 for unlimited) 49 | (*this)["checks"] = checks; 50 | // search for eps-approximate neighbours (default: 0) 51 | (*this)["eps"] = eps; 52 | // only for radius search, require neighbours sorted by distance (default: true) 53 | (*this)["sorted"] = sorted; 54 | } 55 | }; 56 | 57 | 58 | template 59 | T get_param(const IndexParams& params, cv::String name, const T& default_value) 60 | { 61 | IndexParams::const_iterator it = params.find(name); 62 | if (it != params.end()) { 63 | return it->second.cast(); 64 | } 65 | else { 66 | return default_value; 67 | } 68 | } 69 | 70 | template 71 | T get_param(const IndexParams& params, cv::String name) 72 | { 73 | IndexParams::const_iterator it = params.find(name); 74 | if (it != params.end()) { 75 | return it->second.cast(); 76 | } 77 | else { 78 | throw FLANNException(cv::String("Missing parameter '")+name+cv::String("' in the parameters given")); 79 | } 80 | } 81 | 82 | inline void print_params(const IndexParams& params, std::ostream& stream) 83 | { 84 | IndexParams::const_iterator it; 85 | 86 | for(it=params.begin(); it!=params.end(); ++it) { 87 | stream << it->first << " : " << it->second << std::endl; 88 | } 89 | } 90 | 91 | inline void print_params(const IndexParams& params) 92 | { 93 | print_params(params, std::cout); 94 | } 95 | 96 | } 97 | 98 | 99 | #endif /* OPENCV_FLANN_PARAMS_H_ */ 100 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/sampling.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_SAMPLING_H_ 31 | #define OPENCV_FLANN_SAMPLING_H_ 32 | 33 | #include "matrix.h" 34 | #include "random.h" 35 | 36 | namespace cvflann 37 | { 38 | 39 | template 40 | Matrix random_sample(Matrix& srcMatrix, long size, bool remove = false) 41 | { 42 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 43 | 44 | T* src,* dest; 45 | for (long i=0; i 63 | Matrix random_sample(const Matrix& srcMatrix, size_t size) 64 | { 65 | UniqueRandom rand((int)srcMatrix.rows); 66 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 67 | 68 | T* src,* dest; 69 | for (size_t i=0; i 35 | #include "opencv2/core.hpp" 36 | #include "opencv2/core/utility.hpp" 37 | 38 | namespace cvflann 39 | { 40 | 41 | /** 42 | * A start-stop timer class. 43 | * 44 | * Can be used to time portions of code. 45 | */ 46 | class StartStopTimer 47 | { 48 | int64 startTime; 49 | 50 | public: 51 | /** 52 | * Value of the timer. 53 | */ 54 | double value; 55 | 56 | 57 | /** 58 | * Constructor. 59 | */ 60 | StartStopTimer() 61 | { 62 | reset(); 63 | } 64 | 65 | /** 66 | * Starts the timer. 67 | */ 68 | void start() 69 | { 70 | startTime = cv::getTickCount(); 71 | } 72 | 73 | /** 74 | * Stops the timer and updates timer value. 75 | */ 76 | void stop() 77 | { 78 | int64 stopTime = cv::getTickCount(); 79 | value += ( (double)stopTime - startTime) / cv::getTickFrequency(); 80 | } 81 | 82 | /** 83 | * Resets the timer value to 0. 84 | */ 85 | void reset() 86 | { 87 | value = 0; 88 | } 89 | 90 | }; 91 | 92 | } 93 | 94 | #endif // FLANN_TIMER_H 95 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/highgui/highgui.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/highgui.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/imgcodecs/imgcodecs.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/imgcodecs.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/imgcodecs/ios.h: -------------------------------------------------------------------------------- 1 | 2 | /*M/////////////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 5 | // 6 | // By downloading, copying, installing or using the software you agree to this license. 7 | // If you do not agree to this license, do not download, install, 8 | // copy or use the software. 9 | // 10 | // 11 | // License Agreement 12 | // For Open Source Computer Vision Library 13 | // 14 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 15 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #import 45 | #import 46 | #import 47 | #import 48 | #include "opencv2/core/core.hpp" 49 | 50 | UIImage* MatToUIImage(const cv::Mat& image); 51 | void UIImageToMat(const UIImage* image, 52 | cv::Mat& m, bool alphaExist = false); 53 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/imgproc/imgproc.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/imgproc.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/ml/ml.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/ml.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/objdetect/objdetect.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/objdetect.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/opencv.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_ALL_HPP__ 44 | #define __OPENCV_ALL_HPP__ 45 | 46 | #include "opencv2/core.hpp" 47 | #include "opencv2/imgproc.hpp" 48 | #include "opencv2/photo.hpp" 49 | #include "opencv2/video.hpp" 50 | #include "opencv2/features2d.hpp" 51 | #include "opencv2/objdetect.hpp" 52 | #include "opencv2/calib3d.hpp" 53 | #include "opencv2/imgcodecs.hpp" 54 | #include "opencv2/videoio.hpp" 55 | #include "opencv2/highgui.hpp" 56 | #include "opencv2/ml.hpp" 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/opencv_modules.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | #define HAVE_OPENCV_CALIB3D 10 | #define HAVE_OPENCV_CORE 11 | #define HAVE_OPENCV_FEATURES2D 12 | #define HAVE_OPENCV_FLANN 13 | #define HAVE_OPENCV_HIGHGUI 14 | #define HAVE_OPENCV_IMGCODECS 15 | #define HAVE_OPENCV_IMGPROC 16 | #define HAVE_OPENCV_ML 17 | #define HAVE_OPENCV_OBJDETECT 18 | #define HAVE_OPENCV_PHOTO 19 | #define HAVE_OPENCV_SHAPE 20 | #define HAVE_OPENCV_STITCHING 21 | #define HAVE_OPENCV_VIDEO 22 | #define HAVE_OPENCV_VIDEOIO 23 | #define HAVE_OPENCV_VIDEOSTAB 24 | #define HAVE_OPENCV_WORLD 25 | 26 | 27 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/photo/cuda.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PHOTO_CUDA_HPP__ 44 | #define __OPENCV_PHOTO_CUDA_HPP__ 45 | 46 | #include "opencv2/core/cuda.hpp" 47 | 48 | namespace cv { namespace cuda { 49 | 50 | //! Brute force non-local means algorith (slow but universal) 51 | CV_EXPORTS void nonLocalMeans(const GpuMat& src, GpuMat& dst, float h, int search_window = 21, int block_size = 7, int borderMode = BORDER_DEFAULT, Stream& s = Stream::Null()); 52 | 53 | //! Fast (but approximate)version of non-local means algorith similar to CPU function (running sums technique) 54 | class CV_EXPORTS FastNonLocalMeansDenoising 55 | { 56 | public: 57 | //! Simple method, recommended for grayscale images (though it supports multichannel images) 58 | void simpleMethod(const GpuMat& src, GpuMat& dst, float h, int search_window = 21, int block_size = 7, Stream& s = Stream::Null()); 59 | 60 | //! Processes luminance and color components separatelly 61 | void labMethod(const GpuMat& src, GpuMat& dst, float h_luminance, float h_color, int search_window = 21, int block_size = 7, Stream& s = Stream::Null()); 62 | 63 | private: 64 | 65 | GpuMat buffer, extended_src_buffer; 66 | GpuMat lab, l, ab; 67 | }; 68 | 69 | }} // namespace cv { namespace cuda { 70 | 71 | #endif /* __OPENCV_PHOTO_CUDA_HPP__ */ 72 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/photo/photo.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/photo.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/photo/photo_c.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PHOTO_C_H__ 44 | #define __OPENCV_PHOTO_C_H__ 45 | 46 | #include "opencv2/core/core_c.h" 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /* Inpainting algorithms */ 53 | enum 54 | { 55 | CV_INPAINT_NS =0, 56 | CV_INPAINT_TELEA =1 57 | }; 58 | 59 | 60 | /* Inpaints the selected region in the image */ 61 | CVAPI(void) cvInpaint( const CvArr* src, const CvArr* inpaint_mask, 62 | CvArr* dst, double inpaintRange, int flags ); 63 | 64 | 65 | #ifdef __cplusplus 66 | } //extern "C" 67 | #endif 68 | 69 | #endif //__OPENCV_PHOTO_C_H__ 70 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/shape.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_SHAPE_HPP__ 44 | #define __OPENCV_SHAPE_HPP__ 45 | 46 | #include "opencv2/shape/emdL1.hpp" 47 | #include "opencv2/shape/shape_transformer.hpp" 48 | #include "opencv2/shape/hist_cost.hpp" 49 | #include "opencv2/shape/shape_distance.hpp" 50 | 51 | namespace cv 52 | { 53 | CV_EXPORTS bool initModule_shape(); 54 | } 55 | 56 | #endif 57 | 58 | /* End of file. */ 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/shape/emdL1.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_EMD_L1_HPP__ 44 | #define __OPENCV_EMD_L1_HPP__ 45 | 46 | #include "opencv2/core.hpp" 47 | 48 | namespace cv 49 | { 50 | /****************************************************************************************\ 51 | * EMDL1 Function * 52 | \****************************************************************************************/ 53 | 54 | CV_EXPORTS float EMDL1(InputArray signature1, InputArray signature2); 55 | 56 | }//namespace cv 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/shape/shape.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/shape.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/autocalib.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_AUTOCALIB_HPP__ 44 | #define __OPENCV_STITCHING_AUTOCALIB_HPP__ 45 | 46 | #include "opencv2/core.hpp" 47 | #include "matchers.hpp" 48 | 49 | namespace cv { 50 | namespace detail { 51 | 52 | // See "Construction of Panoramic Image Mosaics with Global and Local Alignment" 53 | // by Heung-Yeung Shum and Richard Szeliski. 54 | void CV_EXPORTS focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok); 55 | 56 | void CV_EXPORTS estimateFocal(const std::vector &features, 57 | const std::vector &pairwise_matches, 58 | std::vector &focals); 59 | 60 | bool CV_EXPORTS calibrateRotatingCamera(const std::vector &Hs, Mat &K); 61 | 62 | } // namespace detail 63 | } // namespace cv 64 | 65 | #endif // __OPENCV_STITCHING_AUTOCALIB_HPP__ 66 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/camera.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_CAMERA_HPP__ 44 | #define __OPENCV_STITCHING_CAMERA_HPP__ 45 | 46 | #include "opencv2/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | struct CV_EXPORTS CameraParams 52 | { 53 | CameraParams(); 54 | CameraParams(const CameraParams& other); 55 | const CameraParams& operator =(const CameraParams& other); 56 | Mat K() const; 57 | 58 | double focal; // Focal length 59 | double aspect; // Aspect ratio 60 | double ppx; // Principal point X 61 | double ppy; // Principal point Y 62 | Mat R; // Rotation 63 | Mat t; // Translation 64 | }; 65 | 66 | } // namespace detail 67 | } // namespace cv 68 | 69 | #endif // #ifndef __OPENCV_STITCHING_CAMERA_HPP__ 70 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/timelapsers.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | 44 | #ifndef __OPENCV_STITCHING_TIMELAPSERS_HPP__ 45 | #define __OPENCV_STITCHING_TIMELAPSERS_HPP__ 46 | 47 | #include "opencv2/core.hpp" 48 | 49 | namespace cv { 50 | namespace detail { 51 | 52 | // Base Timelapser class, takes a sequence of images, applies appropriate shift, stores result in dst_. 53 | 54 | class CV_EXPORTS Timelapser 55 | { 56 | public: 57 | 58 | enum {AS_IS, CROP}; 59 | 60 | virtual ~Timelapser() {} 61 | 62 | static Ptr createDefault(int type); 63 | 64 | virtual void initialize(const std::vector &corners, const std::vector &sizes); 65 | virtual void process(InputArray img, InputArray mask, Point tl); 66 | virtual const UMat& getDst() {return dst_;} 67 | 68 | protected: 69 | 70 | virtual bool test_point(Point pt); 71 | 72 | UMat dst_; 73 | Rect dst_roi_; 74 | }; 75 | 76 | 77 | class CV_EXPORTS TimelapserCrop : public Timelapser 78 | { 79 | public: 80 | virtual void initialize(const std::vector &corners, const std::vector &sizes); 81 | }; 82 | 83 | } // namespace detail 84 | } // namespace cv 85 | 86 | #endif // __OPENCV_STITCHING_TIMELAPSERS_HPP__ 87 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/video.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifndef __OPENCV_VIDEO_HPP__ 45 | #define __OPENCV_VIDEO_HPP__ 46 | 47 | #include "opencv2/video/tracking.hpp" 48 | #include "opencv2/video/background_segm.hpp" 49 | 50 | #endif //__OPENCV_VIDEO_HPP__ 51 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/video/video.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/video.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videoio/videoio.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/videoio.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | // REFERENCES 44 | // 1. "Full-Frame Video Stabilization with Motion Inpainting" 45 | // Yasuyuki Matsushita, Eyal Ofek, Weina Ge, Xiaoou Tang, Senior Member, and Heung-Yeung Shum 46 | // 2. "Auto-Directed Video Stabilization with Robust L1 Optimal Camera Paths" 47 | // Matthias Grundmann, Vivek Kwatra, Irfan Essa 48 | 49 | #ifndef __OPENCV_VIDEOSTAB_HPP__ 50 | #define __OPENCV_VIDEOSTAB_HPP__ 51 | 52 | #include "opencv2/videostab/stabilizer.hpp" 53 | #include "opencv2/videostab/ring_buffer.hpp" 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/frame_source.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ 45 | 46 | #include 47 | #include "opencv2/core.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | class CV_EXPORTS IFrameSource 55 | { 56 | public: 57 | virtual ~IFrameSource() {} 58 | virtual void reset() = 0; 59 | virtual Mat nextFrame() = 0; 60 | }; 61 | 62 | class CV_EXPORTS NullFrameSource : public IFrameSource 63 | { 64 | public: 65 | virtual void reset() {} 66 | virtual Mat nextFrame() { return Mat(); } 67 | }; 68 | 69 | class CV_EXPORTS VideoFileSource : public IFrameSource 70 | { 71 | public: 72 | VideoFileSource(const String &path, bool volatileFrame = false); 73 | 74 | virtual void reset(); 75 | virtual Mat nextFrame(); 76 | 77 | int width(); 78 | int height(); 79 | int count(); 80 | double fps(); 81 | 82 | private: 83 | Ptr impl; 84 | }; 85 | 86 | } // namespace videostab 87 | } // namespace cv 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/log.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_LOG_HPP__ 44 | #define __OPENCV_VIDEOSTAB_LOG_HPP__ 45 | 46 | #include "opencv2/core.hpp" 47 | 48 | namespace cv 49 | { 50 | namespace videostab 51 | { 52 | 53 | class CV_EXPORTS ILog 54 | { 55 | public: 56 | virtual ~ILog() {} 57 | virtual void print(const char *format, ...) = 0; 58 | }; 59 | 60 | class CV_EXPORTS NullLog : public ILog 61 | { 62 | public: 63 | virtual void print(const char * /*format*/, ...) {} 64 | }; 65 | 66 | class CV_EXPORTS LogToStdout : public ILog 67 | { 68 | public: 69 | virtual void print(const char *format, ...); 70 | }; 71 | 72 | } // namespace videostab 73 | } // namespace cv 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/outlier_rejection.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_OUTLIER_REJECTION_HPP__ 44 | #define __OPENCV_VIDEOSTAB_OUTLIER_REJECTION_HPP__ 45 | 46 | #include 47 | #include "opencv2/core.hpp" 48 | #include "opencv2/videostab/motion_core.hpp" 49 | 50 | namespace cv 51 | { 52 | namespace videostab 53 | { 54 | 55 | class CV_EXPORTS IOutlierRejector 56 | { 57 | public: 58 | virtual ~IOutlierRejector() {} 59 | 60 | virtual void process( 61 | Size frameSize, InputArray points0, InputArray points1, OutputArray mask) = 0; 62 | }; 63 | 64 | class CV_EXPORTS NullOutlierRejector : public IOutlierRejector 65 | { 66 | public: 67 | virtual void process( 68 | Size frameSize, InputArray points0, InputArray points1, OutputArray mask); 69 | }; 70 | 71 | class CV_EXPORTS TranslationBasedLocalOutlierRejector : public IOutlierRejector 72 | { 73 | public: 74 | TranslationBasedLocalOutlierRejector(); 75 | 76 | void setCellSize(Size val) { cellSize_ = val; } 77 | Size cellSize() const { return cellSize_; } 78 | 79 | void setRansacParams(RansacParams val) { ransacParams_ = val; } 80 | RansacParams ransacParams() const { return ransacParams_; } 81 | 82 | virtual void process( 83 | Size frameSize, InputArray points0, InputArray points1, OutputArray mask); 84 | 85 | private: 86 | Size cellSize_; 87 | RansacParams ransacParams_; 88 | 89 | typedef std::vector Cell; 90 | std::vector grid_; 91 | }; 92 | 93 | } // namespace videostab 94 | } // namespace cv 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/ring_buffer.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_RING_BUFFER_HPP__ 44 | #define __OPENCV_VIDEOSTAB_RING_BUFFER_HPP__ 45 | 46 | #include 47 | #include "opencv2/imgproc.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | template inline T& at(int idx, std::vector &items) 55 | { 56 | return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; 57 | } 58 | 59 | template inline const T& at(int idx, const std::vector &items) 60 | { 61 | return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; 62 | } 63 | 64 | } // namespace videostab 65 | } // namespace cv 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/world.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_WORLD_HPP__ 44 | #define __OPENCV_WORLD_HPP__ 45 | 46 | #include "opencv2/core.hpp" 47 | 48 | #ifdef __cplusplus 49 | namespace cv 50 | { 51 | 52 | CV_EXPORTS_W bool initAll(); 53 | 54 | } 55 | 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | OpenCV 7 | CFBundleIdentifier 8 | org.opencv 9 | CFBundleVersion 10 | 3.0.0 11 | CFBundleShortVersionString 12 | 3.0.0 13 | CFBundleSignature 14 | ???? 15 | CFBundlePackageType 16 | FMWK 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/opencv2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BloodAxe/OpenCV-Tutorial/cdf13b2703518b03d24bd8c9971631c226c8b8ce/opencv2.framework/Versions/A/opencv2 -------------------------------------------------------------------------------- /opencv2.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /opencv2.framework/opencv2: -------------------------------------------------------------------------------- 1 | Versions/Current/opencv2 --------------------------------------------------------------------------------