PHP 还是 Python 进行图像处理?

发布于 2024-10-11 06:52:23 字数 114 浏览 3 评论 0原文

我正在编写一个图像处理应用程序。我只是想知道哪种编程语言最适合。 Python 或 PHP。这个过程是基于系统的,而不是基于网络的,所以我只是想Python是否可以提供更多帮助。

让我知道你的想法!

I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help.

Let me know your thoughts!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

生生漫 2024-10-18 06:52:23

Python 有诸如 SciPyPIL 所以可能是 Python。

以下是人们如何使用它:
二维阵列中的峰值检测
如何改进爪子检测?

Python has stuff like SciPy and PIL so probably Python.

Here is how people use it:
Peak detection in a 2D array
How can I improve my paw detection?

等往事风中吹 2024-10-18 06:52:23

如果不知道您想要的图像处理类型,就无法提出太多建议。

  • 如果你只想做一些通用的旋转/调整大小/等那么我想没有太大区别。

  • 如果您想做更复杂的事情,那么研究库并决定哪个最适合您的特定任务。

  • 如果您想做一些真正定制的事情,那么 C 或类似的语言可能更适合该任务。

One cannot suggest much without knowing the kind of image processing you have in mind.

  • If you just want to do some generic rotate/resize/etc then I guess there isn't much difference.

  • If you want to do something more complex, then study the libraries and decide which fits best for your particular task.

  • If you want to do something really custom, then C or similar language might be a better fit for the task.

瘫痪情歌 2024-10-18 06:52:23

可能两者都不是;这取决于你想做什么。

PHP 和 Python 都是脚本语言,因此不适合高性能数值例程(大多数图像处理需要高性能数值例程)。然而,它们都有许多可用的图像处理库,其内部结构可能是用 C 编写的。这些将会很快。

如果这些库能满足您的需求,那就没问题了。如果您需要定制一些东西,那么如果考虑执行速度,您可能最好使用 C 或 C++(或 Pascal 或其他)。

Possibly neither; it depends on what you want to do.

Both PHP and Python are scripting languages, and are therefore not suited for high-performance numerical routines (which most image processing requires). However, they both have a number of image-processing libraries available for them, the innards of which are probably written in C. These will be fast.

If these libraries do what you want, then fine. If you need to so something custom, then you're probably better off with C or C++ (or Pascal, or whatever) if speed of execution is of concern.

忘羡 2024-10-18 06:52:23

Python 更加干净和可读。
对于图像处理,还有适用于 Python 和 PHP 的 imageMagic 库。

如果您想做一些其他复杂的图像处理,而这不能通过使用库来完成,并且您仍然想在 Python 或 PHP 中完成它,那么 Python 肯定是答案,因为 Python 可以用 C 扩展——但是,等等,您没有提到C编程,好吧,还有Cython!它允许你编写 Python 模块,然后将其编译为 C

Python is more clean and readable.
For image processing there is the imageMagic library available for Python and PHP too.

If you want to do some other complex image processing, which cannot by done using a library and you still want to do it in Python or PHP, then Python is defenitely the answer as Python can be extended with C -- But, wait, you didn't mention programming in C, well, there is Cython! It would allow you to write Python modules which are afterwards compiled to C

西瓜 2024-10-18 06:52:23

这实际上取决于您想对图像做什么。您可能应该只使用批处理或类似的脚本来运行执行您要查找的处理的命令。

在这两种语言之间,我会选择 python。 php 的命令行界面只是最近添加的,而 python 主要被设计为一种脚本语言,而不是用于服务页面。对于控制台应用程序,Python 更适合。

It really depends on what you want to do with the images. You probably should just use a batch or similar script to run a command that does the processing your looking for.

Between the two languages, I would go with python. The command line interface for php is only a recent addition, while python was designed primarily as a scripting language, not for serving pages. For a console application, python is a better fit.

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