javascript NodeJS 图像处理/分析是否可行?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17606451/
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
Is NodeJS Image Processing/Analysis Possible?
提问by JVG
I'm running NodeJSon the server-side, and I'm trying to do a bit of automated image processing to determine the 'base colour' of an image.
我NodeJS在服务器端运行,我正在尝试进行一些自动图像处理来确定图像的“基色”。
Here are the steps of what I want to do:
以下是我想做的步骤:
- Take an image (on a remote server, so passed through with a URL) and get its dimensions
- Use dimensions to calculate the centre of the image
- Take a 10px x 50px (WxL) rectangle around the centre-point
- Get the RGB value for each of these pixels (500 per image)
- Output the average value of the pixels
- 拍摄图像(在远程服务器上,因此通过 URL 传递)并获取其尺寸
- 使用尺寸计算图像的中心
- 在中心点周围取一个 10px x 50px (WxL) 的矩形
- 获取每个像素的 RGB 值(每个图像 500)
- 输出像素的平均值
I know such things are possible in PHP, but I'd like to use Node is possible. I've seen tutorials on using Node-imagickfor basic processing (like resizing and cropping) but don't know where to start with more advanced analysis like this.
我知道这样的事情在 PHP 中是可能的,但我想使用 Node 是可能的。我看过有关Node-imagick用于基本处理(如调整大小和裁剪)的教程,但不知道从哪里开始进行更高级的分析。
Questions
问题
(a) Is this possible with Node?
(a) 这可以用 Node 实现吗?
(b) What libraries will allow me to do this?
(b) 哪些图书馆允许我这样做?
回答by Peter Lyons
回答by summit chiu
node-itk may be helpful to you.
node-itk 可能对你有帮助。
Node-ITK is a node.js wrapper, which is built on top of ITK. It was built to facilitate noe.js' use in rapid prototyping, education, and web services for Medical Image Processing.
Node-ITK 是一个 node.js 包装器,它构建在 ITK 之上。它旨在促进 noe.js 在医学图像处理的快速原型设计、教育和 Web 服务中的使用。

