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 <UIKit/UIKit.h> | |
#import <AVFoundation/AVCaptureSession.h> | |
@interface AVCamPreviewView : UIView | |
@property (nonatomic, readonly) AVCaptureVideoPreviewLayer *videoPreviewLayer; | |
@property (nonatomic) AVCaptureSession *session; | |
@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
#import <UIKit/UIKit.h> | |
#import <opencv2/opencv.hpp> | |
@interface UIImage (Convert) | |
// CVImageBufferBuf 转为 UIImage | |
+ (UIImage*)imageWithImageBuffer:(CVImageBufferRef)imageBuffer; | |
// UIImage 转为 cv::Mat | |
- (cv::Mat)cvMat; |
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 <UIKit/UIKit.h> | |
@interface UIImage (Orientation) | |
- (UIImage *)fixOrientation; | |
@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
#import <Foundation/Foundation.h> | |
#import <AVFoundation/AVFoundation.h> | |
#import <Accelerate/Accelerate.h> | |
#import <opencv2/opencv.hpp> | |
@interface CVPixelBufferUtils : NSObject | |
// 将CVPixelBufferRef 转化为cv::Mat,传参的buffer格式为BGRA,不过其他四通道格式应该也适用 | |
+ (cv::Mat)matFromPixelBuffer:(CVPixelBufferRef)buffer; |