【问题标题】:iphone camerOverlay for use with Alternate Reality applicationsiphone cameraOverlay 与 Alternate Reality 应用程序一起使用
【发布时间】:2010-11-15 05:37:58
【问题描述】:

有没有人知道一种方法可以在 iphone 的相机上拍摄图像,并进行一些图像处理(例如边缘检测、骨架化),然后将处理后的图像的一部分覆盖在原始图像上(例如仅突出显示的边缘) .

更一般地说,我如何创建具有透明度的 UImage(我只是缩放图像并用 alpha 值覆盖它,UIImage 是否像 gif 那样支持透明度)。我认为您可以将 UIImagePickerController 与 UIImagePickerController 视图的takes "screenshots" 的后台线程结合起来,并对其进行图像处理以检测各种对象并提供叠加的增强现实显示。

有一个用于 iphone 的开源 simple image processing librarydemo shows an example 拍摄原始照片(数独板),然后将检测到的对象覆盖在原始照片中。

他们解释了一些high-level techniques on their blog

【问题讨论】:

    标签: iphone graphics image-processing augmented-reality


    【解决方案1】:

    OpenCV 使图像叠加变得非常简单,它一直是ported to the iPhone。使用 OpenCV,您可以选择在考虑时截取屏幕截图或在实时流上进行图像处理,一次一帧。看看它的一些教程程序,它们真的很有帮助。

    【讨论】:

      【解决方案2】:

      您可能想要设置 UIImagePickerController.overlayView 属性:

      // Create a new image picker instance:
      UIImagePickerController *picker = [[UIImagePickerController alloc] init];
      
      // Set the image picker source:
      picker.sourceType = UIImagePickerControllerSourceTypeCamera;
      
      // Hide the controls:
      picker.showsCameraControls = NO;
      picker.navigationBarHidden = YES;
      
      // Make camera view full screen:
      picker.wantsFullScreenLayout = YES;
      picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, 1, 1.12412);
      
      // Create an overlay view
      // this might need to either 1) be transparent, or 2) be of the other dimensions
      OverlayView *overlay = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height)];
      
      // Insert the overlay:
      picker.cameraOverlayView = overlay;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-12-22
        • 2010-12-02
        • 2011-06-23
        • 1970-01-01
        • 2016-11-29
        • 2010-11-10
        • 2012-12-29
        • 1970-01-01
        相关资源
        最近更新 更多