You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

UIImageCVMatConverter.h 871 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // UIImageCVMatConverter.h
  3. // lp
  4. //
  5. // Created by xiaojun on 2017/12/2.
  6. // Copyright © 2017年 xiaojun. All rights reserved.
  7. //
  8. #ifndef UIImageCVMatConverter_h
  9. #define UIImageCVMatConverter_h
  10. #ifdef __cplusplus
  11. #import <opencv2/opencv.hpp>
  12. #endif
  13. #ifdef __OBJC__
  14. #import <UIKit/UIKit.h>
  15. #import <Foundation/Foundation.h>
  16. #endif
  17. using namespace cv;
  18. @interface UIImageCVMatConverter : NSObject
  19. + (cv::Mat)cvMatFromUIImage:(UIImage *)image;
  20. + (UIImage *)UIImageFromCVMat:(cv::Mat)image;
  21. + (UIImage *)scaleAndRotateImageFrontCamera:(UIImage *)image;
  22. + (UIImage *)scaleAndRotateImageBackCamera:(UIImage *)image;
  23. +(UIImage*) imageWithMat:(const cv::Mat&) image andImageOrientation: (UIImageOrientation) orientation;
  24. +(UIImage*) imageWithMat:(const cv::Mat&) image andDeviceOrientation: (UIDeviceOrientation) orientation;
  25. @end
  26. #endif /* UIImageCVMatConverter_h */