如何启动相机并从 iPhone 中的相机获取帧
我有一个应用程序要做,但我是一个初学者,
- 启动相机
- 启动一个线程
- 逐个线程获取当前帧线程
- 对图像执行一些操作并获取结果
- 如果步骤 4 的结果不正确然后执行步骤 3 直到正确结果
如果有人给我建议,非常感谢!
如果你有样品,那就太好了! 谢谢一次!
I have a app to do,but i'm a beginner,
- start camera
- start a thread
- get current frame by thread
- thread do something with image and get results
- if the results of step-4 is not correctly then do step-3 until get correctly results
If anyone give me advice,so thanks!!!
if you have a sample ,that's will great!
Thanks one time!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您做了哪些研究来解决这个问题?不多,因为你所说的部分是错误的。
让我详细解释一下原因:
UIImagePickerController
负责与相机相关的任务。UIImagePickerController
属于UIKit
- 这就是您问题的点 2 完全错误的地方 - 您不允许调用UIKit
来自辅助线程,否则您将遇到崩溃/意外结果。这也在开发者文档中。给我 codez
网站。如果您自己编写的一些代码无法正常工作,当然,请将其发布,我们会提供帮助。但您没有尝试甚至研究该主题。因此,请查看开发人员文档了解更多信息。
如果您是初学者,我会推荐斯坦福播客。它们为 iOS 编程提供了良好的开端。
这需要一段时间,但毕竟罗马不是一天建成的。
What research have you done to combat this problem? Not much, because what you're saying is partly incorrect.
Let me explain in detail why:
UIImagePickerController
is responsible for Camera related tasks.UIImagePickerController
belongs toUIKit
- that's where point 2 of your question is entirely wrong - you're not allowed to make calls toUIKit
from a secondary thread or you will encounter crashes/unexpected results. That's in the developer documentation too.give me the codez
website. If you have some code that you wrote yourself that doesn't work correctly, sure, post it and we'll help. But you've shown no attempt to have even researched the topic.So please, check the developer documentation for more information.
If you're a beginner, I'd recommend the Stanford Podcasts. They provide an excellent start into iOS programing.
It'll take a while, but after all, Rome wasn't built in a day.