This file contains hidden or 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 ImageOperator{ | |
public: | |
ImageOperator() = default; | |
~ImageOperator() = default; | |
static void to_gray_m1(const cv::Mat& input, cv::Mat& output); | |
static void to_gray_m2(const cv::Mat& input, cv::Mat& output); | |
static void to_gray_m3(const cv::Mat& input, cv::Mat& output); | |
static void to_gray(const unsigned char* input, | |
const int width, |
This file contains hidden or 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
#include <iostream> | |
#include "opencv2/opencv.hpp" | |
int main() { | |
cv::VideoCapture cam(0); | |
if (!cam.isOpened()) { | |
throw std::runtime_error("Error"); | |
} | |
cv::namedWindow("Window"); |
This file contains hidden or 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 UIKit | |
class ViewController: UIViewController, FrameExtractorDelegate { | |
@IBOutlet var imageview: UIImageView! | |
var frameExtractor: FrameExtractor! | |
func captured(image: UIImage) { | |
imageview.image = OpencvWrapper.detect(image); | |
} |
This file contains hidden or 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 "OpencvWrapper.h" |
This file contains hidden or 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
#ifndef PrefixHeader_pch | |
#define PrefixHeader_pch | |
// Include any system framework and library headers here that should be included in all compilation units. | |
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. | |
#ifdef __cplusplus | |
#include <opencv2/opencv.hpp> | |
#endif | |
#endif /* PrefixHeader_pch */ |
This file contains hidden or 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 "OpencvWrapper.h" | |
#import <opencv2/opencv.hpp> | |
#import <opencv2/objdetect/objdetect.hpp> | |
#import <opencv2/objdetect.hpp> | |
@implementation OpencvWrapper | |
cv::CascadeClassifier face_cascade; | |
cv::CascadeClassifier eyes_cascade; | |
bool cascade_loaded = false; |
This file contains hidden or 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> | |
@interface OpencvWrapper : NSObject | |
+ (UIImage *)detect:(UIImage *)source; | |
@end |
NewerOlder