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.

Utility.h 789 B

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