2

We need to build an image processing application for smartphones (mainly for iPhone). The operations consist of:

  • image filtering
  • composite geometrical transformation
  • region growing

Also, the user is required to specify (touch) some parts of the image. Those parts would serve as inputs for the app. Example: eyes and lip in a face. We have built a desktop version of this app. The processing part is quite heavy and we extensively used BufferedImage class.

Should we use CodeNameOne for building this app? If not then what alternatives do you suggest?

Please consider the following factors:

  • Performance
  • Ease of writing the code (for image processing)
4

1 回答 1

2

我在我们的论坛中对此给出了答案,但我认为对于重复的帖子来说这是一个值得的问题:

一般来说,对于大多数平台,除了 iOS 和可以说是 Windows Phone 之外,你的性能应该没问题。

Codename One 针对常见用例进行了优化,因为 iOS 不允许 JIT,它在桌面上永远不会像 Java 一样快,因为它真的很难进行一些优化,例如数组绑定检查消除。因此,对数组的每次访问都将包含一个分支检查,这对于图像处理来说可能非常昂贵。

除此之外,除了基本的 ARGB 之外,我们没有任何图像处理 API,而且您可以获得“图片”,这既不高效也不简单。

问题是这是一个非常具体的领域,我非常怀疑您会找到任何可以帮助您处理此类代码的解决方案。因此,您唯一的方法 AFAIK 是构建本机代码来完成实际的图像处理繁重工作。

您可以通过使用 API 使用 Codename One 来执行此操作,该NativeInterfaceAPI 允许您在本机代码中调用关键代码并使用cn1lib's 将它们包装为库。然后,您将能够获得该部分代码的本机性能,但这仅对代码中的关键部分有意义。如果您编写了大量本机代码,Codename One 的好处开始消散,您还不如使用本机代码。

于 2012-10-09T12:38:13.417 回答