|
|
@ -53,7 +53,7 @@ void UIImageToMat(const UIImage* image, cv::Mat& m, bool alphaExist); |
|
|
|
UIImage* MatToUIImage(const cv::Mat& image) { |
|
|
|
UIImage* MatToUIImage(const cv::Mat& image) { |
|
|
|
|
|
|
|
|
|
|
|
NSData *data = [NSData dataWithBytes:image.data |
|
|
|
NSData *data = [NSData dataWithBytes:image.data |
|
|
|
length:image.elemSize()*image.total()]; |
|
|
|
length:image.step.p[0] * image.rows]; |
|
|
|
|
|
|
|
|
|
|
|
CGColorSpaceRef colorSpace; |
|
|
|
CGColorSpaceRef colorSpace; |
|
|
|
|
|
|
|
|
|
|
@ -73,7 +73,7 @@ UIImage* MatToUIImage(const cv::Mat& image) { |
|
|
|
// Creating CGImage from cv::Mat |
|
|
|
// Creating CGImage from cv::Mat |
|
|
|
CGImageRef imageRef = CGImageCreate(image.cols, |
|
|
|
CGImageRef imageRef = CGImageCreate(image.cols, |
|
|
|
image.rows, |
|
|
|
image.rows, |
|
|
|
8, |
|
|
|
8 * image.elemSize1(), |
|
|
|
8 * image.elemSize(), |
|
|
|
8 * image.elemSize(), |
|
|
|
image.step.p[0], |
|
|
|
image.step.p[0], |
|
|
|
colorSpace, |
|
|
|
colorSpace, |
|
|
|