如何显示和保存输入/结果图像?

时间:2015-10-31 02:50:52

标签: javascript node.js

我使用Node.js运行以下代码。在此代码中,已经进行了histogram equalization进程。如何显示和保存原始图像和结果(直方图均衡)图像?

var jsfeat = require('./build/jsfeat.js');
var im = require('imagemagick');
var cols = 0;
var rows = 0;
var image = im.identify('abc.jpg', function(err, features){
    if (!err){ 
    cols = features.width;
    rows = features.height;
}
});

var my_matrix = new jsfeat.matrix_t(cols, rows, jsfeat.U8_t | jsfeat.C4_t, data_buffer = undefined);
var equalization = new jsfeat.matrix_t(cols, rows, jsfeat.U8_t | jsfeat.C4_t);
var result = jsfeat.imgproc.equalize_histogram(my_matrix, equalization);

感谢。

0 个答案:

没有答案