CGAffineTransformInvert:UIImagePickerController中的奇异矩阵,带showsCameraControls = NO [英] CGAffineTransformInvert: singular matrix in UIImagePickerController with showsCameraControls = NO

查看:389
本文介绍了CGAffineTransformInvert:UIImagePickerController中的奇异矩阵,带showsCameraControls = NO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用两个不同的应用程序尝试了两次,我得到同样的东西。我有一个设置UIImagePIckerController实例,如下所示:

I tried this twice with two different apps and I get the same thing. I have a set up a UIImagePIckerController instance as follows:

- (IBAction)addImage:(UIBarButtonItem *)sender {


    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
        NSArray *mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
        if ([mediaTypes containsObject:(NSString *)kUTTypeImage]) {
            UIImagePickerController *picker = [[UIImagePickerController alloc] init];
            picker.delegate = self;
            picker.sourceType = UIImagePickerControllerSourceTypeCamera;
            picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
            picker.allowsEditing = NO;
            picker.showsCameraControls = NO;

            [self presentViewController: picker animated:YES completion:NULL];

        }           
 [..]   

}

这是第二次。在第一次我设置了自定义叠加来运行快门和其他功能。一切运行正常,但我一直在控制台上出错:

This was the second. In the first I set up a custom overlay to run the shutter and other functions. Everything runs fine but I keep getting an error on the console:

 <Error>: CGAffineTransformInvert: singular matrix.

当我运行应用程序时,每次我旋转(或移动哪些信号旋转)设备当相机上升 {这里发生的事情} 。我在iPhone 4和iPad Mini上都尝试了相同的效果。经过大量的挖掘后,我发现这只发生在

When I run the app, every time I rotate (or move about which signals a rotate) the device while the camera is up {something happens here}. I tried it on both my iPhone 4 and iPad Mini with the same results. After a lot of digging I found this only happen in the case where

picker.showsCameraControls = NO;

如果我把

picker.showsCameraControls = YES;

然后我没有收到任何消息(虽然我的自定义叠加层也被隐藏了)。确保它不是自定义叠加层本身我尝试将其删除,它仍然会给出错误信息。

Then I get no message (though my custom overlay is hidden too). Making sure it wasn't the custom overlay itself I tried leaving that out, and it still gives the error message.

任何人对我应该怎么做才有任何想法?

Anybody got any ideas of what I should do about this?

推荐答案

我相信它基本上是良性的,因为Apple自己的PhotoPicker示例代码会产生此警告。旋转与矩阵有关,虽然我不确定哪个矩阵特别是旋转,但是对于具有零行列式(类似于除以零)的矩阵执行运算被认为是数学违规。这样的矩阵不可逆或单数:

I believe it to be largely benign as Apple's own PhotoPicker sample code generates this warning. Rotation has to do with matrices and while I'm not sure which matrix in particular is getting rotated, it is considered a mathematical violation to perform operations on matrices with a determinant of zero (similar to dividing by zero). Such a matrix is not invertible or 'singular':

http://en.wikipedia.org/wiki/Rotation_matrix

http://en.wikipedia.org/wiki/Determinant

http://en.wikipedia.org/wiki/Singular_matrix#singular

这篇关于CGAffineTransformInvert:UIImagePickerController中的奇异矩阵,带showsCameraControls = NO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆