如何启动相机并从 iPhone 中的相机获取帧

发布于 2024-11-24 02:18:01 字数 203 浏览 1 评论 0原文

我有一个应用程序要做,但我是一个初学者,

  1. 启动相机
  2. 启动一个线程
  3. 逐个线程获取当前帧线程
  4. 对图像执行一些操作并获取结果
  5. 如果步骤 4 的结果不正确然后执行步骤 3 直到正确结果

如果有人给我建议,非常感谢!

如果你有样品,那就太好了! 谢谢一次!

I have a app to do,but i'm a beginner,

  1. start camera
  2. start a thread
  3. get current frame by thread
  4. thread do something with image and get results
  5. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心病无药医 2024-12-01 02:18:02

做了哪些研究来解决这个问题?不多,因为你所说的部分是错误的。

让我详细解释一下原因:

  1. 遇到此类问题时,您应该做的第一件事就是查阅 Apple 开发人员文档。所有公开的内容都有详细记录,因此它应该让您知道从哪里开始。
  2. 如果您先查看那里,您会发现 UIImagePickerController 负责与相机相关的任务。 UIImagePickerController 属于 UIKit - 这就是您问题的点 2 完全错误的地方 - 您不允许调用 UIKit 来自辅助线程,否则您将遇到崩溃/意外结果。这也在开发者文档中。
  3. 您需要了解 StackOverflow 不是一个给我 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:

  1. The first thing you should always do when encountering such a problem is consult the Apple Developer Documentation. Everything public is well documented, so it should give you an idea where to start.
  2. If you'd have looked there first, you would see that UIImagePickerController is responsible for Camera related tasks. UIImagePickerController belongs to UIKit - that's where point 2 of your question is entirely wrong - you're not allowed to make calls to UIKit from a secondary thread or you will encounter crashes/unexpected results. That's in the developer documentation too.
  3. You need to understand that StackOverflow isn't a 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文