Skip to content

Commit

Permalink
Fix UIImageToMat method by taking image scale information into account
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaoshuai Lu authored and Chaoshuai Lu committed Mar 23, 2017
1 parent 874fb7a commit de70185
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/imgcodecs/src/ios_conversions.mm
Expand Up @@ -97,7 +97,7 @@
void UIImageToMat(const UIImage* image,
cv::Mat& m, bool alphaExist) {
CGColorSpaceRef colorSpace = CGImageGetColorSpace(image.CGImage);
CGFloat cols = image.size.width, rows = image.size.height;
CGFloat cols = CGImageGetWidth(image.CGImage), rows = CGImageGetHeight(image.CGImage);
CGContextRef contextRef;
CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedLast;
if (CGColorSpaceGetModel(colorSpace) == kCGColorSpaceModelMonochrome)
Expand Down

0 comments on commit de70185

Please sign in to comment.