This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface MotionMat : NSObject | |
- (id)init; | |
- (id)initWithRows:(int)rows cols:(int)cols channels:(int)channels; | |
- (unsigned char *)data; | |
- (size_t)stepWithIndex:(int)index; | |
- (size_t)elemSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "opencv2/motion/MotionCV.h" | |
#import "MotionMat_p.h" | |
#include "opencv2/core.hpp" | |
#include "opencv2/imgproc.hpp" | |
@implementation MotionCV | |
+ (MotionMat *)MotionMatFromUIImage:(UIImage *)image | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
#import "MotionMat.h" | |
@interface MotionCV : NSObject | |
+ (MotionMat *)MotionMatFromUIImage:(UIImage *)image; | |
+ (UIImage *)UIImageFromMotionMat:(MotionMat *)mat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# これが元のコマンド | |
RUBYOPT='' /usr/bin/gen_bridge_metadata --format complete --no-64-bit --cflags " -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -miphoneos-version-min=6.1 -D__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__=60100 -I. -I'Versions/A/Headers/calib3d' -I'Versions/A/Headers/core' -I'Versions/A/Headers/flann' -I'Versions/A/Headers/highgui' -I'Versions/A/Headers/imgproc' -I'Versions/A/Headers/motion' -I'Versions/A/Headers/objdetect' -I'Versions/A/Headers/photo' -I'Versions/A/Headers/video'" "Versions/A/Headers/calib3d/calib3d_c.h" "Versions/A/Headers/core/core_c.h" "Versions/A/Headers/core/cvdef.h" "Versions/A/Headers/core/types_c.h" "Versions/A/Headers/flann/all_indices.h" "Versions/A/Headers/flann/allocator.h" "Versions/A/Headers/flann/any.h" "Versions/A/Headers/flann/autotuned_index.h" "Versions/A/Headers/flann/composite_index.h" "Versions/A/Headers/flann/config.h" "Versions/A/Headers/flann/defines.h" "Versions/A/Headers/flan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /path/to/workdir | |
$ python /path/to/opencv/platforms/ios/build_framework.py <outputdir> | |
: | |
$ ls <outputdir> | |
build opencv2.framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 最初の出力はAppDelegate内からですが、callerが空の様です | |
(main)> | |
at :L | |
application:didFinishLaunchingWithOptions: at app_delegate.rb:L11 | |
(main)> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Kernel | |
def rm_const c | |
Object.class_eval { remove_const c } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.class_eval { remove_const :B } | |
# => B | |
class B < A; def hoge; puts @@hoge; end; end | |
# => nil | |
B.new.hoge | |
# => 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class B < A; def hoge; puts @@hoge; end; end | |
# => TypeError: superclass mismatch for class B | |
# => from (pry):4:in `__pry__' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A; @@hoge = 1; end | |
class B; def hoge; puts @@hoge; end; end | |
B.new.hoge | |
#=> NameError: uninitialized class variable @@hoge in B | |
#=> from (pry):2:in `hoge' |