xcode ios获取相机输入

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7980259/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:18:42  来源:igfitidea点击:

ios get camera input

iphoneiosxcodecamera

提问by w00

I'm working on an iPhone app right now and i would like to do the following:

我现在正在开发 iPhone 应用程序,我想执行以下操作:

I want to start the camera by code and after that receive the images the camera sees. Then i would like to manipulate these images and push them back to the screen.

我想通过代码启动相机,然后接收相机看到的图像。然后我想操纵这些图像并将它们推回屏幕。

So for example; i'd like to grayscale every image the camera captures and display that instead as if the camera is seeing everything in grayscale.

例如;我想对相机捕获的每张图像进行灰度处理并显示出来,就好像相机以灰度显示所有内容一样。

But i have a few questions about this.

但我对此有几个问题。

  1. What is the best way to start the camera?
  2. How to receive the images the camera sees and how to push them back to the view?
  3. And lastly, how can i manipulate the images? Does iOS have a GD library (like PHP has) or anything like that??
  1. 启动相机的最佳方式是什么?
  2. 如何接收相机看到的图像以及如何将它们推回视图?
  3. 最后,我如何处理图像?iOS 是否有 GD 库(如 PHP)或类似的东西?

Please note that i don't want to start recording a video or take a photo. I just want the data of the camera, so i can manipulate the images it sees.

请注意,我不想开始录制视频或拍照。我只想要相机的数据,所以我可以操纵它看到的图像。

I hope someone can point me in the right direction.

我希望有人能指出我正确的方向。

回答by LeGom

You should check that : http://www.benjaminloulier.com/articles/ios4-and-direct-access-to-the-camera

你应该检查一下:http: //www.benjaminloulier.com/articles/ios4-and-direct-access-to-the-camera

Everything you want to do is related to AVCaptureSession

你想做的一切都与 AVCaptureSession 有关

回答by Bolek Tekielski

Even better watch the WWDC 2010 sessions for AVFoundation, like this one

更好地观看 AVFoundation 的 WWDC 2010 会议,就像这个