├── .gitignore ├── OpenCVCircles.xcodeproj └── project.pbxproj ├── OpenCVCircles ├── CVAppDelegate.h ├── CVAppDelegate.m ├── CVCircles.cpp ├── CVCircles.h ├── CVViewController.h ├── CVViewController.m ├── CVWrapper.h ├── CVWrapper.mm ├── Default-568h@2x.png ├── Default.png ├── Default@2x.png ├── OpenCVCircles-Info.plist ├── OpenCVCircles-Prefix.pch ├── UIImage+OpenCV.h ├── UIImage+OpenCV.mm ├── board.jpg ├── circles.gif ├── circles.jpg ├── circles2.jpg ├── en.lproj │ ├── InfoPlist.strings │ ├── MainStoryboard_iPad.storyboard │ └── MainStoryboard_iPhone.storyboard └── main.m ├── README.markdown └── opencv2.framework ├── Headers ├── Resources ├── Versions ├── A │ ├── Headers │ │ ├── calib3d │ │ │ └── calib3d.hpp │ │ ├── contrib │ │ │ ├── contrib.hpp │ │ │ ├── detection_based_tracker.hpp │ │ │ ├── hybridtracker.hpp │ │ │ ├── openfabmap.hpp │ │ │ └── retina.hpp │ │ ├── core │ │ │ ├── core.hpp │ │ │ ├── core_c.h │ │ │ ├── cuda_devptrs.hpp │ │ │ ├── eigen.hpp │ │ │ ├── gpumat.hpp │ │ │ ├── internal.hpp │ │ │ ├── mat.hpp │ │ │ ├── opengl_interop.hpp │ │ │ ├── operations.hpp │ │ │ ├── types_c.h │ │ │ ├── version.hpp │ │ │ └── wimage.hpp │ │ ├── features2d │ │ │ └── features2d.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 │ │ │ ├── cap_ios.h │ │ │ ├── highgui.hpp │ │ │ └── highgui_c.h │ │ ├── imgproc │ │ │ ├── imgproc.hpp │ │ │ ├── imgproc_c.h │ │ │ └── types_c.h │ │ ├── legacy │ │ │ ├── blobtrack.hpp │ │ │ ├── compat.hpp │ │ │ ├── legacy.hpp │ │ │ └── streams.hpp │ │ ├── ml │ │ │ └── ml.hpp │ │ ├── nonfree │ │ │ ├── features2d.hpp │ │ │ └── nonfree.hpp │ │ ├── objdetect │ │ │ └── objdetect.hpp │ │ ├── opencv.hpp │ │ ├── opencv_modules.hpp │ │ ├── photo │ │ │ ├── photo.hpp │ │ │ └── photo_c.h │ │ ├── stitching │ │ │ ├── detail │ │ │ │ ├── autocalib.hpp │ │ │ │ ├── blenders.hpp │ │ │ │ ├── camera.hpp │ │ │ │ ├── exposure_compensate.hpp │ │ │ │ ├── matchers.hpp │ │ │ │ ├── motion_estimators.hpp │ │ │ │ ├── seam_finders.hpp │ │ │ │ ├── util.hpp │ │ │ │ ├── util_inl.hpp │ │ │ │ ├── warpers.hpp │ │ │ │ └── warpers_inl.hpp │ │ │ ├── stitcher.hpp │ │ │ └── warpers.hpp │ │ ├── video │ │ │ ├── background_segm.hpp │ │ │ ├── tracking.hpp │ │ │ └── video.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 │ │ │ ├── videostab.hpp │ │ │ └── wobble_suppression.hpp │ │ └── world │ │ │ └── world.hpp │ ├── Resources │ │ └── Info.plist │ └── opencv2 └── Current └── opencv2 /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | *.lock 4 | profile 5 | *~.nib 6 | 7 | DerivedData/ 8 | build/ 9 | *.pbxuser 10 | *.mode1v3 11 | *.mode2v3 12 | *.perspectivev3 13 | !default.pbxuser 14 | !default.mode1v3 15 | !default.mode2v3 16 | !default.perspectivev3 17 | project.xcworkspace 18 | UserInterfaceState.xcuserstate 19 | xcuserdata 20 | xcdebugger/ 21 | *.moved-aside -------------------------------------------------------------------------------- /OpenCVCircles/CVAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVAppDelegate.h 3 | // CVOpenTemplate 4 | // 5 | // Created by Washe on 02/01/2013. 6 | // Copyright (c) 2013 Washe / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | 15 | #import 16 | 17 | @interface CVAppDelegate : UIResponder 18 | 19 | @property (strong, nonatomic) UIWindow *window; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /OpenCVCircles/CVAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CVAppDelegate.m 3 | // CVOpenTemplate 4 | // 5 | // Created by Washe on 02/01/2013. 6 | // Copyright (c) 2013 Washe / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | 15 | #import "CVAppDelegate.h" 16 | 17 | @implementation CVAppDelegate 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 20 | { 21 | return YES; 22 | } 23 | 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /OpenCVCircles/CVCircles.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CVSquares.cpp 3 | // OpenCVClient 4 | // 5 | // Original code from sample distributed with openCV source. 6 | // Modifications (c) Washe / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | 15 | #include "CVCircles.h" 16 | 17 | //#include 18 | 19 | using namespace cv; 20 | using namespace std; 21 | 22 | cv::Mat CVCircles::detectedCirclesInImage 23 | (cv::Mat img, double dp, double minDist, double param1, double param2, int min_radius, int max_radius) 24 | 25 | { 26 | if(img.empty()) 27 | { 28 | cout << "can not open image " << endl; 29 | return img; 30 | } 31 | 32 | Mat cimg; 33 | 34 | if (img.type()==CV_8UC1) { 35 | cvtColor(img, cimg, CV_GRAY2RGB); 36 | 37 | //image is grayscale 38 | } else { 39 | cimg = img; 40 | cvtColor(img, img, CV_RGB2GRAY); 41 | //image is color 42 | } 43 | 44 | medianBlur(img, img, 5); 45 | 46 | // cvtColor(img, cimg, CV_GRAY2RGB); 47 | 48 | vector circles; 49 | HoughCircles( img //InputArray 50 | , circles //OutputArray 51 | , CV_HOUGH_GRADIENT //int method 52 | , dp //double dp=1 1 ... 20 53 | , minDist //double minDist=10 log 1...1000 54 | , param1 //double param1=100 55 | , param2 //double param2=30 10 ... 50 56 | , min_radius //int minRadius=1 1 ... 500 57 | , max_radius //int maxRadius=30 1 ... 500 58 | ); 59 | 60 | /* 61 | http://docs.opencv.org/trunk/modules/imgproc/doc/feature_detection.html?highlight=houghcircles#void 62 | 63 | C++: void HoughCircles(InputArray image, OutputArray circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0 ) 64 | 65 | Parameters: 66 | image – 8-bit, single-channel, grayscale input image. 67 | circles – Output vector of found circles. Each vector is encoded as a 3-element floating-point vector . 68 | circle_storage – In C function this is a memory storage that will contain the output sequence of found circles. 69 | method – Detection method to use. Currently, the only implemented method is CV_HOUGH_GRADIENT , which is basically 21HT , described in [Yuen90]. 70 | dp – Inverse ratio of the accumulator resolution to the image resolution. For example, if dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has half as big width and height. 71 | minDist – Minimum distance between the centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. 72 | param1 – First method-specific parameter. In case of CV_HOUGH_GRADIENT , it is the higher threshold of the two passed to the Canny() edge detector (the lower one is twice smaller). 73 | param2 – Second method-specific parameter. In case of CV_HOUGH_GRADIENT , it is the accumulator threshold for the circle centers at the detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first. 74 | minRadius – Minimum circle radius. 75 | maxRadius – Maximum circle radius. 76 | The function finds circles in a grayscale image using a modification of the Hough transform. 77 | */ 78 | 79 | for( size_t i = 0; i < circles.size(); i++ ) 80 | { 81 | Vec3i c = circles[i]; 82 | circle( cimg, Point(c[0], c[1]), c[2], Scalar(255,0,0), 3, CV_AA); 83 | circle( cimg, Point(c[0], c[1]), 2, Scalar(0,255,0), 3, CV_AA); 84 | } 85 | 86 | 87 | return cimg; 88 | } 89 | 90 | /* the original code from the openCV samples 91 | int main(int argc, char** argv) 92 | { 93 | const char* filename = argc >= 2 ? argv[1] : "board.jpg"; 94 | 95 | Mat img = imread(filename, 0); 96 | if(img.empty()) 97 | { 98 | //help(); 99 | cout << "can not open " << filename << endl; 100 | return -1; 101 | } 102 | 103 | Mat cimg; 104 | medianBlur(img, img, 5); 105 | cvtColor(img, cimg, CV_GRAY2BGR); 106 | 107 | vector circles; 108 | HoughCircles(img, circles, CV_HOUGH_GRADIENT, 1, 10, 109 | 100, 30, 1, 30 // change the last two parameters 110 | // (min_radius & max_radius) to detect larger circles 111 | ); 112 | for( size_t i = 0; i < circles.size(); i++ ) 113 | { 114 | Vec3i c = circles[i]; 115 | circle( cimg, Point(c[0], c[1]), c[2], Scalar(0,0,255), 3, CV_AA); 116 | circle( cimg, Point(c[0], c[1]), 2, Scalar(0,255,0), 3, CV_AA); 117 | } 118 | 119 | imshow("detected circles", cimg); 120 | waitKey(); 121 | 122 | return 0; 123 | } 124 | 125 | */ -------------------------------------------------------------------------------- /OpenCVCircles/CVCircles.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVSquares.h 3 | // OpenCVClient 4 | // 5 | // Created by Washe on 30/12/2012. 6 | // Copyright (c) Washe / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | 15 | #ifndef __OpenCVClient__JMSquares__ 16 | #define __OpenCVClient__JMSquares__ 17 | 18 | //#include 19 | 20 | //class definition 21 | //in this example we do not need a class 22 | //as we have no instance variables and just one static function. 23 | //We could instead just declare the function but this form seems clearer 24 | 25 | class CVCircles 26 | { 27 | public: 28 | //static cv::Mat detectedSquaresInImage (cv::Mat image, float tol, int threshold, int levels, int accuracy); 29 | //static cv::Mat detectedCirclesInImage (const cv::Mat image, double dp, double minDist, double param2); 30 | 31 | static cv::Mat detectedCirclesInImage 32 | (cv::Mat img, double dp, double minDist, double param1, double param2, int min_radius, int max_radius); 33 | 34 | }; 35 | 36 | #endif /* defined(__OpenCVClient__JMSquares__) */ 37 | -------------------------------------------------------------------------------- /OpenCVCircles/CVViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVViewController.h 3 | // CVOpenTemplate 4 | // 5 | // Created by Washe on 02/01/2013. 6 | // Copyright (c) 2013 Washe / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | 15 | #import 16 | 17 | @interface CVViewController : UIViewController 18 | 19 | @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 20 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 21 | 22 | @property (weak, nonatomic) IBOutlet UIView *controlsView; 23 | @property (weak, nonatomic) IBOutlet UIActivityIndicatorView* spinner; 24 | 25 | @property (weak, nonatomic) IBOutlet UISegmentedControl *accuracySelector; 26 | 27 | @property (assign) CGFloat dp; 28 | @property (assign) CGFloat minDist; 29 | @property (assign) CGFloat param2; 30 | @property (assign) int minRadius; 31 | @property (assign) int maxRadius; 32 | 33 | - (IBAction)imageTapped:(id)sender; 34 | 35 | - (IBAction)accuracyChanged:(id)sender; 36 | - (int)accuracy; 37 | 38 | @property (weak, nonatomic) IBOutlet UISlider *toleranceSlider; 39 | @property (weak, nonatomic) IBOutlet UILabel *toleranceLabel; 40 | - (IBAction)toleranceChanged:(id)sender; 41 | - (IBAction)toleranceTouchDragInside:(id)sender; 42 | 43 | 44 | @property (weak, nonatomic) IBOutlet UISlider *levelsSlider; 45 | @property (weak, nonatomic) IBOutlet UILabel *levelsLabel; 46 | - (IBAction)levelsChanged:(id)sender; 47 | - (IBAction)levelsTouchDragInside:(id)sender; 48 | 49 | @property (weak, nonatomic) IBOutlet UISlider *thresholdSlider; 50 | @property (weak, nonatomic) IBOutlet UILabel *thresholdLabel; 51 | - (IBAction)thresholdChanged:(id)sender; 52 | - (IBAction)thresholdTouchDragInside:(id)sender; 53 | 54 | @property (weak, nonatomic) IBOutlet UISlider *minRadiusSlider; 55 | @property (weak, nonatomic) IBOutlet UILabel *minRadiusLabel; 56 | - (IBAction)minRadiusChanged:(id)sender; 57 | - (IBAction)minRadiusTouchDragInside:(id)sender; 58 | 59 | @property (weak, nonatomic) IBOutlet UISlider *maxRadiusSlider; 60 | @property (weak, nonatomic) IBOutlet UILabel *maxRadiusLabel; 61 | - (IBAction)maxRadiusChanged:(id)sender; 62 | - (IBAction)maxRadiusTouchDragInside:(id)sender; 63 | 64 | 65 | 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /OpenCVCircles/CVWrapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVWrapper.h 3 | // CVOpenTemplate 4 | // 5 | // Created by Washe on 02/01/2013. 6 | // Copyright (c) 2013 Washe / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | 15 | #import 16 | 17 | @interface CVWrapper : NSObject 18 | 19 | + (UIImage*) detectedCirclesInImage:(UIImage*)image; 20 | 21 | 22 | + (UIImage*) detectedCirclesInImage:(UIImage*)image 23 | dp:(CGFloat)dp 24 | minDist:(CGFloat)minDist 25 | param2:(CGFloat)param2 26 | min_radius:(int)min_radius 27 | max_radius:(int)max_radius; 28 | 29 | 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /OpenCVCircles/CVWrapper.mm: -------------------------------------------------------------------------------- 1 | // 2 | // CVWrapper.mm 3 | // CVOpenTemplate 4 | // 5 | // Created by Washe on 02/01/2013. 6 | // Copyright (c) 2013 Washe / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | 15 | #import "CVWrapper.h" 16 | #import "CVCircles.h" 17 | #import "UIImage+OpenCV.h" 18 | 19 | //remove 'magic numbers' from original C++ source so we can manipulate them from obj-C 20 | #define TOLERANCE 0.3 21 | #define THRESHOLD 50 22 | #define LEVELS 9 23 | #define ACCURACY 0 24 | 25 | @implementation CVWrapper 26 | 27 | + (UIImage*) detectedCirclesInImage:(UIImage*) image 28 | { 29 | double dp = 1; 30 | double minDist = 10; 31 | double param1 = 100; 32 | double param2 = 30; 33 | int min_radius = 1; 34 | int max_radius = 30; 35 | 36 | return [[self class] detectedCirclesInImage:image 37 | dp:dp 38 | minDist:minDist 39 | param1:param1 40 | param2:param2 41 | min_radius:min_radius 42 | max_radius:max_radius]; 43 | } 44 | 45 | 46 | + (UIImage*) detectedCirclesInImage:(UIImage*)image 47 | dp:(CGFloat)dp 48 | minDist:(CGFloat)minDist 49 | param2:(CGFloat)param2 50 | 51 | { 52 | double param1 = 100; 53 | int min_radius = 1; 54 | int max_radius = 30; 55 | 56 | return [[self class] detectedCirclesInImage:image 57 | dp:dp 58 | minDist:minDist 59 | param1:param1 60 | param2:param2 61 | min_radius:min_radius 62 | max_radius:max_radius]; 63 | } 64 | 65 | + (UIImage*) detectedCirclesInImage:(UIImage*)image 66 | dp:(CGFloat)dp 67 | minDist:(CGFloat)minDist 68 | param2:(CGFloat)param2 69 | min_radius:(int)min_radius 70 | max_radius:(int)max_radius 71 | { 72 | double param1 = 100; 73 | 74 | return [[self class] detectedCirclesInImage:image 75 | dp:dp 76 | minDist:minDist 77 | param1:param1 78 | param2:param2 79 | min_radius:min_radius 80 | max_radius:max_radius]; 81 | } 82 | 83 | 84 | 85 | + (UIImage*) detectedCirclesInImage:(UIImage*)image 86 | dp:(CGFloat)dp 87 | minDist:(CGFloat)minDist 88 | param1:(CGFloat)param1 89 | param2:(CGFloat)param2 90 | min_radius:(int)min_radius 91 | max_radius:(int)max_radius 92 | { 93 | 94 | UIImage* result = nil; 95 | cv::Mat matImage = [image CVMat]; 96 | matImage = CVCircles::detectedCirclesInImage 97 | (matImage, dp, minDist, param1, param2, min_radius, max_radius); 98 | result = [UIImage imageWithCVMat:matImage]; 99 | return result; 100 | } 101 | 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /OpenCVCircles/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/foundry/OpenCVCircles/70b09d466b2eafa36645c491fc7a8d0dec9dff0c/OpenCVCircles/Default-568h@2x.png -------------------------------------------------------------------------------- /OpenCVCircles/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/foundry/OpenCVCircles/70b09d466b2eafa36645c491fc7a8d0dec9dff0c/OpenCVCircles/Default.png -------------------------------------------------------------------------------- /OpenCVCircles/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/foundry/OpenCVCircles/70b09d466b2eafa36645c491fc7a8d0dec9dff0c/OpenCVCircles/Default@2x.png -------------------------------------------------------------------------------- /OpenCVCircles/OpenCVCircles-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.ellipsis.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | MainStoryboard_iPhone 29 | UIMainStoryboardFile~ipad 30 | MainStoryboard_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /OpenCVCircles/OpenCVCircles-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CVOpenTemplate' target in the 'CVOpenTemplate' 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 | #import 13 | #endif 14 | 15 | #ifdef __OBJC__ 16 | #import 17 | #import 18 | #endif 19 | -------------------------------------------------------------------------------- /OpenCVCircles/UIImage+OpenCV.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+OpenCV.h 3 | // OpenCVClient 4 | // 5 | // Created by JWM on 01/12/2012. 6 | // Copyright 2012 JWM / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | 15 | #import 16 | 17 | @interface UIImage (OpenCV) 18 | 19 | //cv::Mat to UIImage 20 | + (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat; 21 | + (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat 22 | orientation:(UIImageOrientation)orientation; 23 | 24 | - (id)initWithCVMat:(const cv::Mat&)cvMat 25 | orientation:(UIImageOrientation)orientation; 26 | 27 | //UIImage to cv::Mat 28 | - (cv::Mat)CVMat; 29 | - (cv::Mat)CVMat3; // no alpha channel 30 | - (cv::Mat)CVGrayscaleMat; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /OpenCVCircles/UIImage+OpenCV.mm: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+OpenCV.mm 3 | // OpenCVClient 4 | // 5 | // Created by JWM on 01/12/2012. 6 | // Copyright 2012 JWM / Foundry. All rights reserved. 7 | // 8 | // Permission is given to use this source code file without charge in any 9 | // project, commercial or otherwise, entirely at your risk, with the condition 10 | // that any redistribution (in part or whole) of source code must retain 11 | // this copyright and permission notice. Attribution in compiled projects is 12 | // appreciated but not required. 13 | // 14 | // adapted from 15 | // http://docs.opencv.org/doc/tutorials/ios/image_manipulation/image_manipulation.html#opencviosimagemanipulation 16 | 17 | #import "UIImage+OpenCV.h" 18 | 19 | 20 | @implementation UIImage (OpenCV) 21 | 22 | -(cv::Mat)CVMat 23 | { 24 | CGColorSpaceRef colorSpace = CGImageGetColorSpace(self.CGImage); 25 | CGFloat cols; 26 | CGFloat rows; 27 | if (self.imageOrientation == UIImageOrientationLeft 28 | || self.imageOrientation == UIImageOrientationRight) { 29 | cols = self.size.height; 30 | rows = self.size.width; 31 | } else { 32 | cols = self.size.width; 33 | rows = self.size.height; 34 | } 35 | 36 | 37 | cv::Mat cvMat(rows, cols, CV_8UC4); // 8 bits per component, 4 channels 38 | 39 | CGContextRef contextRef = CGBitmapContextCreate(cvMat.data, // Pointer to data 40 | cols, // Width of bitmap 41 | rows, // Height of bitmap 42 | 8, // Bits per component 43 | cvMat.step[0], // Bytes per row 44 | colorSpace, // Colorspace 45 | kCGImageAlphaNoneSkipLast | 46 | kCGBitmapByteOrderDefault); // Bitmap info flags 47 | 48 | CGContextDrawImage(contextRef, CGRectMake(0, 0, cols, rows), self.CGImage); 49 | CGContextRelease(contextRef); 50 | 51 | return cvMat; 52 | } 53 | 54 | - (cv::Mat)CVMat3 55 | { 56 | cv::Mat result = [self CVMat]; 57 | cv::cvtColor(result , result , CV_RGBA2RGB); 58 | return result; 59 | 60 | } 61 | 62 | -(cv::Mat)CVGrayscaleMat 63 | { 64 | //CGColorSpaceRef colorSpace = CGImageGetColorSpace(self.CGImage); 65 | 66 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); 67 | CGFloat cols = self.size.width; 68 | CGFloat rows = self.size.height; 69 | if (self.imageOrientation == UIImageOrientationLeft 70 | || self.imageOrientation == UIImageOrientationRight) { 71 | cols = self.size.height; 72 | rows = self.size.width; 73 | } else { 74 | cols = self.size.width; 75 | rows = self.size.height; 76 | } 77 | cv::Mat cvMat(rows, cols, CV_8UC1); // 8 bits per component, 1 channels 78 | 79 | CGContextRef contextRef = CGBitmapContextCreate(cvMat.data, // Pointer to data 80 | cols, // Width of bitmap 81 | rows, // Height of bitmap 82 | 8, // Bits per component 83 | cvMat.step[0], // Bytes per row 84 | colorSpace, // Colorspace 85 | kCGImageAlphaNone | 86 | kCGBitmapByteOrderDefault); // Bitmap info flags 87 | 88 | CGContextDrawImage(contextRef, CGRectMake(0, 0, cols, rows), self.CGImage); 89 | CGContextRelease(contextRef); 90 | CGColorSpaceRelease(colorSpace); 91 | 92 | return cvMat; 93 | } 94 | 95 | + (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat orientation:(UIImageOrientation)orientation 96 | { 97 | return [[UIImage alloc] initWithCVMat:cvMat orientation:orientation]; 98 | } 99 | 100 | + (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat 101 | { 102 | return [[UIImage alloc] initWithCVMat:cvMat orientation:UIImageOrientationUp]; 103 | } 104 | 105 | 106 | - (id)initWithCVMat:(const cv::Mat&)cvMat orientation:(UIImageOrientation)orientation 107 | { 108 | NSData *data = [NSData dataWithBytes:cvMat.data length:cvMat.elemSize() * cvMat.total()]; 109 | CGColorSpaceRef colorSpace; 110 | 111 | if (cvMat.elemSize() == 1) { 112 | colorSpace = CGColorSpaceCreateDeviceGray(); 113 | } else { 114 | colorSpace = CGColorSpaceCreateDeviceRGB(); 115 | } 116 | 117 | CGDataProviderRef provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data); 118 | 119 | // Creating CGImage from cv::Mat 120 | CGImageRef imageRef = CGImageCreate(cvMat.cols, //width 121 | cvMat.rows, //height 122 | 8, //bits per component 123 | 8 * cvMat.elemSize(), //bits per pixel 124 | cvMat.step[0], //bytesPerRow 125 | colorSpace, //colorspace 126 | kCGImageAlphaNone|kCGBitmapByteOrderDefault,// bitmap info 127 | provider, //CGDataProviderRef 128 | NULL, //decode 129 | false, //should interpolate 130 | kCGRenderingIntentDefault //intent 131 | ); 132 | 133 | // Getting UIImage from CGImage 134 | self = [self initWithCGImage:imageRef scale:1 orientation:orientation]; 135 | CGImageRelease(imageRef); 136 | CGDataProviderRelease(provider); 137 | CGColorSpaceRelease(colorSpace); 138 | 139 | return self; 140 | } 141 | 142 | 143 | 144 | @end 145 | -------------------------------------------------------------------------------- /OpenCVCircles/board.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/foundry/OpenCVCircles/70b09d466b2eafa36645c491fc7a8d0dec9dff0c/OpenCVCircles/board.jpg -------------------------------------------------------------------------------- /OpenCVCircles/circles.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/foundry/OpenCVCircles/70b09d466b2eafa36645c491fc7a8d0dec9dff0c/OpenCVCircles/circles.gif -------------------------------------------------------------------------------- /OpenCVCircles/circles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/foundry/OpenCVCircles/70b09d466b2eafa36645c491fc7a8d0dec9dff0c/OpenCVCircles/circles.jpg -------------------------------------------------------------------------------- /OpenCVCircles/circles2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/foundry/OpenCVCircles/70b09d466b2eafa36645c491fc7a8d0dec9dff0c/OpenCVCircles/circles2.jpg -------------------------------------------------------------------------------- /OpenCVCircles/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /OpenCVCircles/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CVOpenTemplate 4 | // 5 | // Created by Washe on 02/01/2013. 6 | // Copyright (c) 2013 Washe / Foundry. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CVAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CVAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | __OpenCV computer vision with iOS__ 2 | __Hough Circles Demo__ 3 | 4 | Requirements: OSX10.7+ XCode4.4+ iOS5.0+ 5 | 6 | 7 | __integrating openCV and C++ with objective-C__ 8 | 9 | 10 | This is a sample application using openCV in iOS. It adapts the "houghcircles.cpp" sample code included with the openCV distribution. 11 | 12 | 13 | Prompted from some questions on stack overflow: 14 | 15 | 16 | 17 | ======================= 18 | 19 | The aim is to keep the original c++ code as pristine as possible, and to keep the bulk of the work with openCV in pure c++ files for (im)portability. 20 | 21 | __CVViewController.h / CVViewController.m__ 22 | 23 | - pure Objective-C 24 | 25 | - communicates with openCV c++ code via a WRAPPER... it neither knows nor cares that c++ is processing these method calls behind the wrapper. 26 | 27 | __CVWrapper.h / CVWrapper.mm__ 28 | 29 | - objective-C++ 30 | 31 | does as little as possible, really only two things... 32 | 33 | - calls to UIImage objC++ categories to convert to and from UIImage <> cv::Mat 34 | - mediates between CVViewController's obj-C methods and CVSquares c++ (class) function calls 35 | 36 | 37 | __CVCircles.h / CVCircles.cpp__ 38 | 39 | - pure C++ 40 | - `CVCircles.cpp` declares public functions inside a class definition (in this case, one static function). 41 | This replaces the work of `main{}` in the original file. 42 | - We try to keep `CVCircles.cpp` as close as possible to the C++ original for portability. 43 | 44 | 45 | __UIImage+OpenCV__ 46 | 47 | This UIImage category is an objC++ file containing the code to convert between UIImage and cv::Mat image formats. 48 | 49 | -------------------------------------------------------------------------------- /opencv2.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/A/Headers -------------------------------------------------------------------------------- /opencv2.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/A/Resources -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/contrib/detection_based_tracker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | namespace cv 11 | { 12 | class DetectionBasedTracker 13 | { 14 | public: 15 | struct Parameters 16 | { 17 | int maxTrackLifetime; 18 | int minDetectionPeriod; //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0 19 | 20 | Parameters(); 21 | }; 22 | 23 | class IDetector 24 | { 25 | public: 26 | IDetector(): 27 | minObjSize(96, 96), 28 | maxObjSize(INT_MAX, INT_MAX), 29 | minNeighbours(2), 30 | scaleFactor(1.1f) 31 | {} 32 | 33 | virtual void detect(const cv::Mat& image, std::vector& objects) = 0; 34 | 35 | void setMinObjectSize(const cv::Size& min) 36 | { 37 | minObjSize = min; 38 | } 39 | void setMaxObjectSize(const cv::Size& max) 40 | { 41 | maxObjSize = max; 42 | } 43 | cv::Size getMinObjectSize() const 44 | { 45 | return minObjSize; 46 | } 47 | cv::Size getMaxObjectSize() const 48 | { 49 | return maxObjSize; 50 | } 51 | float getScaleFactor() 52 | { 53 | return scaleFactor; 54 | } 55 | void setScaleFactor(float value) 56 | { 57 | scaleFactor = value; 58 | } 59 | int getMinNeighbours() 60 | { 61 | return minNeighbours; 62 | } 63 | void setMinNeighbours(int value) 64 | { 65 | minNeighbours = value; 66 | } 67 | virtual ~IDetector() {} 68 | 69 | protected: 70 | cv::Size minObjSize; 71 | cv::Size maxObjSize; 72 | int minNeighbours; 73 | float scaleFactor; 74 | }; 75 | 76 | DetectionBasedTracker(cv::Ptr mainDetector, cv::Ptr trackingDetector, const Parameters& params); 77 | virtual ~DetectionBasedTracker(); 78 | 79 | virtual bool run(); 80 | virtual void stop(); 81 | virtual void resetTracking(); 82 | 83 | virtual void process(const cv::Mat& imageGray); 84 | 85 | bool setParameters(const Parameters& params); 86 | const Parameters& getParameters() const; 87 | 88 | 89 | typedef std::pair Object; 90 | virtual void getObjects(std::vector& result) const; 91 | virtual void getObjects(std::vector& result) const; 92 | 93 | enum ObjectStatus 94 | { 95 | DETECTED_NOT_SHOWN_YET, 96 | DETECTED, 97 | DETECTED_TEMPORARY_LOST, 98 | WRONG_OBJECT 99 | }; 100 | struct ExtObject 101 | { 102 | int id; 103 | cv::Rect location; 104 | ObjectStatus status; 105 | ExtObject(int _id, cv::Rect _location, ObjectStatus _status) 106 | :id(_id), location(_location), status(_status) 107 | { 108 | } 109 | }; 110 | virtual void getObjects(std::vector& result) const; 111 | 112 | 113 | virtual int addObject(const cv::Rect& location); //returns id of the new object 114 | 115 | protected: 116 | class SeparateDetectionWork; 117 | cv::Ptr separateDetectionWork; 118 | friend void* workcycleObjectDetectorFunction(void* p); 119 | 120 | struct InnerParameters 121 | { 122 | int numLastPositionsToTrack; 123 | int numStepsToWaitBeforeFirstShow; 124 | int numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown; 125 | int numStepsToShowWithoutDetecting; 126 | 127 | float coeffTrackingWindowSize; 128 | float coeffObjectSizeToTrack; 129 | float coeffObjectSpeedUsingInPrediction; 130 | 131 | InnerParameters(); 132 | }; 133 | Parameters parameters; 134 | InnerParameters innerParameters; 135 | 136 | struct TrackedObject 137 | { 138 | typedef std::vector PositionsVector; 139 | 140 | PositionsVector lastPositions; 141 | 142 | int numDetectedFrames; 143 | int numFramesNotDetected; 144 | int id; 145 | 146 | TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0) 147 | { 148 | lastPositions.push_back(rect); 149 | id=getNextId(); 150 | }; 151 | 152 | static int getNextId() 153 | { 154 | static int _id=0; 155 | return _id++; 156 | } 157 | }; 158 | 159 | int numTrackedSteps; 160 | std::vector trackedObjects; 161 | 162 | std::vector weightsPositionsSmoothing; 163 | std::vector weightsSizesSmoothing; 164 | 165 | cv::Ptr cascadeForTracking; 166 | 167 | void updateTrackedObjects(const std::vector& detectedObjects); 168 | cv::Rect calcTrackedObjectPositionToShow(int i) const; 169 | cv::Rect calcTrackedObjectPositionToShow(int i, ObjectStatus& status) const; 170 | void detectInRegion(const cv::Mat& img, const cv::Rect& r, std::vector& detectedObjectsInRegions); 171 | }; 172 | } //end of cv namespace 173 | #endif 174 | -------------------------------------------------------------------------------- /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 | // 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 Intel Corporation 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 Intel Corporation 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 | /* 43 | definition of the current version of OpenCV 44 | Usefull to test in user programs 45 | */ 46 | 47 | #ifndef __OPENCV_VERSION_HPP__ 48 | #define __OPENCV_VERSION_HPP__ 49 | 50 | #define CV_MAJOR_VERSION 2 51 | #define CV_MINOR_VERSION 4 52 | #define CV_SUBMINOR_VERSION 9 53 | 54 | #define CVAUX_STR_EXP(__A) #__A 55 | #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) 56 | #define CV_VERSION CVAUX_STR(CV_MAJOR_VERSION) "." CVAUX_STR(CV_MINOR_VERSION) "." CVAUX_STR(CV_SUBMINOR_VERSION) 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /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/defines.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_DEFINES_H_ 31 | #define OPENCV_FLANN_DEFINES_H_ 32 | 33 | #include "config.h" 34 | 35 | #ifdef FLANN_EXPORT 36 | #undef FLANN_EXPORT 37 | #endif 38 | #ifdef WIN32 39 | /* win32 dll export/import directives */ 40 | #ifdef FLANN_EXPORTS 41 | #define FLANN_EXPORT __declspec(dllexport) 42 | #elif defined(FLANN_STATIC) 43 | #define FLANN_EXPORT 44 | #else 45 | #define FLANN_EXPORT __declspec(dllimport) 46 | #endif 47 | #else 48 | /* unix needs nothing */ 49 | #define FLANN_EXPORT 50 | #endif 51 | 52 | 53 | #ifdef FLANN_DEPRECATED 54 | #undef FLANN_DEPRECATED 55 | #endif 56 | #ifdef __GNUC__ 57 | #define FLANN_DEPRECATED __attribute__ ((deprecated)) 58 | #elif defined(_MSC_VER) 59 | #define FLANN_DEPRECATED __declspec(deprecated) 60 | #else 61 | #pragma message("WARNING: You need to implement FLANN_DEPRECATED for this compiler") 62 | #define FLANN_DEPRECATED 63 | #endif 64 | 65 | 66 | #undef FLANN_PLATFORM_32_BIT 67 | #undef FLANN_PLATFORM_64_BIT 68 | #if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64 69 | #define FLANN_PLATFORM_64_BIT 70 | #else 71 | #define FLANN_PLATFORM_32_BIT 72 | #endif 73 | 74 | 75 | #undef FLANN_ARRAY_LEN 76 | #define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0])) 77 | 78 | namespace cvflann { 79 | 80 | /* Nearest neighbour index algorithms */ 81 | enum flann_algorithm_t 82 | { 83 | FLANN_INDEX_LINEAR = 0, 84 | FLANN_INDEX_KDTREE = 1, 85 | FLANN_INDEX_KMEANS = 2, 86 | FLANN_INDEX_COMPOSITE = 3, 87 | FLANN_INDEX_KDTREE_SINGLE = 4, 88 | FLANN_INDEX_HIERARCHICAL = 5, 89 | FLANN_INDEX_LSH = 6, 90 | FLANN_INDEX_SAVED = 254, 91 | FLANN_INDEX_AUTOTUNED = 255, 92 | 93 | // deprecated constants, should use the FLANN_INDEX_* ones instead 94 | LINEAR = 0, 95 | KDTREE = 1, 96 | KMEANS = 2, 97 | COMPOSITE = 3, 98 | KDTREE_SINGLE = 4, 99 | SAVED = 254, 100 | AUTOTUNED = 255 101 | }; 102 | 103 | 104 | 105 | enum flann_centers_init_t 106 | { 107 | FLANN_CENTERS_RANDOM = 0, 108 | FLANN_CENTERS_GONZALES = 1, 109 | FLANN_CENTERS_KMEANSPP = 2, 110 | 111 | // deprecated constants, should use the FLANN_CENTERS_* ones instead 112 | CENTERS_RANDOM = 0, 113 | CENTERS_GONZALES = 1, 114 | CENTERS_KMEANSPP = 2 115 | }; 116 | 117 | enum flann_log_level_t 118 | { 119 | FLANN_LOG_NONE = 0, 120 | FLANN_LOG_FATAL = 1, 121 | FLANN_LOG_ERROR = 2, 122 | FLANN_LOG_WARN = 3, 123 | FLANN_LOG_INFO = 4 124 | }; 125 | 126 | enum flann_distance_t 127 | { 128 | FLANN_DIST_EUCLIDEAN = 1, 129 | FLANN_DIST_L2 = 1, 130 | FLANN_DIST_MANHATTAN = 2, 131 | FLANN_DIST_L1 = 2, 132 | FLANN_DIST_MINKOWSKI = 3, 133 | FLANN_DIST_MAX = 4, 134 | FLANN_DIST_HIST_INTERSECT = 5, 135 | FLANN_DIST_HELLINGER = 6, 136 | FLANN_DIST_CHI_SQUARE = 7, 137 | FLANN_DIST_CS = 7, 138 | FLANN_DIST_KULLBACK_LEIBLER = 8, 139 | FLANN_DIST_KL = 8, 140 | FLANN_DIST_HAMMING = 9, 141 | 142 | // deprecated constants, should use the FLANN_DIST_* ones instead 143 | EUCLIDEAN = 1, 144 | MANHATTAN = 2, 145 | MINKOWSKI = 3, 146 | MAX_DIST = 4, 147 | HIST_INTERSECT = 5, 148 | HELLINGER = 6, 149 | CS = 7, 150 | KL = 8, 151 | KULLBACK_LEIBLER = 8 152 | }; 153 | 154 | enum flann_datatype_t 155 | { 156 | FLANN_INT8 = 0, 157 | FLANN_INT16 = 1, 158 | FLANN_INT32 = 2, 159 | FLANN_INT64 = 3, 160 | FLANN_UINT8 = 4, 161 | FLANN_UINT16 = 5, 162 | FLANN_UINT32 = 6, 163 | FLANN_UINT64 = 7, 164 | FLANN_FLOAT32 = 8, 165 | FLANN_FLOAT64 = 9 166 | }; 167 | 168 | enum 169 | { 170 | FLANN_CHECKS_UNLIMITED = -1, 171 | FLANN_CHECKS_AUTOTUNED = -2 172 | }; 173 | 174 | } 175 | 176 | #endif /* OPENCV_FLANN_DEFINES_H_ */ 177 | -------------------------------------------------------------------------------- /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/dynamic_bitset.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 | /*********************************************************************** 32 | * Author: Vincent Rabaud 33 | *************************************************************************/ 34 | 35 | #ifndef OPENCV_FLANN_DYNAMIC_BITSET_H_ 36 | #define OPENCV_FLANN_DYNAMIC_BITSET_H_ 37 | 38 | #ifndef FLANN_USE_BOOST 39 | # define FLANN_USE_BOOST 0 40 | #endif 41 | //#define FLANN_USE_BOOST 1 42 | #if FLANN_USE_BOOST 43 | #include 44 | typedef boost::dynamic_bitset<> DynamicBitset; 45 | #else 46 | 47 | #include 48 | 49 | #include "dist.h" 50 | 51 | namespace cvflann { 52 | 53 | /** Class re-implementing the boost version of it 54 | * This helps not depending on boost, it also does not do the bound checks 55 | * and has a way to reset a block for speed 56 | */ 57 | class DynamicBitset 58 | { 59 | public: 60 | /** @param default constructor 61 | */ 62 | DynamicBitset() 63 | { 64 | } 65 | 66 | /** @param only constructor we use in our code 67 | * @param the size of the bitset (in bits) 68 | */ 69 | DynamicBitset(size_t sz) 70 | { 71 | resize(sz); 72 | reset(); 73 | } 74 | 75 | /** Sets all the bits to 0 76 | */ 77 | void clear() 78 | { 79 | std::fill(bitset_.begin(), bitset_.end(), 0); 80 | } 81 | 82 | /** @brief checks if the bitset is empty 83 | * @return true if the bitset is empty 84 | */ 85 | bool empty() const 86 | { 87 | return bitset_.empty(); 88 | } 89 | 90 | /** @param set all the bits to 0 91 | */ 92 | void reset() 93 | { 94 | std::fill(bitset_.begin(), bitset_.end(), 0); 95 | } 96 | 97 | /** @brief set one bit to 0 98 | * @param 99 | */ 100 | void reset(size_t index) 101 | { 102 | bitset_[index / cell_bit_size_] &= ~(size_t(1) << (index % cell_bit_size_)); 103 | } 104 | 105 | /** @brief sets a specific bit to 0, and more bits too 106 | * This function is useful when resetting a given set of bits so that the 107 | * whole bitset ends up being 0: if that's the case, we don't care about setting 108 | * other bits to 0 109 | * @param 110 | */ 111 | void reset_block(size_t index) 112 | { 113 | bitset_[index / cell_bit_size_] = 0; 114 | } 115 | 116 | /** @param resize the bitset so that it contains at least size bits 117 | * @param size 118 | */ 119 | void resize(size_t sz) 120 | { 121 | size_ = sz; 122 | bitset_.resize(sz / cell_bit_size_ + 1); 123 | } 124 | 125 | /** @param set a bit to true 126 | * @param index the index of the bit to set to 1 127 | */ 128 | void set(size_t index) 129 | { 130 | bitset_[index / cell_bit_size_] |= size_t(1) << (index % cell_bit_size_); 131 | } 132 | 133 | /** @param gives the number of contained bits 134 | */ 135 | size_t size() const 136 | { 137 | return size_; 138 | } 139 | 140 | /** @param check if a bit is set 141 | * @param index the index of the bit to check 142 | * @return true if the bit is set 143 | */ 144 | bool test(size_t index) const 145 | { 146 | return (bitset_[index / cell_bit_size_] & (size_t(1) << (index % cell_bit_size_))) != 0; 147 | } 148 | 149 | private: 150 | std::vector bitset_; 151 | size_t size_; 152 | static const unsigned int cell_bit_size_ = CHAR_BIT * sizeof(size_t); 153 | }; 154 | 155 | } // namespace cvflann 156 | 157 | #endif 158 | 159 | #endif // OPENCV_FLANN_DYNAMIC_BITSET_H_ 160 | -------------------------------------------------------------------------------- /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 "defines.h" 35 | #include 36 | #include 37 | 38 | namespace cvflann 39 | { 40 | 41 | class FLANNException : public std::runtime_error 42 | { 43 | public: 44 | FLANNException(const char* message) : std::runtime_error(message) { } 45 | 46 | FLANNException(const std::string& message) : std::runtime_error(message) { } 47 | }; 48 | 49 | } 50 | 51 | 52 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 53 | -------------------------------------------------------------------------------- /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::ElementType ElementType; 46 | typedef typename Distance::ResultType DistanceType; 47 | int n = nn + skip; 48 | 49 | std::vector match(n); 50 | std::vector dists(n); 51 | 52 | dists[0] = distance(dataset[0], query, dataset.cols); 53 | match[0] = 0; 54 | int dcnt = 1; 55 | 56 | for (size_t i=1; i=1 && dists[j] 84 | void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, 85 | int skip=0, Distance d = Distance()) 86 | { 87 | for (size_t i=0; i(dataset, testset[i], matches[i], (int)matches.cols, skip, d); 89 | } 90 | } 91 | 92 | 93 | } 94 | 95 | #endif //OPENCV_FLANN_GROUND_TRUTH_H_ 96 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/heap.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_HEAP_H_ 32 | #define OPENCV_FLANN_HEAP_H_ 33 | 34 | #include 35 | #include 36 | 37 | namespace cvflann 38 | { 39 | 40 | /** 41 | * Priority Queue Implementation 42 | * 43 | * The priority queue is implemented with a heap. A heap is a complete 44 | * (full) binary tree in which each parent is less than both of its 45 | * children, but the order of the children is unspecified. 46 | */ 47 | template 48 | class Heap 49 | { 50 | 51 | /** 52 | * Storage array for the heap. 53 | * Type T must be comparable. 54 | */ 55 | std::vector heap; 56 | int length; 57 | 58 | /** 59 | * Number of element in the heap 60 | */ 61 | int count; 62 | 63 | 64 | 65 | public: 66 | /** 67 | * Constructor. 68 | * 69 | * Params: 70 | * sz = heap size 71 | */ 72 | 73 | Heap(int sz) 74 | { 75 | length = sz; 76 | heap.reserve(length); 77 | count = 0; 78 | } 79 | 80 | /** 81 | * 82 | * Returns: heap size 83 | */ 84 | int size() 85 | { 86 | return count; 87 | } 88 | 89 | /** 90 | * Tests if the heap is empty 91 | * 92 | * Returns: true is heap empty, false otherwise 93 | */ 94 | bool empty() 95 | { 96 | return size()==0; 97 | } 98 | 99 | /** 100 | * Clears the heap. 101 | */ 102 | void clear() 103 | { 104 | heap.clear(); 105 | count = 0; 106 | } 107 | 108 | struct CompareT 109 | { 110 | bool operator()(const T& t_1, const T& t_2) const 111 | { 112 | return t_2 < t_1; 113 | } 114 | }; 115 | 116 | /** 117 | * Insert a new element in the heap. 118 | * 119 | * We select the next empty leaf node, and then keep moving any larger 120 | * parents down until the right location is found to store this element. 121 | * 122 | * Params: 123 | * value = the new element to be inserted in the heap 124 | */ 125 | void insert(T value) 126 | { 127 | /* If heap is full, then return without adding this element. */ 128 | if (count == length) { 129 | return; 130 | } 131 | 132 | heap.push_back(value); 133 | static CompareT compareT; 134 | std::push_heap(heap.begin(), heap.end(), compareT); 135 | ++count; 136 | } 137 | 138 | 139 | 140 | /** 141 | * Returns the node of minimum value from the heap (top of the heap). 142 | * 143 | * Params: 144 | * value = out parameter used to return the min element 145 | * Returns: false if heap empty 146 | */ 147 | bool popMin(T& value) 148 | { 149 | if (count == 0) { 150 | return false; 151 | } 152 | 153 | value = heap[0]; 154 | static CompareT compareT; 155 | std::pop_heap(heap.begin(), heap.end(), compareT); 156 | heap.pop_back(); 157 | --count; 158 | 159 | return true; /* Return old last node. */ 160 | } 161 | }; 162 | 163 | } 164 | 165 | #endif //OPENCV_FLANN_HEAP_H_ 166 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/linear_index.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_LINEAR_INDEX_H_ 32 | #define OPENCV_FLANN_LINEAR_INDEX_H_ 33 | 34 | #include "general.h" 35 | #include "nn_index.h" 36 | 37 | namespace cvflann 38 | { 39 | 40 | struct LinearIndexParams : public IndexParams 41 | { 42 | LinearIndexParams() 43 | { 44 | (* this)["algorithm"] = FLANN_INDEX_LINEAR; 45 | } 46 | }; 47 | 48 | template 49 | class LinearIndex : public NNIndex 50 | { 51 | public: 52 | 53 | typedef typename Distance::ElementType ElementType; 54 | typedef typename Distance::ResultType DistanceType; 55 | 56 | 57 | LinearIndex(const Matrix& inputData, const IndexParams& params = LinearIndexParams(), 58 | Distance d = Distance()) : 59 | dataset_(inputData), index_params_(params), distance_(d) 60 | { 61 | } 62 | 63 | LinearIndex(const LinearIndex&); 64 | LinearIndex& operator=(const LinearIndex&); 65 | 66 | flann_algorithm_t getType() const 67 | { 68 | return FLANN_INDEX_LINEAR; 69 | } 70 | 71 | 72 | size_t size() const 73 | { 74 | return dataset_.rows; 75 | } 76 | 77 | size_t veclen() const 78 | { 79 | return dataset_.cols; 80 | } 81 | 82 | 83 | int usedMemory() const 84 | { 85 | return 0; 86 | } 87 | 88 | void buildIndex() 89 | { 90 | /* nothing to do here for linear search */ 91 | } 92 | 93 | void saveIndex(FILE*) 94 | { 95 | /* nothing to do here for linear search */ 96 | } 97 | 98 | 99 | void loadIndex(FILE*) 100 | { 101 | /* nothing to do here for linear search */ 102 | 103 | index_params_["algorithm"] = getType(); 104 | } 105 | 106 | void findNeighbors(ResultSet& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) 107 | { 108 | ElementType* data = dataset_.data; 109 | for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) { 110 | DistanceType dist = distance_(data, vec, dataset_.cols); 111 | resultSet.addPoint(dist, (int)i); 112 | } 113 | } 114 | 115 | IndexParams getParameters() const 116 | { 117 | return index_params_; 118 | } 119 | 120 | private: 121 | /** The dataset */ 122 | const Matrix dataset_; 123 | /** Index parameters */ 124 | IndexParams index_params_; 125 | /** Index distance */ 126 | Distance distance_; 127 | 128 | }; 129 | 130 | } 131 | 132 | #endif // OPENCV_FLANN_LINEAR_INDEX_H_ 133 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/logger.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_LOGGER_H 32 | #define OPENCV_FLANN_LOGGER_H 33 | 34 | #include 35 | #include 36 | 37 | #include "defines.h" 38 | 39 | 40 | namespace cvflann 41 | { 42 | 43 | class Logger 44 | { 45 | Logger() : stream(stdout), logLevel(FLANN_LOG_WARN) {} 46 | 47 | ~Logger() 48 | { 49 | if ((stream!=NULL)&&(stream!=stdout)) { 50 | fclose(stream); 51 | } 52 | } 53 | 54 | static Logger& instance() 55 | { 56 | static Logger logger; 57 | return logger; 58 | } 59 | 60 | void _setDestination(const char* name) 61 | { 62 | if (name==NULL) { 63 | stream = stdout; 64 | } 65 | else { 66 | stream = fopen(name,"w"); 67 | if (stream == NULL) { 68 | stream = stdout; 69 | } 70 | } 71 | } 72 | 73 | int _log(int level, const char* fmt, va_list arglist) 74 | { 75 | if (level > logLevel ) return -1; 76 | int ret = vfprintf(stream, fmt, arglist); 77 | return ret; 78 | } 79 | 80 | public: 81 | /** 82 | * Sets the logging level. All messages with lower priority will be ignored. 83 | * @param level Logging level 84 | */ 85 | static void setLevel(int level) { instance().logLevel = level; } 86 | 87 | /** 88 | * Sets the logging destination 89 | * @param name Filename or NULL for console 90 | */ 91 | static void setDestination(const char* name) { instance()._setDestination(name); } 92 | 93 | /** 94 | * Print log message 95 | * @param level Log level 96 | * @param fmt Message format 97 | * @return 98 | */ 99 | static int log(int level, const char* fmt, ...) 100 | { 101 | va_list arglist; 102 | va_start(arglist, fmt); 103 | int ret = instance()._log(level,fmt,arglist); 104 | va_end(arglist); 105 | return ret; 106 | } 107 | 108 | #define LOG_METHOD(NAME,LEVEL) \ 109 | static int NAME(const char* fmt, ...) \ 110 | { \ 111 | va_list ap; \ 112 | va_start(ap, fmt); \ 113 | int ret = instance()._log(LEVEL, fmt, ap); \ 114 | va_end(ap); \ 115 | return ret; \ 116 | } 117 | 118 | LOG_METHOD(fatal, FLANN_LOG_FATAL) 119 | LOG_METHOD(error, FLANN_LOG_ERROR) 120 | LOG_METHOD(warn, FLANN_LOG_WARN) 121 | LOG_METHOD(info, FLANN_LOG_INFO) 122 | 123 | private: 124 | FILE* stream; 125 | int logLevel; 126 | }; 127 | 128 | } 129 | 130 | #endif //OPENCV_FLANN_LOGGER_H 131 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/matrix.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_DATASET_H_ 32 | #define OPENCV_FLANN_DATASET_H_ 33 | 34 | #include 35 | 36 | #include "general.h" 37 | 38 | namespace cvflann 39 | { 40 | 41 | /** 42 | * Class that implements a simple rectangular matrix stored in a memory buffer and 43 | * provides convenient matrix-like access using the [] operators. 44 | */ 45 | template 46 | class Matrix 47 | { 48 | public: 49 | typedef T type; 50 | 51 | size_t rows; 52 | size_t cols; 53 | size_t stride; 54 | T* data; 55 | 56 | Matrix() : rows(0), cols(0), stride(0), data(NULL) 57 | { 58 | } 59 | 60 | Matrix(T* data_, size_t rows_, size_t cols_, size_t stride_ = 0) : 61 | rows(rows_), cols(cols_), stride(stride_), data(data_) 62 | { 63 | if (stride==0) stride = cols; 64 | } 65 | 66 | /** 67 | * Convenience function for deallocating the storage data. 68 | */ 69 | FLANN_DEPRECATED void free() 70 | { 71 | fprintf(stderr, "The cvflann::Matrix::free() method is deprecated " 72 | "and it does not do any memory deallocation any more. You are" 73 | "responsible for deallocating the matrix memory (by doing" 74 | "'delete[] matrix.data' for example)"); 75 | } 76 | 77 | /** 78 | * Operator that return a (pointer to a) row of the data. 79 | */ 80 | T* operator[](size_t index) const 81 | { 82 | return data+index*stride; 83 | } 84 | }; 85 | 86 | 87 | class UntypedMatrix 88 | { 89 | public: 90 | size_t rows; 91 | size_t cols; 92 | void* data; 93 | flann_datatype_t type; 94 | 95 | UntypedMatrix(void* data_, long rows_, long cols_) : 96 | rows(rows_), cols(cols_), data(data_) 97 | { 98 | } 99 | 100 | ~UntypedMatrix() 101 | { 102 | } 103 | 104 | 105 | template 106 | Matrix as() 107 | { 108 | return Matrix((T*)data, rows, cols); 109 | } 110 | }; 111 | 112 | 113 | 114 | } 115 | 116 | #endif //OPENCV_FLANN_DATASET_H_ 117 | -------------------------------------------------------------------------------- /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, std::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, std::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(std::string("Missing parameter '")+name+std::string("' in the parameters given")); 79 | } 80 | } 81 | 82 | inline void print_params(const IndexParams& params) 83 | { 84 | IndexParams::const_iterator it; 85 | 86 | for(it=params.begin(); it!=params.end(); ++it) { 87 | std::cout << it->first << " : " << it->second << std::endl; 88 | } 89 | } 90 | 91 | 92 | 93 | } 94 | 95 | 96 | #endif /* OPENCV_FLANN_PARAMS_H_ */ 97 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/random.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_RANDOM_H 32 | #define OPENCV_FLANN_RANDOM_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include "general.h" 39 | 40 | namespace cvflann 41 | { 42 | 43 | /** 44 | * Seeds the random number generator 45 | * @param seed Random seed 46 | */ 47 | inline void seed_random(unsigned int seed) 48 | { 49 | srand(seed); 50 | } 51 | 52 | /* 53 | * Generates a random double value. 54 | */ 55 | /** 56 | * Generates a random double value. 57 | * @param high Upper limit 58 | * @param low Lower limit 59 | * @return Random double value 60 | */ 61 | inline double rand_double(double high = 1.0, double low = 0) 62 | { 63 | return low + ((high-low) * (std::rand() / (RAND_MAX + 1.0))); 64 | } 65 | 66 | /** 67 | * Generates a random integer value. 68 | * @param high Upper limit 69 | * @param low Lower limit 70 | * @return Random integer value 71 | */ 72 | inline int rand_int(int high = RAND_MAX, int low = 0) 73 | { 74 | return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0))); 75 | } 76 | 77 | /** 78 | * Random number generator that returns a distinct number from 79 | * the [0,n) interval each time. 80 | */ 81 | class UniqueRandom 82 | { 83 | std::vector vals_; 84 | int size_; 85 | int counter_; 86 | 87 | public: 88 | /** 89 | * Constructor. 90 | * @param n Size of the interval from which to generate 91 | * @return 92 | */ 93 | UniqueRandom(int n) 94 | { 95 | init(n); 96 | } 97 | 98 | /** 99 | * Initializes the number generator. 100 | * @param n the size of the interval from which to generate random numbers. 101 | */ 102 | void init(int n) 103 | { 104 | // create and initialize an array of size n 105 | vals_.resize(n); 106 | size_ = n; 107 | for (int i = 0; i < size_; ++i) vals_[i] = i; 108 | 109 | // shuffle the elements in the array 110 | std::random_shuffle(vals_.begin(), vals_.end()); 111 | 112 | counter_ = 0; 113 | } 114 | 115 | /** 116 | * Return a distinct random integer in greater or equal to 0 and less 117 | * than 'n' on each call. It should be called maximum 'n' times. 118 | * Returns: a random integer 119 | */ 120 | int next() 121 | { 122 | if (counter_ == size_) { 123 | return -1; 124 | } 125 | else { 126 | return vals_[counter_++]; 127 | } 128 | } 129 | }; 130 | 131 | } 132 | 133 | #endif //OPENCV_FLANN_RANDOM_H 134 | 135 | 136 | -------------------------------------------------------------------------------- /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 41 | void addValue(int pos, float val, float* vals, T* point, T* points, int n) 42 | { 43 | vals[pos] = val; 44 | for (int i=0; i0 && vals[j] 69 | float optimizeSimplexDownhill(T* points, int n, F func, float* vals = NULL ) 70 | { 71 | const int MAX_ITERATIONS = 10; 72 | 73 | assert(n>0); 74 | 75 | T* p_o = new T[n]; 76 | T* p_r = new T[n]; 77 | T* p_e = new T[n]; 78 | 79 | int alpha = 1; 80 | 81 | int iterations = 0; 82 | 83 | bool ownVals = false; 84 | if (vals == NULL) { 85 | ownVals = true; 86 | vals = new float[n+1]; 87 | for (int i=0; i MAX_ITERATIONS) break; 97 | 98 | // compute average of simplex points (except the highest point) 99 | for (int j=0; j=vals[0])&&(val_r=vals[n]) { 151 | for (int i=0; i 35 | #include "opencv2/core/core.hpp" 36 | 37 | namespace cvflann 38 | { 39 | 40 | /** 41 | * A start-stop timer class. 42 | * 43 | * Can be used to time portions of code. 44 | */ 45 | class StartStopTimer 46 | { 47 | int64 startTime; 48 | 49 | public: 50 | /** 51 | * Value of the timer. 52 | */ 53 | double value; 54 | 55 | 56 | /** 57 | * Constructor. 58 | */ 59 | StartStopTimer() 60 | { 61 | reset(); 62 | } 63 | 64 | /** 65 | * Starts the timer. 66 | */ 67 | void start() 68 | { 69 | startTime = cv::getTickCount(); 70 | } 71 | 72 | /** 73 | * Stops the timer and updates timer value. 74 | */ 75 | void stop() 76 | { 77 | int64 stopTime = cv::getTickCount(); 78 | value += ( (double)stopTime - startTime) / cv::getTickFrequency(); 79 | } 80 | 81 | /** 82 | * Resets the timer value to 0. 83 | */ 84 | void reset() 85 | { 86 | value = 0; 87 | } 88 | 89 | }; 90 | 91 | } 92 | 93 | #endif // FLANN_TIMER_H 94 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/highgui/cap_ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cap_ios.h 3 | * For iOS video I/O 4 | * by Eduard Feicho on 29/07/12 5 | * Copyright 2012. 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 are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 21 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | */ 30 | 31 | #import 32 | #import 33 | #import 34 | #import 35 | #include "opencv2/core/core.hpp" 36 | 37 | /////////////////////////////////////// CvAbstractCamera ///////////////////////////////////// 38 | 39 | @class CvAbstractCamera; 40 | 41 | @interface CvAbstractCamera : NSObject 42 | { 43 | AVCaptureSession* captureSession; 44 | AVCaptureConnection* videoCaptureConnection; 45 | AVCaptureVideoPreviewLayer *captureVideoPreviewLayer; 46 | 47 | UIDeviceOrientation currentDeviceOrientation; 48 | 49 | BOOL cameraAvailable; 50 | BOOL captureSessionLoaded; 51 | BOOL running; 52 | BOOL useAVCaptureVideoPreviewLayer; 53 | 54 | AVCaptureDevicePosition defaultAVCaptureDevicePosition; 55 | AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; 56 | NSString *const defaultAVCaptureSessionPreset; 57 | 58 | int defaultFPS; 59 | 60 | UIView* parentView; 61 | 62 | int imageWidth; 63 | int imageHeight; 64 | } 65 | 66 | @property (nonatomic, retain) AVCaptureSession* captureSession; 67 | @property (nonatomic, retain) AVCaptureConnection* videoCaptureConnection; 68 | 69 | @property (nonatomic, readonly) BOOL running; 70 | @property (nonatomic, readonly) BOOL captureSessionLoaded; 71 | 72 | @property (nonatomic, assign) int defaultFPS; 73 | @property (nonatomic, assign) AVCaptureDevicePosition defaultAVCaptureDevicePosition; 74 | @property (nonatomic, assign) AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; 75 | @property (nonatomic, assign) BOOL useAVCaptureVideoPreviewLayer; 76 | @property (nonatomic, strong) NSString *const defaultAVCaptureSessionPreset; 77 | 78 | @property (nonatomic, assign) int imageWidth; 79 | @property (nonatomic, assign) int imageHeight; 80 | 81 | @property (nonatomic, retain) UIView* parentView; 82 | 83 | - (void)start; 84 | - (void)stop; 85 | - (void)switchCameras; 86 | 87 | - (id)initWithParentView:(UIView*)parent; 88 | 89 | - (void)createCaptureOutput; 90 | - (void)createVideoPreviewLayer; 91 | - (void)updateOrientation; 92 | 93 | 94 | @end 95 | 96 | ///////////////////////////////// CvVideoCamera /////////////////////////////////////////// 97 | 98 | @class CvVideoCamera; 99 | 100 | @protocol CvVideoCameraDelegate 101 | 102 | #ifdef __cplusplus 103 | // delegate method for processing image frames 104 | - (void)processImage:(cv::Mat&)image; 105 | #endif 106 | 107 | @end 108 | 109 | @interface CvVideoCamera : CvAbstractCamera 110 | { 111 | AVCaptureVideoDataOutput *videoDataOutput; 112 | 113 | dispatch_queue_t videoDataOutputQueue; 114 | CALayer *customPreviewLayer; 115 | 116 | BOOL grayscaleMode; 117 | 118 | BOOL recordVideo; 119 | AVAssetWriterInput* recordAssetWriterInput; 120 | AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; 121 | AVAssetWriter* recordAssetWriter; 122 | 123 | CMTime lastSampleTime; 124 | 125 | } 126 | 127 | @property (nonatomic, assign) id delegate; 128 | @property (nonatomic, assign) BOOL grayscaleMode; 129 | 130 | @property (nonatomic, assign) BOOL recordVideo; 131 | @property (nonatomic, retain) AVAssetWriterInput* recordAssetWriterInput; 132 | @property (nonatomic, retain) AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; 133 | @property (nonatomic, retain) AVAssetWriter* recordAssetWriter; 134 | 135 | - (void)adjustLayoutToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; 136 | - (void)layoutPreviewLayer; 137 | - (void)saveVideo; 138 | - (NSURL *)videoFileURL; 139 | 140 | 141 | @end 142 | 143 | ///////////////////////////////// CvPhotoCamera /////////////////////////////////////////// 144 | 145 | @class CvPhotoCamera; 146 | 147 | @protocol CvPhotoCameraDelegate 148 | 149 | - (void)photoCamera:(CvPhotoCamera*)photoCamera capturedImage:(UIImage *)image; 150 | - (void)photoCameraCancel:(CvPhotoCamera*)photoCamera; 151 | 152 | @end 153 | 154 | @interface CvPhotoCamera : CvAbstractCamera 155 | { 156 | AVCaptureStillImageOutput *stillImageOutput; 157 | } 158 | 159 | @property (nonatomic, assign) id delegate; 160 | 161 | - (void)takePicture; 162 | 163 | @end 164 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/legacy/streams.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 | // 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 Intel Corporation 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 Intel Corporation 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_CVSTREAMS_H__ 43 | #define __OPENCV_CVSTREAMS_H__ 44 | 45 | #ifdef WIN32 46 | #include /* !!! IF YOU'VE GOT AN ERROR HERE, PLEASE READ BELOW !!! */ 47 | /***************** How to get Visual Studio understand streams.h ****************\ 48 | 49 | You need DirectShow SDK that is now a part of Platform SDK 50 | (Windows Server 2003 SP1 SDK or later), 51 | and DirectX SDK (2006 April or later). 52 | 53 | 1. Download the Platform SDK from 54 | http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ 55 | and DirectX SDK from msdn.microsoft.com/directx/ 56 | (They are huge, but you can download it by parts). 57 | If it doesn't work for you, consider HighGUI that can capture video via VFW or MIL 58 | 59 | 2. Install Platform SDK together with DirectShow SDK. 60 | Install DirectX (with or without sample code). 61 | 62 | 3. Build baseclasses. 63 | See \samples\multimedia\directshow\readme.txt. 64 | 65 | 4. Copy the built libraries (called strmbase.lib and strmbasd.lib 66 | in Release and Debug versions, respectively) to 67 | \lib. 68 | 69 | 5. In Developer Studio add the following paths: 70 | \include 71 | \include 72 | \samples\multimedia\directshow\baseclasses 73 | to the includes' search path 74 | (at Tools->Options->Directories->Include files in case of Visual Studio 6.0, 75 | at Tools->Options->Projects and Solutions->VC++ Directories->Include files in case 76 | of Visual Studio 2005) 77 | Add 78 | \lib 79 | \lib 80 | to the libraries' search path (in the same dialog, ...->"Library files" page) 81 | 82 | NOTE: PUT THE ADDED LINES ON THE VERY TOP OF THE LISTS, OTHERWISE YOU MAY STILL GET 83 | COMPILER OR LINKER ERRORS. This is necessary, because Visual Studio 84 | may include older versions of the same headers and libraries. 85 | 86 | 6. Now you can build OpenCV DirectShow filters. 87 | 88 | \***********************************************************************************/ 89 | 90 | #endif 91 | 92 | #endif 93 | 94 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/nonfree/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 | // 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_NONFREE_FEATURES_2D_HPP__ 44 | #define __OPENCV_NONFREE_FEATURES_2D_HPP__ 45 | 46 | #include "opencv2/features2d/features2d.hpp" 47 | 48 | #ifdef __cplusplus 49 | 50 | namespace cv 51 | { 52 | 53 | /*! 54 | SIFT implementation. 55 | 56 | The class implements SIFT algorithm by D. Lowe. 57 | */ 58 | class CV_EXPORTS_W SIFT : public Feature2D 59 | { 60 | public: 61 | CV_WRAP explicit SIFT( int nfeatures=0, int nOctaveLayers=3, 62 | double contrastThreshold=0.04, double edgeThreshold=10, 63 | double sigma=1.6); 64 | 65 | //! returns the descriptor size in floats (128) 66 | CV_WRAP int descriptorSize() const; 67 | 68 | //! returns the descriptor type 69 | CV_WRAP int descriptorType() const; 70 | 71 | //! finds the keypoints using SIFT algorithm 72 | void operator()(InputArray img, InputArray mask, 73 | vector& keypoints) const; 74 | //! finds the keypoints and computes descriptors for them using SIFT algorithm. 75 | //! Optionally it can compute descriptors for the user-provided keypoints 76 | void operator()(InputArray img, InputArray mask, 77 | vector& keypoints, 78 | OutputArray descriptors, 79 | bool useProvidedKeypoints=false) const; 80 | 81 | AlgorithmInfo* info() const; 82 | 83 | void buildGaussianPyramid( const Mat& base, vector& pyr, int nOctaves ) const; 84 | void buildDoGPyramid( const vector& pyr, vector& dogpyr ) const; 85 | void findScaleSpaceExtrema( const vector& gauss_pyr, const vector& dog_pyr, 86 | vector& keypoints ) const; 87 | 88 | protected: 89 | void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const; 90 | void computeImpl( const Mat& image, vector& keypoints, Mat& descriptors ) const; 91 | 92 | CV_PROP_RW int nfeatures; 93 | CV_PROP_RW int nOctaveLayers; 94 | CV_PROP_RW double contrastThreshold; 95 | CV_PROP_RW double edgeThreshold; 96 | CV_PROP_RW double sigma; 97 | }; 98 | 99 | typedef SIFT SiftFeatureDetector; 100 | typedef SIFT SiftDescriptorExtractor; 101 | 102 | /*! 103 | SURF implementation. 104 | 105 | The class implements SURF algorithm by H. Bay et al. 106 | */ 107 | class CV_EXPORTS_W SURF : public Feature2D 108 | { 109 | public: 110 | //! the default constructor 111 | CV_WRAP SURF(); 112 | //! the full constructor taking all the necessary parameters 113 | explicit CV_WRAP SURF(double hessianThreshold, 114 | int nOctaves=4, int nOctaveLayers=2, 115 | bool extended=true, bool upright=false); 116 | 117 | //! returns the descriptor size in float's (64 or 128) 118 | CV_WRAP int descriptorSize() const; 119 | 120 | //! returns the descriptor type 121 | CV_WRAP int descriptorType() const; 122 | 123 | //! finds the keypoints using fast hessian detector used in SURF 124 | void operator()(InputArray img, InputArray mask, 125 | CV_OUT vector& keypoints) const; 126 | //! finds the keypoints and computes their descriptors. Optionally it can compute descriptors for the user-provided keypoints 127 | void operator()(InputArray img, InputArray mask, 128 | CV_OUT vector& keypoints, 129 | OutputArray descriptors, 130 | bool useProvidedKeypoints=false) const; 131 | 132 | AlgorithmInfo* info() const; 133 | 134 | CV_PROP_RW double hessianThreshold; 135 | CV_PROP_RW int nOctaves; 136 | CV_PROP_RW int nOctaveLayers; 137 | CV_PROP_RW bool extended; 138 | CV_PROP_RW bool upright; 139 | 140 | protected: 141 | 142 | void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const; 143 | void computeImpl( const Mat& image, vector& keypoints, Mat& descriptors ) const; 144 | }; 145 | 146 | typedef SURF SurfFeatureDetector; 147 | typedef SURF SurfDescriptorExtractor; 148 | 149 | } /* namespace cv */ 150 | 151 | #endif /* __cplusplus */ 152 | 153 | #endif 154 | 155 | /* End of file. */ 156 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/nonfree/nonfree.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_NONFREE_HPP__ 44 | #define __OPENCV_NONFREE_HPP__ 45 | 46 | #include "opencv2/nonfree/features2d.hpp" 47 | 48 | namespace cv 49 | { 50 | 51 | CV_EXPORTS bool initModule_nonfree(); 52 | 53 | } 54 | 55 | #endif 56 | 57 | /* End of file. */ 58 | -------------------------------------------------------------------------------- /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/core_c.h" 47 | #include "opencv2/core/core.hpp" 48 | #include "opencv2/flann/miniflann.hpp" 49 | #include "opencv2/imgproc/imgproc_c.h" 50 | #include "opencv2/imgproc/imgproc.hpp" 51 | #include "opencv2/photo/photo.hpp" 52 | #include "opencv2/video/video.hpp" 53 | #include "opencv2/features2d/features2d.hpp" 54 | #include "opencv2/objdetect/objdetect.hpp" 55 | #include "opencv2/calib3d/calib3d.hpp" 56 | #include "opencv2/ml/ml.hpp" 57 | #include "opencv2/highgui/highgui_c.h" 58 | #include "opencv2/highgui/highgui.hpp" 59 | #include "opencv2/contrib/contrib.hpp" 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /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_CONTRIB 11 | #define HAVE_OPENCV_CORE 12 | #define HAVE_OPENCV_FEATURES2D 13 | #define HAVE_OPENCV_FLANN 14 | #define HAVE_OPENCV_HIGHGUI 15 | #define HAVE_OPENCV_IMGPROC 16 | #define HAVE_OPENCV_LEGACY 17 | #define HAVE_OPENCV_ML 18 | #define HAVE_OPENCV_NONFREE 19 | #define HAVE_OPENCV_OBJDETECT 20 | #define HAVE_OPENCV_PHOTO 21 | #define HAVE_OPENCV_STITCHING 22 | #define HAVE_OPENCV_VIDEO 23 | #define HAVE_OPENCV_VIDEOSTAB 24 | #define HAVE_OPENCV_WORLD 25 | 26 | 27 | -------------------------------------------------------------------------------- /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) 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_HPP__ 44 | #define __OPENCV_PHOTO_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/imgproc/imgproc.hpp" 48 | 49 | #include "opencv2/photo/photo_c.h" 50 | 51 | #ifdef __cplusplus 52 | 53 | /*! \namespace cv 54 | Namespace where all the C++ OpenCV functionality resides 55 | */ 56 | namespace cv 57 | { 58 | 59 | //! the inpainting algorithm 60 | enum 61 | { 62 | INPAINT_NS=CV_INPAINT_NS, // Navier-Stokes algorithm 63 | INPAINT_TELEA=CV_INPAINT_TELEA // A. Telea algorithm 64 | }; 65 | 66 | //! restores the damaged image areas using one of the available intpainting algorithms 67 | CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask, 68 | OutputArray dst, double inpaintRadius, int flags ); 69 | 70 | 71 | CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3, 72 | int templateWindowSize = 7, int searchWindowSize = 21); 73 | 74 | CV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst, 75 | float h = 3, float hColor = 3, 76 | int templateWindowSize = 7, int searchWindowSize = 21); 77 | 78 | CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, 79 | int imgToDenoiseIndex, int temporalWindowSize, 80 | float h = 3, int templateWindowSize = 7, int searchWindowSize = 21); 81 | 82 | CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst, 83 | int imgToDenoiseIndex, int temporalWindowSize, 84 | float h = 3, float hColor = 3, 85 | int templateWindowSize = 7, int searchWindowSize = 21); 86 | 87 | } 88 | 89 | #endif //__cplusplus 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /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/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/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/blenders.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_BLENDERS_HPP__ 44 | #define __OPENCV_STITCHING_BLENDERS_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | 52 | // Simple blender which puts one image over another 53 | class CV_EXPORTS Blender 54 | { 55 | public: 56 | virtual ~Blender() {} 57 | 58 | enum { NO, FEATHER, MULTI_BAND }; 59 | static Ptr createDefault(int type, bool try_gpu = false); 60 | 61 | void prepare(const std::vector &corners, const std::vector &sizes); 62 | virtual void prepare(Rect dst_roi); 63 | virtual void feed(const Mat &img, const Mat &mask, Point tl); 64 | virtual void blend(Mat &dst, Mat &dst_mask); 65 | 66 | protected: 67 | Mat dst_, dst_mask_; 68 | Rect dst_roi_; 69 | }; 70 | 71 | 72 | class CV_EXPORTS FeatherBlender : public Blender 73 | { 74 | public: 75 | FeatherBlender(float sharpness = 0.02f); 76 | 77 | float sharpness() const { return sharpness_; } 78 | void setSharpness(float val) { sharpness_ = val; } 79 | 80 | void prepare(Rect dst_roi); 81 | void feed(const Mat &img, const Mat &mask, Point tl); 82 | void blend(Mat &dst, Mat &dst_mask); 83 | 84 | // Creates weight maps for fixed set of source images by their masks and top-left corners. 85 | // Final image can be obtained by simple weighting of the source images. 86 | Rect createWeightMaps(const std::vector &masks, const std::vector &corners, 87 | std::vector &weight_maps); 88 | 89 | private: 90 | float sharpness_; 91 | Mat weight_map_; 92 | Mat dst_weight_map_; 93 | }; 94 | 95 | inline FeatherBlender::FeatherBlender(float _sharpness) { setSharpness(_sharpness); } 96 | 97 | 98 | class CV_EXPORTS MultiBandBlender : public Blender 99 | { 100 | public: 101 | MultiBandBlender(int try_gpu = false, int num_bands = 5, int weight_type = CV_32F); 102 | 103 | int numBands() const { return actual_num_bands_; } 104 | void setNumBands(int val) { actual_num_bands_ = val; } 105 | 106 | void prepare(Rect dst_roi); 107 | void feed(const Mat &img, const Mat &mask, Point tl); 108 | void blend(Mat &dst, Mat &dst_mask); 109 | 110 | private: 111 | int actual_num_bands_, num_bands_; 112 | std::vector dst_pyr_laplace_; 113 | std::vector dst_band_weights_; 114 | Rect dst_roi_final_; 115 | bool can_use_gpu_; 116 | int weight_type_; //CV_32F or CV_16S 117 | }; 118 | 119 | 120 | ////////////////////////////////////////////////////////////////////////////// 121 | // Auxiliary functions 122 | 123 | void CV_EXPORTS normalizeUsingWeightMap(const Mat& weight, Mat& src); 124 | 125 | void CV_EXPORTS createWeightMap(const Mat& mask, float sharpness, Mat& weight); 126 | 127 | void CV_EXPORTS createLaplacePyr(const Mat &img, int num_levels, std::vector& pyr); 128 | void CV_EXPORTS createLaplacePyrGpu(const Mat &img, int num_levels, std::vector& pyr); 129 | 130 | // Restores source image 131 | void CV_EXPORTS restoreImageFromLaplacePyr(std::vector& pyr); 132 | void CV_EXPORTS restoreImageFromLaplacePyrGpu(std::vector& pyr); 133 | 134 | } // namespace detail 135 | } // namespace cv 136 | 137 | #endif // __OPENCV_STITCHING_BLENDERS_HPP__ 138 | -------------------------------------------------------------------------------- /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/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/exposure_compensate.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_EXPOSURE_COMPENSATE_HPP__ 44 | #define __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | class CV_EXPORTS ExposureCompensator 52 | { 53 | public: 54 | virtual ~ExposureCompensator() {} 55 | 56 | enum { NO, GAIN, GAIN_BLOCKS }; 57 | static Ptr createDefault(int type); 58 | 59 | void feed(const std::vector &corners, const std::vector &images, 60 | const std::vector &masks); 61 | virtual void feed(const std::vector &corners, const std::vector &images, 62 | const std::vector > &masks) = 0; 63 | virtual void apply(int index, Point corner, Mat &image, const Mat &mask) = 0; 64 | }; 65 | 66 | 67 | class CV_EXPORTS NoExposureCompensator : public ExposureCompensator 68 | { 69 | public: 70 | void feed(const std::vector &/*corners*/, const std::vector &/*images*/, 71 | const std::vector > &/*masks*/) {}; 72 | void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) {}; 73 | }; 74 | 75 | 76 | class CV_EXPORTS GainCompensator : public ExposureCompensator 77 | { 78 | public: 79 | void feed(const std::vector &corners, const std::vector &images, 80 | const std::vector > &masks); 81 | void apply(int index, Point corner, Mat &image, const Mat &mask); 82 | std::vector gains() const; 83 | 84 | private: 85 | Mat_ gains_; 86 | }; 87 | 88 | 89 | class CV_EXPORTS BlocksGainCompensator : public ExposureCompensator 90 | { 91 | public: 92 | BlocksGainCompensator(int bl_width = 32, int bl_height = 32) 93 | : bl_width_(bl_width), bl_height_(bl_height) {} 94 | void feed(const std::vector &corners, const std::vector &images, 95 | const std::vector > &masks); 96 | void apply(int index, Point corner, Mat &image, const Mat &mask); 97 | 98 | private: 99 | int bl_width_, bl_height_; 100 | std::vector > gain_maps_; 101 | }; 102 | 103 | } // namespace detail 104 | } // namespace cv 105 | 106 | #endif // __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__ 107 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/util.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_UTIL_HPP__ 44 | #define __OPENCV_STITCHING_UTIL_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | 49 | #define ENABLE_LOG 0 50 | 51 | // TODO remove LOG macros, add logging class 52 | #if ENABLE_LOG 53 | #ifdef ANDROID 54 | #include 55 | #include 56 | #include 57 | #define LOG_STITCHING_MSG(msg) \ 58 | do { \ 59 | std::stringstream _os; \ 60 | _os << msg; \ 61 | __android_log_print(ANDROID_LOG_DEBUG, "STITCHING", "%s", _os.str().c_str()); \ 62 | } while(0); 63 | #else 64 | #include 65 | #define LOG_STITCHING_MSG(msg) for(;;) { std::cout << msg; std::cout.flush(); break; } 66 | #endif 67 | #else 68 | #define LOG_STITCHING_MSG(msg) 69 | #endif 70 | 71 | #define LOG_(_level, _msg) \ 72 | for(;;) \ 73 | { \ 74 | if ((_level) >= ::cv::detail::stitchingLogLevel()) \ 75 | { \ 76 | LOG_STITCHING_MSG(_msg); \ 77 | } \ 78 | break; \ 79 | } 80 | 81 | 82 | #define LOG(msg) LOG_(1, msg) 83 | #define LOG_CHAT(msg) LOG_(0, msg) 84 | 85 | #define LOGLN(msg) LOG(msg << std::endl) 86 | #define LOGLN_CHAT(msg) LOG_CHAT(msg << std::endl) 87 | 88 | //#if DEBUG_LOG_CHAT 89 | // #define LOG_CHAT(msg) LOG(msg) 90 | // #define LOGLN_CHAT(msg) LOGLN(msg) 91 | //#else 92 | // #define LOG_CHAT(msg) do{}while(0) 93 | // #define LOGLN_CHAT(msg) do{}while(0) 94 | //#endif 95 | 96 | namespace cv { 97 | namespace detail { 98 | 99 | class CV_EXPORTS DisjointSets 100 | { 101 | public: 102 | DisjointSets(int elem_count = 0) { createOneElemSets(elem_count); } 103 | 104 | void createOneElemSets(int elem_count); 105 | int findSetByElem(int elem); 106 | int mergeSets(int set1, int set2); 107 | 108 | std::vector parent; 109 | std::vector size; 110 | 111 | private: 112 | std::vector rank_; 113 | }; 114 | 115 | 116 | struct CV_EXPORTS GraphEdge 117 | { 118 | GraphEdge(int from, int to, float weight); 119 | bool operator <(const GraphEdge& other) const { return weight < other.weight; } 120 | bool operator >(const GraphEdge& other) const { return weight > other.weight; } 121 | 122 | int from, to; 123 | float weight; 124 | }; 125 | 126 | inline GraphEdge::GraphEdge(int _from, int _to, float _weight) : from(_from), to(_to), weight(_weight) {} 127 | 128 | 129 | class CV_EXPORTS Graph 130 | { 131 | public: 132 | Graph(int num_vertices = 0) { create(num_vertices); } 133 | void create(int num_vertices) { edges_.assign(num_vertices, std::list()); } 134 | int numVertices() const { return static_cast(edges_.size()); } 135 | void addEdge(int from, int to, float weight); 136 | template B forEach(B body) const; 137 | template B walkBreadthFirst(int from, B body) const; 138 | 139 | private: 140 | std::vector< std::list > edges_; 141 | }; 142 | 143 | 144 | ////////////////////////////////////////////////////////////////////////////// 145 | // Auxiliary functions 146 | 147 | CV_EXPORTS bool overlapRoi(Point tl1, Point tl2, Size sz1, Size sz2, Rect &roi); 148 | CV_EXPORTS Rect resultRoi(const std::vector &corners, const std::vector &images); 149 | CV_EXPORTS Rect resultRoi(const std::vector &corners, const std::vector &sizes); 150 | CV_EXPORTS Point resultTl(const std::vector &corners); 151 | 152 | // Returns random 'count' element subset of the {0,1,...,size-1} set 153 | CV_EXPORTS void selectRandomSubset(int count, int size, std::vector &subset); 154 | 155 | CV_EXPORTS int& stitchingLogLevel(); 156 | 157 | } // namespace detail 158 | } // namespace cv 159 | 160 | #include "util_inl.hpp" 161 | 162 | #endif // __OPENCV_STITCHING_UTIL_HPP__ 163 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/util_inl.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_UTIL_INL_HPP__ 44 | #define __OPENCV_STITCHING_UTIL_INL_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | #include "util.hpp" // Make your IDE see declarations 49 | 50 | namespace cv { 51 | namespace detail { 52 | 53 | template 54 | B Graph::forEach(B body) const 55 | { 56 | for (int i = 0; i < numVertices(); ++i) 57 | { 58 | std::list::const_iterator edge = edges_[i].begin(); 59 | for (; edge != edges_[i].end(); ++edge) 60 | body(*edge); 61 | } 62 | return body; 63 | } 64 | 65 | 66 | template 67 | B Graph::walkBreadthFirst(int from, B body) const 68 | { 69 | std::vector was(numVertices(), false); 70 | std::queue vertices; 71 | 72 | was[from] = true; 73 | vertices.push(from); 74 | 75 | while (!vertices.empty()) 76 | { 77 | int vertex = vertices.front(); 78 | vertices.pop(); 79 | 80 | std::list::const_iterator edge = edges_[vertex].begin(); 81 | for (; edge != edges_[vertex].end(); ++edge) 82 | { 83 | if (!was[edge->to]) 84 | { 85 | body(*edge); 86 | was[edge->to] = true; 87 | vertices.push(edge->to); 88 | } 89 | } 90 | } 91 | 92 | return body; 93 | } 94 | 95 | 96 | ////////////////////////////////////////////////////////////////////////////// 97 | // Some auxiliary math functions 98 | 99 | static inline 100 | float normL2(const Point3f& a) 101 | { 102 | return a.x * a.x + a.y * a.y + a.z * a.z; 103 | } 104 | 105 | 106 | static inline 107 | float normL2(const Point3f& a, const Point3f& b) 108 | { 109 | return normL2(a - b); 110 | } 111 | 112 | 113 | static inline 114 | double normL2sq(const Mat &r) 115 | { 116 | return r.dot(r); 117 | } 118 | 119 | 120 | static inline int sqr(int x) { return x * x; } 121 | static inline float sqr(float x) { return x * x; } 122 | static inline double sqr(double x) { return x * x; } 123 | 124 | } // namespace detail 125 | } // namespace cv 126 | 127 | #endif // __OPENCV_STITCHING_UTIL_INL_HPP__ 128 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/warpers.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_WARPER_CREATORS_HPP__ 44 | #define __OPENCV_STITCHING_WARPER_CREATORS_HPP__ 45 | 46 | #include "opencv2/stitching/detail/warpers.hpp" 47 | 48 | namespace cv { 49 | 50 | class WarperCreator 51 | { 52 | public: 53 | virtual ~WarperCreator() {} 54 | virtual Ptr create(float scale) const = 0; 55 | }; 56 | 57 | 58 | class PlaneWarper : public WarperCreator 59 | { 60 | public: 61 | Ptr create(float scale) const { return new detail::PlaneWarper(scale); } 62 | }; 63 | 64 | 65 | class CylindricalWarper: public WarperCreator 66 | { 67 | public: 68 | Ptr create(float scale) const { return new detail::CylindricalWarper(scale); } 69 | }; 70 | 71 | 72 | class SphericalWarper: public WarperCreator 73 | { 74 | public: 75 | Ptr create(float scale) const { return new detail::SphericalWarper(scale); } 76 | }; 77 | 78 | class FisheyeWarper : public WarperCreator 79 | { 80 | public: 81 | Ptr create(float scale) const { return new detail::FisheyeWarper(scale); } 82 | }; 83 | 84 | class StereographicWarper: public WarperCreator 85 | { 86 | public: 87 | Ptr create(float scale) const { return new detail::StereographicWarper(scale); } 88 | }; 89 | 90 | class CompressedRectilinearWarper: public WarperCreator 91 | { 92 | float a, b; 93 | public: 94 | CompressedRectilinearWarper(float A = 1, float B = 1) 95 | { 96 | a = A; b = B; 97 | } 98 | Ptr create(float scale) const { return new detail::CompressedRectilinearWarper(scale, a, b); } 99 | }; 100 | 101 | class CompressedRectilinearPortraitWarper: public WarperCreator 102 | { 103 | float a, b; 104 | public: 105 | CompressedRectilinearPortraitWarper(float A = 1, float B = 1) 106 | { 107 | a = A; b = B; 108 | } 109 | Ptr create(float scale) const { return new detail::CompressedRectilinearPortraitWarper(scale, a, b); } 110 | }; 111 | 112 | class PaniniWarper: public WarperCreator 113 | { 114 | float a, b; 115 | public: 116 | PaniniWarper(float A = 1, float B = 1) 117 | { 118 | a = A; b = B; 119 | } 120 | Ptr create(float scale) const { return new detail::PaniniWarper(scale, a, b); } 121 | }; 122 | 123 | class PaniniPortraitWarper: public WarperCreator 124 | { 125 | float a, b; 126 | public: 127 | PaniniPortraitWarper(float A = 1, float B = 1) 128 | { 129 | a = A; b = B; 130 | } 131 | Ptr create(float scale) const { return new detail::PaniniPortraitWarper(scale, a, b); } 132 | }; 133 | 134 | class MercatorWarper: public WarperCreator 135 | { 136 | public: 137 | Ptr create(float scale) const { return new detail::MercatorWarper(scale); } 138 | }; 139 | 140 | class TransverseMercatorWarper: public WarperCreator 141 | { 142 | public: 143 | Ptr create(float scale) const { return new detail::TransverseMercatorWarper(scale); } 144 | }; 145 | 146 | 147 | 148 | #ifdef HAVE_OPENCV_GPU 149 | class PlaneWarperGpu: public WarperCreator 150 | { 151 | public: 152 | Ptr create(float scale) const { return new detail::PlaneWarperGpu(scale); } 153 | }; 154 | 155 | 156 | class CylindricalWarperGpu: public WarperCreator 157 | { 158 | public: 159 | Ptr create(float scale) const { return new detail::CylindricalWarperGpu(scale); } 160 | }; 161 | 162 | 163 | class SphericalWarperGpu: public WarperCreator 164 | { 165 | public: 166 | Ptr create(float scale) const { return new detail::SphericalWarperGpu(scale); } 167 | }; 168 | #endif 169 | 170 | } // namespace cv 171 | 172 | #endif // __OPENCV_STITCHING_WARPER_CREATORS_HPP__ 173 | -------------------------------------------------------------------------------- /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 | // 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_VIDEO_HPP__ 44 | #define __OPENCV_VIDEO_HPP__ 45 | 46 | #include "opencv2/video/tracking.hpp" 47 | #include "opencv2/video/background_segm.hpp" 48 | 49 | #ifdef __cplusplus 50 | namespace cv 51 | { 52 | 53 | CV_EXPORTS bool initModule_video(void); 54 | 55 | } 56 | #endif 57 | 58 | #endif //__OPENCV_VIDEO_HPP__ 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/deblurring.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_DEBLURRING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_DEBLURRING_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | CV_EXPORTS float calcBlurriness(const Mat &frame); 55 | 56 | class CV_EXPORTS DeblurerBase 57 | { 58 | public: 59 | DeblurerBase() : radius_(0), frames_(0), motions_(0), blurrinessRates_(0) {} 60 | 61 | virtual ~DeblurerBase() {} 62 | 63 | virtual void setRadius(int val) { radius_ = val; } 64 | virtual int radius() const { return radius_; } 65 | 66 | virtual void deblur(int idx, Mat &frame) = 0; 67 | 68 | 69 | // data from stabilizer 70 | 71 | virtual void setFrames(const std::vector &val) { frames_ = &val; } 72 | virtual const std::vector& frames() const { return *frames_; } 73 | 74 | virtual void setMotions(const std::vector &val) { motions_ = &val; } 75 | virtual const std::vector& motions() const { return *motions_; } 76 | 77 | virtual void setBlurrinessRates(const std::vector &val) { blurrinessRates_ = &val; } 78 | virtual const std::vector& blurrinessRates() const { return *blurrinessRates_; } 79 | 80 | protected: 81 | int radius_; 82 | const std::vector *frames_; 83 | const std::vector *motions_; 84 | const std::vector *blurrinessRates_; 85 | }; 86 | 87 | class CV_EXPORTS NullDeblurer : public DeblurerBase 88 | { 89 | public: 90 | virtual void deblur(int /*idx*/, Mat &/*frame*/) {} 91 | }; 92 | 93 | class CV_EXPORTS WeightingDeblurer : public DeblurerBase 94 | { 95 | public: 96 | WeightingDeblurer(); 97 | 98 | void setSensitivity(float val) { sensitivity_ = val; } 99 | float sensitivity() const { return sensitivity_; } 100 | 101 | virtual void deblur(int idx, Mat &frame); 102 | 103 | private: 104 | float sensitivity_; 105 | Mat_ bSum_, gSum_, rSum_, wSum_; 106 | }; 107 | 108 | } // namespace videostab 109 | } // namespace cv 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/fast_marching.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_FAST_MARCHING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__ 45 | 46 | #include 47 | #include 48 | #include 49 | #include "opencv2/core/core.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | // See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf 57 | class CV_EXPORTS FastMarchingMethod 58 | { 59 | public: 60 | FastMarchingMethod() : inf_(1e6f) {} 61 | 62 | template 63 | Inpaint run(const Mat &mask, Inpaint inpaint); 64 | 65 | Mat distanceMap() const { return dist_; } 66 | 67 | private: 68 | enum { INSIDE = 0, BAND = 1, KNOWN = 255 }; 69 | 70 | struct DXY 71 | { 72 | float dist; 73 | int x, y; 74 | 75 | DXY() : dist(0), x(0), y(0) {} 76 | DXY(float _dist, int _x, int _y) : dist(_dist), x(_x), y(_y) {} 77 | bool operator <(const DXY &dxy) const { return dist < dxy.dist; } 78 | }; 79 | 80 | float solve(int x1, int y1, int x2, int y2) const; 81 | int& indexOf(const DXY &dxy) { return index_(dxy.y, dxy.x); } 82 | 83 | void heapUp(int idx); 84 | void heapDown(int idx); 85 | void heapAdd(const DXY &dxy); 86 | void heapRemoveMin(); 87 | 88 | float inf_; 89 | 90 | cv::Mat_ flag_; // flag map 91 | cv::Mat_ dist_; // distance map 92 | 93 | cv::Mat_ index_; // index of point in the narrow band 94 | std::vector narrowBand_; // narrow band heap 95 | int size_; // narrow band size 96 | }; 97 | 98 | } // namespace videostab 99 | } // namespace cv 100 | 101 | #include "fast_marching_inl.hpp" 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/fast_marching_inl.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_FAST_MARCHING_INL_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FAST_MARCHING_INL_HPP__ 45 | 46 | #include "opencv2/videostab/fast_marching.hpp" 47 | 48 | namespace cv 49 | { 50 | namespace videostab 51 | { 52 | 53 | template 54 | Inpaint FastMarchingMethod::run(const cv::Mat &mask, Inpaint inpaint) 55 | { 56 | using namespace std; 57 | using namespace cv; 58 | 59 | CV_Assert(mask.type() == CV_8U); 60 | 61 | static const int lut[4][2] = {{-1,0}, {0,-1}, {1,0}, {0,1}}; 62 | 63 | mask.copyTo(flag_); 64 | flag_.create(mask.size()); 65 | dist_.create(mask.size()); 66 | index_.create(mask.size()); 67 | narrowBand_.clear(); 68 | size_ = 0; 69 | 70 | // init 71 | for (int y = 0; y < flag_.rows; ++y) 72 | { 73 | for (int x = 0; x < flag_.cols; ++x) 74 | { 75 | if (flag_(y,x) == KNOWN) 76 | dist_(y,x) = 0.f; 77 | else 78 | { 79 | int n = 0; 80 | int nunknown = 0; 81 | 82 | for (int i = 0; i < 4; ++i) 83 | { 84 | int xn = x + lut[i][0]; 85 | int yn = y + lut[i][1]; 86 | 87 | if (xn >= 0 && xn < flag_.cols && yn >= 0 && yn < flag_.rows) 88 | { 89 | n++; 90 | if (flag_(yn,xn) != KNOWN) 91 | nunknown++; 92 | } 93 | } 94 | 95 | if (n>0 && nunknown == n) 96 | { 97 | dist_(y,x) = inf_; 98 | flag_(y,x) = INSIDE; 99 | } 100 | else 101 | { 102 | dist_(y,x) = 0.f; 103 | flag_(y,x) = BAND; 104 | inpaint(x, y); 105 | 106 | narrowBand_.push_back(DXY(0.f,x,y)); 107 | index_(y,x) = size_++; 108 | } 109 | } 110 | } 111 | } 112 | 113 | // make heap 114 | for (int i = size_/2-1; i >= 0; --i) 115 | heapDown(i); 116 | 117 | // main cycle 118 | while (size_ > 0) 119 | { 120 | int x = narrowBand_[0].x; 121 | int y = narrowBand_[0].y; 122 | heapRemoveMin(); 123 | 124 | flag_(y,x) = KNOWN; 125 | for (int n = 0; n < 4; ++n) 126 | { 127 | int xn = x + lut[n][0]; 128 | int yn = y + lut[n][1]; 129 | 130 | if (xn >= 0 && xn < flag_.cols && yn >= 0 && yn < flag_.rows && flag_(yn,xn) != KNOWN) 131 | { 132 | dist_(yn,xn) = min(min(solve(xn-1, yn, xn, yn-1), solve(xn+1, yn, xn, yn-1)), 133 | min(solve(xn-1, yn, xn, yn+1), solve(xn+1, yn, xn, yn+1))); 134 | 135 | if (flag_(yn,xn) == INSIDE) 136 | { 137 | flag_(yn,xn) = BAND; 138 | inpaint(xn, yn); 139 | heapAdd(DXY(dist_(yn,xn),xn,yn)); 140 | } 141 | else 142 | { 143 | int i = index_(yn,xn); 144 | if (dist_(yn,xn) < narrowBand_[i].dist) 145 | { 146 | narrowBand_[i].dist = dist_(yn,xn); 147 | heapUp(i); 148 | } 149 | // works better if it's commented out 150 | /*else if (dist(yn,xn) > narrowBand[i].dist) 151 | { 152 | narrowBand[i].dist = dist(yn,xn); 153 | heapDown(i); 154 | }*/ 155 | } 156 | } 157 | } 158 | } 159 | 160 | return inpaint; 161 | } 162 | 163 | } // namespace videostab 164 | } // namespace cv 165 | 166 | #endif 167 | -------------------------------------------------------------------------------- /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 48 | #include "opencv2/core/core.hpp" 49 | 50 | namespace cv 51 | { 52 | namespace videostab 53 | { 54 | 55 | class CV_EXPORTS IFrameSource 56 | { 57 | public: 58 | virtual ~IFrameSource() {} 59 | virtual void reset() = 0; 60 | virtual Mat nextFrame() = 0; 61 | }; 62 | 63 | class CV_EXPORTS NullFrameSource : public IFrameSource 64 | { 65 | public: 66 | virtual void reset() {} 67 | virtual Mat nextFrame() { return Mat(); } 68 | }; 69 | 70 | class CV_EXPORTS VideoFileSource : public IFrameSource 71 | { 72 | public: 73 | VideoFileSource(const std::string &path, bool volatileFrame = false); 74 | 75 | virtual void reset(); 76 | virtual Mat nextFrame(); 77 | 78 | int width(); 79 | int height(); 80 | int count(); 81 | double fps(); 82 | 83 | private: 84 | Ptr impl; 85 | }; 86 | 87 | } // namespace videostab 88 | } // namespace cv 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /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/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/motion_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-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_MOTION_CORE_HPP__ 44 | #define __OPENCV_VIDEOSTAB_MOTION_CORE_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | enum MotionModel 55 | { 56 | MM_TRANSLATION = 0, 57 | MM_TRANSLATION_AND_SCALE = 1, 58 | MM_ROTATION = 2, 59 | MM_RIGID = 3, 60 | MM_SIMILARITY = 4, 61 | MM_AFFINE = 5, 62 | MM_HOMOGRAPHY = 6, 63 | MM_UNKNOWN = 7 64 | }; 65 | 66 | struct CV_EXPORTS RansacParams 67 | { 68 | int size; // subset size 69 | float thresh; // max error to classify as inlier 70 | float eps; // max outliers ratio 71 | float prob; // probability of success 72 | 73 | RansacParams() : size(0), thresh(0), eps(0), prob(0) {} 74 | RansacParams(int size, float thresh, float eps, float prob); 75 | 76 | int niters() const 77 | { 78 | return static_cast( 79 | std::ceil(std::log(1 - prob) / std::log(1 - std::pow(1 - eps, size)))); 80 | } 81 | 82 | static RansacParams default2dMotion(MotionModel model) 83 | { 84 | CV_Assert(model < MM_UNKNOWN); 85 | if (model == MM_TRANSLATION) 86 | return RansacParams(1, 0.5f, 0.5f, 0.99f); 87 | if (model == MM_TRANSLATION_AND_SCALE) 88 | return RansacParams(2, 0.5f, 0.5f, 0.99f); 89 | if (model == MM_ROTATION) 90 | return RansacParams(1, 0.5f, 0.5f, 0.99f); 91 | if (model == MM_RIGID) 92 | return RansacParams(2, 0.5f, 0.5f, 0.99f); 93 | if (model == MM_SIMILARITY) 94 | return RansacParams(2, 0.5f, 0.5f, 0.99f); 95 | if (model == MM_AFFINE) 96 | return RansacParams(3, 0.5f, 0.5f, 0.99f); 97 | return RansacParams(4, 0.5f, 0.5f, 0.99f); 98 | } 99 | }; 100 | 101 | inline RansacParams::RansacParams(int _size, float _thresh, float _eps, float _prob) 102 | : size(_size), thresh(_thresh), eps(_eps), prob(_prob) {} 103 | 104 | 105 | } // namespace videostab 106 | } // namespace cv 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/motion_stabilizing.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_MOTION_STABILIZING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__ 45 | 46 | #include 47 | #include 48 | #include "opencv2/core/core.hpp" 49 | #include "opencv2/videostab/global_motion.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | class CV_EXPORTS IMotionStabilizer 57 | { 58 | public: 59 | virtual ~IMotionStabilizer() {} 60 | 61 | // assumes that [0, size-1) is in or equals to [range.first, range.second) 62 | virtual void stabilize( 63 | int size, const std::vector &motions, std::pair range, 64 | Mat *stabilizationMotions) = 0; 65 | }; 66 | 67 | class CV_EXPORTS MotionStabilizationPipeline : public IMotionStabilizer 68 | { 69 | public: 70 | void pushBack(Ptr stabilizer) { stabilizers_.push_back(stabilizer); } 71 | bool empty() const { return stabilizers_.empty(); } 72 | 73 | virtual void stabilize( 74 | int size, const std::vector &motions, std::pair range, 75 | Mat *stabilizationMotions); 76 | 77 | private: 78 | std::vector > stabilizers_; 79 | }; 80 | 81 | class CV_EXPORTS MotionFilterBase : public IMotionStabilizer 82 | { 83 | public: 84 | virtual ~MotionFilterBase() {} 85 | 86 | virtual Mat stabilize( 87 | int idx, const std::vector &motions, std::pair range) = 0; 88 | 89 | virtual void stabilize( 90 | int size, const std::vector &motions, std::pair range, 91 | Mat *stabilizationMotions); 92 | }; 93 | 94 | class CV_EXPORTS GaussianMotionFilter : public MotionFilterBase 95 | { 96 | public: 97 | GaussianMotionFilter(int radius = 15, float stdev = -1.f); 98 | 99 | void setParams(int radius, float stdev = -1.f); 100 | int radius() const { return radius_; } 101 | float stdev() const { return stdev_; } 102 | 103 | virtual Mat stabilize( 104 | int idx, const std::vector &motions, std::pair range); 105 | 106 | private: 107 | int radius_; 108 | float stdev_; 109 | std::vector weight_; 110 | }; 111 | 112 | inline GaussianMotionFilter::GaussianMotionFilter(int _radius, float _stdev) { setParams(_radius, _stdev); } 113 | 114 | class CV_EXPORTS LpMotionStabilizer : public IMotionStabilizer 115 | { 116 | public: 117 | LpMotionStabilizer(MotionModel model = MM_SIMILARITY); 118 | 119 | void setMotionModel(MotionModel val) { model_ = val; } 120 | MotionModel motionModel() const { return model_; } 121 | 122 | void setFrameSize(Size val) { frameSize_ = val; } 123 | Size frameSize() const { return frameSize_; } 124 | 125 | void setTrimRatio(float val) { trimRatio_ = val; } 126 | float trimRatio() const { return trimRatio_; } 127 | 128 | void setWeight1(float val) { w1_ = val; } 129 | float weight1() const { return w1_; } 130 | 131 | void setWeight2(float val) { w2_ = val; } 132 | float weight2() const { return w2_; } 133 | 134 | void setWeight3(float val) { w3_ = val; } 135 | float weight3() const { return w3_; } 136 | 137 | void setWeight4(float val) { w4_ = val; } 138 | float weight4() const { return w4_; } 139 | 140 | virtual void stabilize( 141 | int size, const std::vector &motions, std::pair range, 142 | Mat *stabilizationMotions); 143 | 144 | private: 145 | MotionModel model_; 146 | Size frameSize_; 147 | float trimRatio_; 148 | float w1_, w2_, w3_, w4_; 149 | 150 | std::vector obj_, collb_, colub_; 151 | std::vector rows_, cols_; 152 | std::vector elems_, rowlb_, rowub_; 153 | 154 | void set(int row, int col, double coef) 155 | { 156 | rows_.push_back(row); 157 | cols_.push_back(col); 158 | elems_.push_back(coef); 159 | } 160 | }; 161 | 162 | CV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio); 163 | 164 | CV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size); 165 | 166 | } // namespace videostab 167 | } // namespace 168 | 169 | #endif 170 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/optical_flow.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_OPTICAL_FLOW_HPP__ 44 | #define __OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/opencv_modules.hpp" 48 | 49 | #ifdef HAVE_OPENCV_GPU 50 | #include "opencv2/gpu/gpu.hpp" 51 | #endif 52 | 53 | namespace cv 54 | { 55 | namespace videostab 56 | { 57 | 58 | class CV_EXPORTS ISparseOptFlowEstimator 59 | { 60 | public: 61 | virtual ~ISparseOptFlowEstimator() {} 62 | virtual void run( 63 | InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, 64 | OutputArray status, OutputArray errors) = 0; 65 | }; 66 | 67 | class CV_EXPORTS IDenseOptFlowEstimator 68 | { 69 | public: 70 | virtual ~IDenseOptFlowEstimator() {} 71 | virtual void run( 72 | InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, 73 | OutputArray errors) = 0; 74 | }; 75 | 76 | class CV_EXPORTS PyrLkOptFlowEstimatorBase 77 | { 78 | public: 79 | PyrLkOptFlowEstimatorBase() { setWinSize(Size(21, 21)); setMaxLevel(3); } 80 | 81 | virtual void setWinSize(Size val) { winSize_ = val; } 82 | virtual Size winSize() const { return winSize_; } 83 | 84 | virtual void setMaxLevel(int val) { maxLevel_ = val; } 85 | virtual int maxLevel() const { return maxLevel_; } 86 | virtual ~PyrLkOptFlowEstimatorBase() {} 87 | 88 | protected: 89 | Size winSize_; 90 | int maxLevel_; 91 | }; 92 | 93 | class CV_EXPORTS SparsePyrLkOptFlowEstimator 94 | : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator 95 | { 96 | public: 97 | virtual void run( 98 | InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, 99 | OutputArray status, OutputArray errors); 100 | }; 101 | 102 | #ifdef HAVE_OPENCV_GPU 103 | class CV_EXPORTS SparsePyrLkOptFlowEstimatorGpu 104 | : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator 105 | { 106 | public: 107 | SparsePyrLkOptFlowEstimatorGpu(); 108 | 109 | virtual void run( 110 | InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, 111 | OutputArray status, OutputArray errors); 112 | 113 | void run(const gpu::GpuMat &frame0, const gpu::GpuMat &frame1, const gpu::GpuMat &points0, gpu::GpuMat &points1, 114 | gpu::GpuMat &status, gpu::GpuMat &errors); 115 | 116 | void run(const gpu::GpuMat &frame0, const gpu::GpuMat &frame1, const gpu::GpuMat &points0, gpu::GpuMat &points1, 117 | gpu::GpuMat &status); 118 | 119 | private: 120 | gpu::PyrLKOpticalFlow optFlowEstimator_; 121 | gpu::GpuMat frame0_, frame1_, points0_, points1_, status_, errors_; 122 | }; 123 | 124 | class CV_EXPORTS DensePyrLkOptFlowEstimatorGpu 125 | : public PyrLkOptFlowEstimatorBase, public IDenseOptFlowEstimator 126 | { 127 | public: 128 | DensePyrLkOptFlowEstimatorGpu(); 129 | 130 | virtual void run( 131 | InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, 132 | OutputArray errors); 133 | 134 | private: 135 | gpu::PyrLKOpticalFlow optFlowEstimator_; 136 | gpu::GpuMat frame0_, frame1_, flowX_, flowY_, errors_; 137 | }; 138 | #endif 139 | 140 | } // namespace videostab 141 | } // namespace cv 142 | 143 | #endif 144 | -------------------------------------------------------------------------------- /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/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/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/videostab/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/wobble_suppression.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_WOBBLE_SUPPRESSION_HPP__ 44 | #define __OPENCV_VIDEOSTAB_WOBBLE_SUPPRESSION_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | #include "opencv2/videostab/global_motion.hpp" 49 | #include "opencv2/videostab/log.hpp" 50 | 51 | #ifdef HAVE_OPENCV_GPU 52 | #include "opencv2/gpu/gpu.hpp" 53 | #endif 54 | 55 | namespace cv 56 | { 57 | namespace videostab 58 | { 59 | 60 | class CV_EXPORTS WobbleSuppressorBase 61 | { 62 | public: 63 | WobbleSuppressorBase(); 64 | 65 | virtual ~WobbleSuppressorBase() {} 66 | 67 | void setMotionEstimator(Ptr val) { motionEstimator_ = val; } 68 | Ptr motionEstimator() const { return motionEstimator_; } 69 | 70 | virtual void suppress(int idx, const Mat &frame, Mat &result) = 0; 71 | 72 | 73 | // data from stabilizer 74 | 75 | virtual void setFrameCount(int val) { frameCount_ = val; } 76 | virtual int frameCount() const { return frameCount_; } 77 | 78 | virtual void setMotions(const std::vector &val) { motions_ = &val; } 79 | virtual const std::vector& motions() const { return *motions_; } 80 | 81 | virtual void setMotions2(const std::vector &val) { motions2_ = &val; } 82 | virtual const std::vector& motions2() const { return *motions2_; } 83 | 84 | virtual void setStabilizationMotions(const std::vector &val) { stabilizationMotions_ = &val; } 85 | virtual const std::vector& stabilizationMotions() const { return *stabilizationMotions_; } 86 | 87 | protected: 88 | Ptr motionEstimator_; 89 | int frameCount_; 90 | const std::vector *motions_; 91 | const std::vector *motions2_; 92 | const std::vector *stabilizationMotions_; 93 | }; 94 | 95 | class CV_EXPORTS NullWobbleSuppressor : public WobbleSuppressorBase 96 | { 97 | public: 98 | virtual void suppress(int idx, const Mat &frame, Mat &result); 99 | }; 100 | 101 | class CV_EXPORTS MoreAccurateMotionWobbleSuppressorBase : public WobbleSuppressorBase 102 | { 103 | public: 104 | virtual void setPeriod(int val) { period_ = val; } 105 | virtual int period() const { return period_; } 106 | 107 | protected: 108 | MoreAccurateMotionWobbleSuppressorBase() { setPeriod(30); } 109 | 110 | int period_; 111 | }; 112 | 113 | class CV_EXPORTS MoreAccurateMotionWobbleSuppressor : public MoreAccurateMotionWobbleSuppressorBase 114 | { 115 | public: 116 | virtual void suppress(int idx, const Mat &frame, Mat &result); 117 | 118 | private: 119 | Mat_ mapx_, mapy_; 120 | }; 121 | 122 | #ifdef HAVE_OPENCV_GPU 123 | class CV_EXPORTS MoreAccurateMotionWobbleSuppressorGpu : public MoreAccurateMotionWobbleSuppressorBase 124 | { 125 | public: 126 | void suppress(int idx, const gpu::GpuMat &frame, gpu::GpuMat &result); 127 | virtual void suppress(int idx, const Mat &frame, Mat &result); 128 | 129 | private: 130 | gpu::GpuMat frameDevice_, resultDevice_; 131 | gpu::GpuMat mapx_, mapy_; 132 | }; 133 | #endif 134 | 135 | } // namespace videostab 136 | } // namespace cv 137 | 138 | #endif 139 | 140 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/world/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/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 | com.itseez.opencv 9 | CFBundleVersion 10 | 2.4 11 | CFBundleShortVersionString 12 | 2.4 13 | CFBundleSignature 14 | ???? 15 | CFBundlePackageType 16 | FMWK 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/opencv2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/foundry/OpenCVCircles/70b09d466b2eafa36645c491fc7a8d0dec9dff0c/opencv2.framework/Versions/A/opencv2 -------------------------------------------------------------------------------- /opencv2.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /opencv2.framework/opencv2: -------------------------------------------------------------------------------- 1 | Versions/A/opencv2 --------------------------------------------------------------------------------