Skip to content

Instantly share code, notes, and snippets.

#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;
#import "opencv2/motion/MotionCV.h"
#import "MotionMat_p.h"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
@implementation MotionCV
+ (MotionMat *)MotionMatFromUIImage:(UIImage *)image
{
@iwazer
iwazer / MotionCV.h
Last active December 20, 2015 22:19
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "MotionMat.h"
@interface MotionCV : NSObject
+ (MotionMat *)MotionMatFromUIImage:(UIImage *)image;
+ (UIImage *)UIImageFromMotionMat:(MotionMat *)mat;
# これが元のコマンド
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
$ cd /path/to/workdir
$ python /path/to/opencv/platforms/ios/build_framework.py <outputdir>
:
$ ls <outputdir>
build opencv2.framework
# 最初の出力はAppDelegate内からですが、callerが空の様です
(main)>
at :L
application:didFinishLaunchingWithOptions: at app_delegate.rb:L11
(main)>
module Kernel
def rm_const c
Object.class_eval { remove_const c }
end
end
Object.class_eval { remove_const :B }
# => B
class B < A; def hoge; puts @@hoge; end; end
# => nil
B.new.hoge
# => 1
class B < A; def hoge; puts @@hoge; end; end
# => TypeError: superclass mismatch for class B
# => from (pry):4:in `__pry__'
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'